WorldWind Geoserver Tiled Image Layer level of detail

I've got GeoServer hosting an imagemosaic layer, and i'm trying to view it in WorldWind (WWJ). I'm using the below xml config file, and it _sort of_ works. the issue is it doesn't seem to download tiles when zooming/panning in any sensical way. it's almost as though it only downloads levels of detail at very specific zoom levels. i'm not sure though, it's very sporadic. i don't think geoserver is the issue. if i view it in WWJ using the WMSLayersPanel example it works perfectly well. please let me know if you see anything wrong with my xml, or if you have other ways to view a Geoserver WMS layer from World Wind. thanks!               <?xml version="1.0" encoding="UTF-8"?>     <Layer version="1" layerType="TiledImageLayer">         <DisplayName>Locally Served Imagery</DisplayName>         <Service serviceName="OGC:WMS" version="1.3">             <GetCapabilitiesURL>http://localhost:9999/geoserver/mike/wms?service=WMS</GetCapabilitiesURL>             <GetMapURL>http://localhost:9999/geoserver/mike/wms?service=WMS</GetMapURL>             <LayerNames>mike:mosaictest</LayerNames>         </Service>         <DataCacheName>Earth/LocalWMS</DataCacheName>         <FormatSuffix>.png</FormatSuffix>         <ImageFormat>image/png</ImageFormat>         <AvailableImageFormats>             <ImageFormat>image/png</ImageFormat>             <ImageFormat>image/jpg</ImageFormat>         </AvailableImageFormats>         <NumLevels count="19" numEmpty="0"/>         <Sector>             <SouthWest>                 <LatLon units="degrees" latitude="24.0" longitude="-125"/>             </SouthWest>             <NorthEast>                 <LatLon units="degrees" latitude="50.0" longitude="-66.0"/>             </NorthEast>         </Sector>         <UseTransparentTextures>true</UseTransparentTextures>     </Layer>


Sources for California roads data

I need a California roads network suitable for building a network dataset and routing to 120 locations. It needs to at least cover the Northern half of California. 2010 Census roads need alot of cleanup or I would try using those. Any ideas for places to start? Thanks,


How to know what spectrum image layers are in eCognition?

I'm learning to use eCognition (8.1) and my teacher has provided me with some example tif files to segment and classify. The tif files have multiple layers, each of which are supposed to represent a light spectrum (Red, Green, Near- infared, etc). The problem is that I'm not always given descriptions of what spectrum each layer is supposed to be. My question is, is it possible tell what spectrum a layer is supposed to represent?


determine whether a circle intersects a county boundary in postGIS

I'm using PostGIS 2.0.1 and need to determine whether a circle (center + radius) intersects a county boundary (polygon). The query I'm using is this:               SELECT DISTINCT(u.id) FROM siteareas_poly sa, userlocations ul,                  clienttypes ct INNER JOIN users_clienttypes uct on ct.id = uct.clienttype_id                  INNER JOIN users u on uct.user_id = u.id                  WHERE sa.id = 'concord' and ct.id = 2                  AND ul.geog_lnglat is not null                 AND  ST_Intersects(st_exteriorring(sa.boundary), ST_BUFFER(ul.geog_lnglat,ul.radius_km * 1000)::geometry)      where the ul.geog_lnglat is a               geography(Point,4326)      and the sa.boundary is               geometry      I've tried a few variations on this and always gotten no results, when I expect to get at least one, as I have a row in userlocations that lies in that county (by zip lookup). Am I making any glaring errors in my approach?


Search MXDs for feature class

I've inherited a large somewhat messy database and am attempting to clean it up a bit. Does anyone know if it is possible to search a database to see what arcGIS map documents use a feature class? I'd like to delete old versions of my feature classes, but don't know if they are in use in a mxd somewhere. This would also be useful to see what mxds need to be updated because they're using old versions of data. I'm envisioning a search in ArcCatalog that specifies a feature class and returns a list of mxds and maybe relationships that use said feature class. Any suggestions appreciated. Thanks in advance!


what is the metadata link in geoserver layer definition for?

I`m adding some layers in geoserver and I noticed that there is a place to put a metadata link. It also says that it should be according to FGDC or tc211. What can I put in this metadata link field? The url for the geonetwork metadada page? Or a xml file with the metadata? Also, how can I use the information from that field i.e. query the metadata?


How to set a spatial filter with Python/GDAL?

Is there a way with GDAL (Python) to set a spatial filter (bounding-box) on a raster before I process it? I want to read it as an array.               BandReadAsArray(band, xoff=0, yoff=0, win_xsize=None, win_ysize=None, buf_xsize=None, buf_ysize=None, buf_obj=None)


Heat Map to find 10 restaurants, 10 retail, and 10 stores open after 6pm within 3 linear blocks

I would like to find where in the City there is a combination of 10 restaurants, 10 retail, and 10 stores open after 6pm within 3 linear blocks. What is the best way to do this? What data would I need and how would I analyze this? I would assume I need hours of operation, not sure how to get this (business license data, business associations, scraped from websites)? I will need land use classification, zoning data, block parcels, … Any ideas would be helpful. I was also thinking of do the same analysis using zoning data to compare where this combo is possible vs where it exists. I would like to use QGIS or GeoMedia.


Problem about exporting the project

I'm working on a project using QGIS. I have 3 layers in the project, city boarder, the location of the natural monuments, and a layer as background card. I am going to have these three layers in my project, and I want to have the photos of 129 natural monuments as a row at the corner of layout. When I try to export the project as a PDF documents, it doesn't allow to continue the process. Could you please help me to solve this problem?


Help required with OpenLayers WPS client

I am using openlayers API in my web application and trying to interact with the local GeoServer via WPS. The problem I am facing is that, `WPS client.execute()` works only in case, if the output of the Process is Geometry type (`i.e. for JTS:intersection, JTS:buffer, etc`). It does not seem to work if the output is double/string/bool(`i.e. for JTS:area, JTS:envelope, JTS:equalsExact, etc`). For eg., the following code does not popup a "success" message.                var geometry = OpenLayers.Geometry.fromWKT(                        'POLYGON((110 20,120 20,120 10,110 10,110 20))'                     );           client.execute({                 server: "local",                 //process: "JTS:envelope",                 process: "JTS:geometryType",                 inputs: {                     geom: geometry                 },                           success: function(output) {                     alert('success');                 }       });      _But if I happen to replace JTS:geometryType with JTS:envelope, it works !!.._ Not much of tutorials are available on internet. Is it a restriction in client.execute() or am I doing something wrong in the code ? Thanks.


AGI STK Server alternative

AGI has a server product called STK Server that exposes REST services to perform satellite acquisition planning. However the cost is astronomical $200k+ (pun inteded). They also have STK components (DLLs) which will allow you to build the web services yourself but, this API is also expensive. Does anyone know of any economical alternatives? Any actively maintained open source projects would be great. I need either an API or web service (REST, SOAP, etc) which I can perform satellite feasibility analysis. For example: I give it a point, time, and satellites (or sensors) I'm interested in and it will give me the available ground swaths. I found eo-sps-library, but it doesn't look like anyone is maintaining it.


What KML features are suitable to display 3D atmospheric density data using Google Earth?

I wish to use Google Earth to visualise and explore 3D atmospheric density data. In my case it is ionospheric electron density, which is a niche area, but I can imagine this might have been done by someone to display say atmospheric moisture content or pollution levels (or volcanic ash plumes??). I am new to KML files, but reading over the developer guide it isn't obvious how best to go about this. Would you slice your 3D density data into many 2D layers and use < altitude > elements? Or would it be better to use grid the data into many small cubes and use < polygon >s? Or some other option? I'm sure this has been done before, but I couldn't find any suitable examples.


Resolve polygon parent relationship in QGIS

I have a layer in which, following geometry processing, the polygon of a zone that is a full enclave to another seems to have become its child object, which I think will cause problems down the line. How can this be resolved so the enclave shares the same shapefile parent as its neighbour? Thanks in advance. The Shapefile is available here. The area: ![enter image description here](http://i.stack.imgur.com/i3Fuo.png) The child feature (Carlisle) visible on inspection as child of surrounding Penrith. ![enter image description here](http://i.stack.imgur.com/oAvjS.png)


Problem with calculating the total cell values

> > > aa= arcpy.RasterToNumPyArray("water_depth") >>> >>> sum = numpy.sum(aa) >>> >>> print sum >>> >>> -2933737 Why I am getting negative values ? In my raster there is no any negative depth.


How to read XY, get raster value and then update field?

I've written a script to run through a point layer, using the SearchCursor in the data access module and then read the XY values. Within the `with` statement, I then use `GetCellValue` to get the elevation values and print them. What I'd like to do is go one step further and write the value to a field in the row. Is there a way to do this? I can use `CalculateField`, but that'll be slow as it'll have to use a query to limit itself to the current row. I can also possibly use a list to write the values to and then run through the list and update the fields using the `UpdateCursor`, but I think that'll be slow too. Is there a way to do this inside the `with` statement?               import arcpy          ##arcpy.AddField_management('C:\Data\Surveyed.shp', 'Z', 'DOUBLE')          with arcpy.da.SearchCursor('C:\Data\Surveyed.shp', ['SHAPE@XY']) as cursor:         for row in cursor:             result = arcpy.GetCellValue_management('Database Connections\DC_SDEEBG_gisp.sde\SDEEBG.GIS.SRTM_DEM_NSWVICTAS_1SEC', str((row[0])[0]) + " " + str((row[0])[1]), "1")             CellValue = float(result.getOutput(0))             print CellValue


Point to point and point to line

I have several points. These points are far from some lines. I want to make the following: If two points are closer to each other than the maximum distance of one of these points to the closest line, then connect the points to each other and connect the point that is closer to the line to the line. Is there a quick way of doing it? I have used the xy to line to connect points to the line, but I do not know how to make this operation. Attached a snapshot to make it more clear. ![enter image description here](http://i.stack.imgur.com/RTHod.png) _(Edit - should the screenshot look more like this? The two points on the left are closer to each other than to the line, so they are connected to each other. The two points on the right are closer to the line than to each other, so they are connected to the line)_ ![enter image description here](http://i.stack.imgur.com/FO0ww.jpg)


Display two-dimensional color gradient for two different quantities

I have two overlapping raster layers. One contains quantity A from 0 to 100, and the other contains quantity B from 0 to 100. I'd like to create a map displaying both sets of data at once based on a color box with two different axes. So, for an area where:   * A is 100 and B is 100, the map would be red   * A is 100 and B is 0, it would be yellow   * A is 0 and B is 100, it would be green   * A is 0 and B is 0, it would be blue For intermediate values the hue would change accordingly, so A=100, B=50 would be orange; A=50, B=0 would be blueish-green. I have seen maps display this type of data before, and I have a couple of things I'd like to display this way. What is the easiest way to do this? I can use ArcGIS, QGIS and R.


Shapefiles for U.S. Area Codes (NANP)

I have a bunch of telephone numbers (just the area codes), and I'd like to geolocate them and make a map, but I haven't had too much luck googling for shapefiles for Area Codes. Surely these are in the public domain?


What is the typical v.surf.xxx exicution time? I am trying to run v.surf.bspline on a set of ~1600 points. It has bee running for about an hour now and is stuck at spot indicated in the image. ![this is where it gets stuck](http://i.stack.imgur.com/cDipt.png) I am wondering about the time because I am not sure which interpolation method I will use and want to see the results fom all of the diferent methods. Thank you for your help


Problems installing the Astun Technology Loader in Windows 7

I previously asked a question Using OS Mastermap SLDs in QGIS I got several answers suggesting that I use the Astun Technology Loader. There are details on how to do this https://github.com/AstunTechnology/Loader/wiki/Installation. However this has proved very difficult in Windows 7 The first problem was the PATH environment in the OSGeo4w shell which is not the same as the standard 'cmd' shell. In the OSGeo4W shell having changed to the directory where distribute_setup.py is located the first problem is trying to run 'python distribute_setup.py'. It is necessary to either add C:\python33 to the PATH variable or directly reference it. This then runs OK. From the same shell and directory and having located easy_install in C:\python33\scripts I have tried running 'easy_install lxml==2.3' this fails giving the errors ERROR: b"'xslt-config' is not recognised as an internal or external command make sure the development packages of libxm12 and libxslt are installed error: Unable to find vcvarsall.bat There was no file called 'vcvarsall.bat' on my PC. From searches on the net I discovered it is part of Visual Studio 2008. Luckily I had a copy of Visual Studio 2008 which I have now installed. 'vcvarsall.bat' is now installed in the directory C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC. I have added this directory to the PATH variable in the OSGeo4W shell without any success. I am now completely stuck - Any suggestions?


Reading MODIS L1B into ENVI

I am working with MODIS Terra (and simultaneous ASTER) Level 1B swath data using ENVI and am having one of these "this should be easy" questions about the most direct way to get to geo-referenced datasets of radiances (and reflectances). There are two ways I'm familiar in reading in this data:   1. If I download the HDF L1B swath datasets they come as files named MOD021KM.Ayyyyddd.[whatever].hdf containing scaled integers, with the scaling factors in the header. The geolocation information is in separate files MOD03.Ayyyydd.[whatever].hdf, which I have as well. ENVI is able to convert the scaled integers into radiances, but not to apply the geolocation (to effectively turn this into a Lat/Long projecton). So I'm currently stumped with this approach.   2. Alternatively, I can download my swaths band-by-band as GeoTIFF from the NASA LAADSWEB site, which combines the relevant MOD021KM and MOD03 files. I read them into ENVI and stack the bands I need. But then I still need to convert the data into radiances/reflectances, which requires me to download the HDF file as well and search around in the header for the correct coefficients.  Right now I'm doing 2. But is there a way of going down the path of 1? ENVI's "Geolocate MODIS" function stumps me -- it seems there's something for L3 data and L1A data, but nothing for L1B.


accent-insenstitive text in CartoDB - PostGreSQL unaccent function missing?

I am trying to do accent-insensitive text matching, but PostGreSQL's unaccent function doesn’t appear to be available SELECT unaccent('Hôtel'); function unaccent(unknown) does not exist Is this function supported somehow in CartoDB? If not, is there an alternative?


How to refresh Catalog window from ArcMap using Python?

I am running my script from ArcMap and I have the Catalog window open on the side. I delete some extra files in the end of my script but I have to **refresh the Catalog window** to see them go. So I decided to use the following code to refresh it automatically:               import arcpy      from arcpy import env     import os.path          # Parameters     XS = arcpy.GetParameterAsText(0)          # Environment Definition     desc = arcpy.Describe(XS)     path = desc.path     env.workspace = path #Everything is saved at *path*          arcpy.RefreshCatalog(path)      But it doesn't work either. Any idea what is missing here? I am running my script though a toolbox. And my files are located at _path_.


Regression with Nominal and Categorical Data

I am doing a project looking at the prevalence of a weeds in an area. As an example, I have the following layers:   * Weeds Layer (polygons) {categorical data} Each polygon represents a point or polygon that corresponds to a certain type of weed. There are 16 weed types.   * Plant Zone Layer (polygons) {categorical} Each polygon corresponds to 1 of 7 categories.   * Rainfall {polygons} {Ordinal Numerical categories} Each polygon corresponds to one of 5 ranges, like 0-5 inches, 5-10 inches etc   * Average vegetation height (polygons) {Numerical} Polygons representing the average height of vegetation These layers are all projected and fit nicely on top of each other in my workspace. I want to answer questions like, "Where does weed X occur most often? (Dry areas?, in plant zone 4?, where the vegetation is high?) So, this sounds like something suited for correlation and regression in something like R, but things are only spatially related. I'm new to GIS and any help greatly appreciated. I'll clarify my goals if it helps. Thanks


FME values used in python

I need one attribute value from FME and use it in python script as a parameter. How can I do this? Do I have to have def_ _init_ _() def input(), def close() also?


How to identify feature vertices that are part of a donut hole in ArcGIS 10?

I´m exporting the coordinates of polygon vertices to a CSV-File using the "Feature Vertices to Points" and then the "Export feature attributes to ASCII"-tools. Some of these polygons have holes (donuts). Can I do the analysis in a way, that in the resulting CSV-File it´s possible to identify if a point has been part of the outer boder or the inner border (donut) of the polygon? Thanks, Martin


GeoExt.Popup and get GID

I'm using GeoExt.Popup to create a popup when a user click on an WFS (point) on the map. When the user click on a point on the map I want to send the GID (primary key from DB) to a servlet or JSP to send back HTML with all information about that point (using iframe inside the GeoExt Popup). I don't know how to get the GID value for the point that user clicked. Any one knows how to get an attribute from the map? I'm using this code:                   if (popup) {         popup.destroy();         popup = new GeoExt.Popup({         title: "Info:",         width: 600,         height: 350,         margin: 1,         autoScroll: true,         maximizable: true,         collapsible: true,         map: map,         location: map.getLonLatFromPixel(e.xy),          //html: e.text         html: "<iframe src='response.jsp?codVertices=1' width='100%' height='100' frameborder='0'></iframe>"});         popup.show();      In the "HTML" option I want to get the GID and send it to the servlet or JSP. It's working fine when I manually insert the GID in the html code... Thank you very much. Pedro


How to start using the SharpMap library?

I am a very newbie on GIS and also programming especially c#. I am trying to develop a program to:   1. display map from geotiff, dted (level 2 i guess), shapfiles and jpeg type of files.    2. display movement a vehicle with regards to velocity input   3. display latitude, longitude, elevation, pitch and roll   4. vehicle icon representing correct geographic location   5. calculate actual distance travelled I have been told to use SharpMap library and I am doing it on Microsoft Visual Studio 2010. Any tips how to start using the SharpMap library and to program? Any pro on SharpMap that might help me? Thanks


How to connect QGIS to a WMS-C with python?

I would like to connect my QGis to a WMS-C server when my python plugin load. How can I do that ? BTW, the method: addRasterLayer do not seams to handle WMS-C layer...


Trouble with graduated symbols after joining shapefile with csv file

I have successfully joined data from a csv file to a shapefile in QGIS but for some reason I am having trouble symbolizing my data. I want to use a graduated symbology however this option is not available for any of the columns for my joined table. I have tried saving as a new layer but this does not change the issue. Has anybody got any tips to get around this?


How to get the length of a line inside a polygon

How can I get the length (brown marked part) of the "Road 7" inside the red polygon? ![a busy cat](http://i.imgur.com/kJXZo.png) My start:               SELECT ST_Length(way) FROM lines WHERE road = "Road 7" AND ST_Intersects(line, polygon)?      With that, I get only the total length :( Someone has an idea?


Creating a SQL query in the ArcGIS Explorer SDK

I am using the ArcGIS Explorer SDK and have run into an issue surrounding a query I would like to perform with SQL. I believe my query is built wrong or perhaps I am looking at the wrong fields. Would anyone have any input on my code below and/or possible solutions? I would like the code to query a column for specific values then return them into a combo box. My query simply returns a blank value at the moment. Below is the code for that block. Thank you,               Try         Dim md As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay             Dim map As Map = md.Map             Dim cblayernameselect As MapItem = cblayername.SelectedItem             Dim cbfieldnameselect As String = cbfieldname.SelectedItem             Dim selitem As SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems                  cbattribute.Items.Clear()                  selitem.Select(cblayernameselect)                  Dim child As PackageChildLayer = TryCast(ESRI.ArcGISExplorer.Application.Application.SelectedItems(0), PackageChildLayer)             Dim layertable As Table = child.Table                  Dim cbcolumn As Column = layertable.Columns.Item(cbfieldnameselect)                  Dim whereclause As String = "SELECT " & cbcolumn.Name & " FROM " & layertable.Name                  Dim rows As RowCollection = layertable.Search(New Filter(whereclause))                       For Each row In rows                 cbattribute.Items.Add(row)             Next row              Catch ex As Exception             MsgBox(ex.Message)         End Try


Speeding up raster to point set function

I have written the following function that takes a raster (always non-skewed) and returns a set of points. As I'm executing it millions of times in my queries, I'd like for it to be super-optimized (my queries currently take hours to complete). **Question** : Can the code below be improved? Who knows a trick for doing this operation faster? Also if the below is not correct, don't be shy to point that out either. Oh, and if you think this is actually a half-decent way of doing it, don't be shy to point that out either :D For my input (average cells: 38 x 21), the below runs at approx 15ms per raster (rasters are in memory). Platform is PostGIS 2.0/PostgreSQL 9.2.4. Thank you.               CREATE OR REPLACE FUNCTION CVL_RasterToPoints         (             the_raster raster,             OUT pt geometry         ) RETURNS SETOF geometry AS         $$         SELECT             ST_Translate(                 PT.pt,                 (IDX.i - 1) * ST_PixelWidth($1),                 (IDX.j - 1) * ST_PixelHeight($1)             )         FROM             (SELECT                 generate_series(1, ST_Width($1)) AS i,                 generate_series(1, ST_Height($1)) AS j             ) IDX,             (SELECT             ST_SetSrid(                     ST_Point(                         ST_UpperLeftX($1) + (ST_PixelWidth($1) / 2),                         ST_UpperLeftY($1) + (ST_PixelHeight($1) / 2)                     ),                     ST_SRID($1)                 ) as pt             ) PT         WHERE             ST_Value($1,IDX.i,IDX.j) = 1         $$ LANGUAGE sql IMMUTABLE STRICT;


How to show points and polygons in single layer?

I have big trouble to show points and polygons in same layer in geoserver. I have one table named as ABC. in ABC there are two geometry fields- 1.the_geom 2.the_geom_polygon Note: Some rows may/may not have geometry values. Now, I am trying to publish this on geoserver 2.2. I created style like this.                   <?xml version="1.0" encoding="ISO-8859-1"?>     <StyledLayerDescriptor version="1.0.0"         xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"         xmlns="http://www.opengis.net/sld"         xmlns:ogc="http://www.opengis.net/ogc"         xmlns:xlink="http://www.w3.org/1999/xlink"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <NamedLayer>         <Name>Testing</Name>         <UserStyle>           <Title>Point_polygon_style</Title>           <FeatureTypeStyle>           <FeatureTypeName>Feature</FeatureTypeName>           <SemanticTypeIdentifier>generic:geometry</SemanticTypeIdentifier>           <SemanticTypeIdentifier>simple</SemanticTypeIdentifier>          <Rule>     <Name>polygon</Name>         <MaxScaleDenominator>2500</MaxScaleDenominator>         <PolygonSymbolizer>         <Geometry><ogc:PropertyName>the_geom_polygon</ogc:PropertyName></Geometry>             <Stroke>                   <CssParameter name="stroke">#FF8501</CssParameter>                   <CssParameter name="stroke-width">1.5</CssParameter>             </Stroke>       </PolygonSymbolizer>     </Rule>            <Rule>        <Name>poi_educational_institute</Name>          <PointSymbolizer>             <Geometry><ogc:PropertyName>the_geom</ogc:PropertyName></Geometry>             <Graphic>                <ExternalGraphic>                  <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="test.png"/>                    <Format>image/png</Format>                </ExternalGraphic>                <!--<Size>                    <ogc:Literal>17</ogc:Literal>                </Size>-->            </Graphic>          </PointSymbolizer>     </Rule>            </FeatureTypeStyle>     </UserStyle>     </NamedLayer>     </StyledLayerDescriptor>      When going to the Layer preview , its showing Error like this               code="internalError"Rendering process failed     java.io.IOException     null     Error: Operation on two geometries with different SRIDs      I thing the values are null in the geometry fields(the_geom/the_geom_polygon). How can i give filter to check whether geometry is null/not(in style)? Can you please help me to solve this... Regards Mohammed Shafeek


Rendering a shapefile with a custom projection in GeoTools

I have an image, a shapefile, and a method which can translate an x/y pixel location from the image into a latitude/longitude point or vice versa. I'm trying to use Geotools to render the shapefile on the image, but I can't seem to get it to work. All of the examples and tutorials I can find use factories to retrieve pre- existing transforms and mappings, but how can I use my custom projection? Edit: The image is the view from a satellite, which means that it cannot see the entire earth. Is Geotools capable of handling this? Edit2: I don't think that this can be done easily in GeoTools, I ended up just writing what I needed from scratch.


Can I append to different tables using ogr2ogr?

I have been through many related questions and links but I am still confused as to how/if this is achievable. So, I have defined tables in my postgis database and I would like my ogr2ogr commnand to append to these existing tables rather than create its own - using GML files that I have. I have tried using -nln and -sql but I had no success. The -nln option seems useful when importing a shapefile which usually contains one type of geometry thus needing to specify one table only. But what happens when need to specify 11 tables? Finally, I found some links to use python with ogr library. I have not found good documentation with examples though... Any suggestions? Thanks in advance! Kind regards, A


Why does Driving distance of pgRouting return disconnected results?

I am trying the driving distance function of pgRouting 2.0 beta, with an extract of OSM data. The problem i have is illustrated on the following image : ![enter image description here](http://i.stack.imgur.com/YYHxq.png) On this picture i try to get all the ways accessible in 5 min from the downtown of the small city. For this purpose, i use the driving distance function. Clearly, the result is not ok : ways that should be returned are not, ways that shouldn't are (and far away from the area). I'm pretty sure it's a problem during the creation of the topology, so I've tried various tool to import data and create the topology : \- osm2postgis, osmosis + pgr_createTopology function of pgRouting \- osm2po With exactly the same kind of problem each time. I've changed the tolerance of disconnected edge of the pgr_createTopology function and tried a large range of values, without success. I haven't many experience in GIS, postgis and pgrouting, i would be very pleased if you have some tricks or an idea about the problem ! Thank you for your help ! Xavier (I'm using postgis 9.2 + pgRouting 2.0 beta)


Raster Interpolation of Different DEMs in GRASS

I am trying to generate a DEM for surface runoff modeling in GRASS. I have a DEM for the entire watershed at 1ft resolution and another for the small area within that watershed (a parking lot) I am interested in modeling, at much higher resolution. I have joined the two using r.patch and now have a single DEM for the whole watershed. However, the elevations at the boundaries of the parking lot do not exactly match those from the coarser watershed DEM, and discontinuities occur at these boundaries that will make my runoff model inaccurate. I have tried to smooth these boundaries by r.resamp.stats (to try and average between the two) and have met little success. Does anyone have a method by which I can smooth these border discontinuities?


Do Network Services support Multimodal Networks (ArcGIS 10.1, Network Analyst Extension)?

Do Network Services support Multimodal Networks (ArcGIS 10.1)? I'm assuming that multimodal networks are supported, but I am troubleshooting and just want to be sure. Thanks, eric


Delete duplicate points in ArcGIS 10.1

Recently was doing some work on an old layer and found that when I selected one point, or used the identify tool I was returning SEVEN points when it should just be one! I am currently using an ArcGIS 10.1 and have access to both Editor and Info licenses. Is there an easy way to delete these duplicates via python, or another tool? The ObjectIDs are different but the values contained in other fields are the same. Therefore I think looking at intersecting geometry would be the best option There is probably easily over 2000 points with duplicates. Thanks.


How do you define rail network branch geocodes

As per the attached document I'm trying to define a rail network by providing geocodes for each rail stop, how would I define a 'stop' as a junction for a branch in the network without having to define each branch option multiple times. For example, if I need to travel from Brisbane to Longreach in one trip and in the next trip Brisbane - Mackay, I don't want to have to define each stop from Brisbane - Rockhamptom for each of these branches. I want Google to pickup in the definition of my geocodes that Rockhampton is the stop which 'forks' into one or more branches, it will then continue to display the polylines of the branch which is closest to the destination. In summary, in the example I've defined my destination station may be on one of two lines, I don't want to have to define the geocodes for those lines separately especially when they share more than half of the same geocodes up to a certain point, how is this best achieved? Thanks in advance.


Create Unique ID in ARCPAD Form Code Issue

I'm trying to create a Unique ID that pops up on a custom form I'm making in ArcPAD. This is needed so field workers can include this number on some supplemental paper tables that they carry around. I've pasted together the following code which mostly works; however, if someone uses the repeat attributes toggle then the "unique" ID is also repeated. **Is there any way to test to see if the repeat attributes toggle is on or off?** I can't find it anywhere in the Object Model. Here's my code. This runs on the ONLOAD event for the form (sorry for the lack of documentation). This basically just loops through the features and finds the highest number in the ID field and adds 1. If the ID box on the form is already populated this is not executed.               Option Explicit     Dim varUniqueID          Sub UniqueID2         Dim objRS, HighValue, CurrentValue, objEFPageOneControls, objEditForm          Set objRS = Application.map.layers("OFF_ROAD").records         Set objEditForm = application.map.layers("OFF_ROAD").forms("EDITFORM")         Set objEFPageOneControls = objEditForm.Pages("Page1").Controls              If (objEFPageOneControls("IDBOX").Value = "") Then             If (objRS.RecordCount > 0) Then                 objRS.Movefirst                      HighValue = objRS.Fields("ID").Value                 objRS.MoveNext                      While Not objRS.EOF                     CurrentValue = objRS.Fields("ID").Value                          if HighValue < CurrentValue Then                         HighValue = CurrentValue                     End If                          objRS.MoveNext                 Wend                 HighValue = HighValue + 1             End If             objEFPageOneControls("IDBOX").Value = HighValue              End If     End Sub


How could I make this PostGIS query run faster?

SELECT st_band(rast, 1), st_width(rast), st_height(rast),     st_bandpixeltype(rast, 1), st_bandnodatavalue(rast, 1),     st_scalex(rast), st_scaley(rast), st_upperleftx(rast),     st_upperlefty(rast) FROM public.elevation WHERE st_intersects(rast,     st_polygonfromtext('POLYGON((-94.00010416666670210     67.50010416666670210, -93.00010416666670210 67.50010416666670210,     -93.00010416666670210 67.00010416666670210, -94.00010416666670210     67.00010416666670210, -94.00010416666670210 67.50010416666670210))',     4269))      There's a GIST index created over rast column:               CREATE INDEX elevation_rast_gist       ON elevation       USING gist       (st_convexhull(rast) );      This is the 'explain analyze' output               Seq Scan on elevation  (cost=0.00..6.30 rows=1 width=32) (actual     time=2039.622..2614.787 rows=2 loops=1)        Filter: (((rast)::geometry &&     '0103000020AD1000000100000005000000511BE8B4018057C0511BE8B401E05040511BE8B4014057C0511BE8B401E05040511BE8B4014057C0511BE8B401C05040511BE8B4018057C0511BE8B401C05040511BE8B4018057C0511BE8B401E05040'::geometry)     AND _st_intersects('0103000020AD1000000100000005000000511BE8B4018057C0511BE8B401E05040511BE8B4014057C0511BE8B401E05040511BE8B4014057C0511BE8B401C05040511BE8B4018057C0511BE8B401C05040511BE8B4018057C0511BE8B401E05040'::geometry,     rast, NULL::integer))      Total runtime: 2615.145 ms      The coordinates used in intersection are not important. The point is I want to fetch all raster rows that intersect a given window. So:   1. Is there any other additional index I should create?   2. Is there any other way to write the query to make it faster? Many thanks in advance, and best regards,


Syntax question for ArcGIS ICalculator object

This is a silly question, but I have this code snippet that I can't figure out:               'Define a calculator for NewArea field         pCalculator = New Calculator         With pCalculator             .Cursor = pCursor             .PreExpression = "Dim dbarea as double" & vbCrLf _                            & "Dim pArea as IArea" & vbCrLf _                            & "Set pArea = [Shape]" & vbCrLf _                            & "dbArea = pArea.area"             .Expression = "dbArea"             .Field = "NewArea"         End With              'Calculate the field values of NewArea field         pCalculator.Calculate()      What is pCalculator calculating here? What is [Shape] in this context? I'm migrating this old VBA code to Python, and I'm stuck at this segment. Thanks in advance. A more general question, what is the significance of the square brackets in the pre-expression? Are they placeholders for the expression?


Can ArcGIS handle missing values to create a contour map?

I am trying to create a contour map for a waterbody. It turns out that in several locations there is no data. I just don't want to use the missing values as zero in ArcGIS because it would create several other contours by interpolating actual value and the zero value. Can someone suggest to me any good way of handling N/A or no values in ArcGIS to create contour maps?


oil palm stand census algorithm

Anyone have experience in oil palm stand census using tree detection algorithm from satellite images in ArcGIS or QGIS? any references for usable algorithm? What is the accuracy? thanks for help.


arcpy.da.updatecursor to delete duplicate rows where values switch columns

I'm trying to dissolve polygons using polygon neighbors in arcgis 10.1, but don't want to use duplicate rows. However, the field values will switch when they're duplicated. If I run this:               arcpy.env.workspace = "C:\Users\Ant\Documents\ArcGIS\ITN.gdb"     fc = r"BLPUs_PolygonNeighbors"     fields = ["src_OBJECTID","nbr_OBJECTID"]     with arcpy.da.SearchCursor(fc,fields) as cursor:        for row in cursor:           print "{0}, {1}".format(row[0],row[1])      I get:               1, 2     1, 4     2, 1     2, 3     2, 4     3, 2     3, 4     4, 1     4, 2     4, 3      Then when I run my script to dissolve based on these values, I will end up with duplicate polygons such as 1 & 2 as well as 2 & 1\. Can someone please help me with writing the UpdateCursor to go through and delete these duplicates? I don't know how to look through when the fields have then switched. Also, what if I then have three polygons to merge? If I had three columns such as OID1, OID2 and OID3, is there an SQL expression to capture whether the three values in these have been repeated in a different order but in the same row previously? Thanks


Access geoprocessing service via REST, get JSON back

I have an ArcGIS Server 10.0 geoprocessing task with a REST endpoint something like this: `http://server/arcgis/rest/services/MyService/GPServer/MyTask` The task takes a parameter. I was hoping I could pass it like so: `http://server/arcgis/rest/services/MyService/GPServer/MyTask?param=Value&f=pjson` ... and get the result back as JSON. But it doesn't seem to respond to the parameter - all I get is static metadata about the task. There is the option of submitting a job, but my JavaScript will have no idea when it finishes, so I would have to keep checking the job till it's done and then get the results via individual URLs: `http://server/arcgis/rest/services/MyService/GPServer/MyTask/jobs/a72h72hd6d6g26gdh7/results/someParam?f=pjson` Is there really no way to just get the results as JSON? And pass the parameter in the first place?


Draw Complex shapes

Is it possible to draw complex shapes (polygons) like below image, combining lines and arcs. It is more like a Land Survey plan. So I have coordinates of each point and in case of arc - Radius, Chord, length, coordinate .. ![enter image description here](http://i.stack.imgur.com/KhKmR.png) I have been trying to find possible solution, but couldn't find any. I am open to Google Maps API, Openlayers / OL 3, Leafletjs


Raster and vector layer in the same CRS don't match

While adding multiple raster and vector layers (and setting them all in CRS WGS84) in QGIS 2.2, they don't seem to overlap. Interestingly enough, only raster files overlap between each other, the same for vector layers. My 'on the fly' projection is included. As a "hint", raster layers coordinates are 6 or 7 digit numbers, while it's 2-digit numbers for vector layers (area in central Italy). Also to mention is that I'm completely new to GIS so every answer is good enough. Thanks


Point cloud LiDAR

I have been trying to grid a point cloud, version1.2, LiDAR datasets which are intended to be used for hydraulic simulation of flood propagation. Already, I have used Arc* to work on the traditional (.las) format, to create lasdataset. Then, a raster dataset was created from the lasdataset and finally interpolated by means of a nearest neighbour algorithm. The interpolated raster data were exported as txt files. Having gone through this routine, I expected a result with header file as well as regular values in X, Y and Z orthogonality. Instead, the result I got was distorted sets of (real) numbers I could not make sense of. I tried using Surfer* to grid txt files created from (.las) point clouds, by means of lastools*, but the result was a binary file and I couldn’t read it. Lastools* gave a reasonable result when used to grid the point clouds, only that the cell size varies inversely with the number of cells that result in the output grid. My challenge is how to grid the point cloud LiDAR and specify the number of rows and columns to be contained in the resulting gridded data, giving a fixed cell size.


problem with feeding input files into gdal_merge.py

While merging the files using gdal_merge.py the following code works:               subprocess.call([sys.executable,gmerge,'-o','C:\\r.tif','-of','GTiff','D:\\a.tif','D:\\b.tif'],shell=True)      However, when the input files are numerous, each file can not be inserted separately. In this case, the following code does not work:               subprocess.call([sys.executable,gmerge,'-o','C:\\r.tif','-of','GTiff','D:\\*.tif'],shell=True)      I did not know how to input the input files. Any idea is welcomed.


Create voronoi diagram from line segments

I'm looking for a way to create a voronoi diagram based on line segments instead of points. See the example below (taken from this presentation). Ideally I'd like something I can script from Python, but a solution using ArcGIS or similar would also be acceptable. ![voronoi diagram from line segments](http://i.stack.imgur.com/1NDjV.png) The only library to do this I've found so far is openvoronoi, which looks promising. Are there any others?


Upgrading to ArcGIS 10.2 for Server and security vulnerability?

I have ArcGIS 10.1 Installed on my CentOS server and I have also installed "ArcGIS-101SP1-S-SSEC-Patch-lx" security patch. Do I need to upgrade ArcGIS for Server to 10.2? If I don't install the latest version Would it be a vulnerability for the current version?


Formula to know if LINE intersects with MBR

I have a table with four columns: SRC_X, SRC_Y, DST_X, DST_Y. (SRC_X,SRCY) have position of the start point of a LINE, (DST_X, DST_Y) have position of the end POINT of a LINE. I know there are spatial functions (Intersect(---)) to know if a line intersects with a MBR but i need to know if there is any formula to do this by hand.


OpenLayers WMSGetFeatureInfo on MapServer WMS layer

I am trying to get a WMSGetFeatureInfo request to work on my MapServer WMS layer but I am not sure how to correctly configure my map file and the request in OpenLayers. I have setup a jsFiddle with my WMS overlay and the WMSGetFeatureInfo request. http://jsfiddle.net/goldrydigital/YBWRz/ The request is as follows:               var getFeatureInfo = new OpenLayers.Control.WMSGetFeatureInfo({         url: 'http://137.117.37.130:8081/cgi-bin/mapserv.exe?map=c:/ms4w/wms_sample.map&',          title: 'Identify features by clicking',         layers: 'estados'     })     getFeatureInfo.events.register('getfeatureinfo', map, function (e) {         alert(e.text);     });     map.addControl(getFeatureInfo);     getFeatureInfo.activate();      The layer takes the data from a Mapinfo tab file. The Layer definition in the Map file is as follows:                   LAYER              NAME "estados"         TYPE POLYGON         STATUS ON         CONNECTIONTYPE OGR         CONNECTION "estados.tab"         TEMPLATE "blank.html"         DUMP TRUE              CLASS                  OUTLINECOLOR 10 10 10              END         METADATA                  "wms_title"          "estados"             "gml_geometries"     "geom"             "gml_geom_type"      "polygon"             "gml_include_items"  "all"             "wms_include_items"  "all"             "wms_feature_info_mime_type" "text/plain"              END              END      I hope someone can put me in the right direction with this. Thanks a lot. Dennis


Aggregated zoning (sq footage) records by town

Is there a database of zoning records where you can find the square footage by room of an address? I would like access to it to create a cost splitting application.


What is best way to convert DWG to KML using ArcGIS or alternatives?

What's the best way to convert Dwg file to Kml ? i have tried to convert Dwg file to shape file then convert it to KML, but i hadn't very good result , i had some shift from where should be seen in google earth, i heard about some software performs better than others. i would like to know also the reasons of the shift, the DWG file used contains projected coordinates.


Missing some lines after import of .PBF int PostGIS

I've a little problem with either the initial data (from Geofabrik) or the import (using osm2pgsql): I can't find some lines of a street in my city in the database while they are there on the OSM-Site (http://www.openstreetmap.org/). So here is what I've done:   * Downloaded the PBF from Geofabrik ( **karlsruhe-regbez-140706.osm.pbf** )   * Imported it using osm2pgsql ( **osm2pgsql -c -k -d osm -U postgres -H localhost -S openstreetmap-carto.style karlsruhe-regbez-140706.osm.pbf** )   * Trying to find a line which should be there ( **SELECT * FROM planet_osm_line WHERE "osm_id" = 132833416** ) The line is part of a long street here in Karlsruhe and can be found via osm.org (http://www.openstreetmap.org/way/132833416#map=19/49.00566/8.40795&layers=D). The line "left" of the missing on is present in the database. The second next to it's right is there , too. Versions used:   * osm2pgsql **SVN version af61cae663 (64bit id space)**   * PostgreSQL **9.3.4 x64**   * PostGIS **2.1.3 x64** Am I doing something wrong? No errors are shown, by the way. Any chance to find out if the line in question is in the PBF at all?


How to transpose the lat/lon coordinates of a shapefile?

I need X to be Y and Y to be X (switching lat/long) within the polygon shapefile. If it were a point shapefile I know I could simply reverse the lat/long or x/y parameter and import from a table. I'm not sure how to do something similar with a polygon layer. Is there any editing tool that would accomplish this? I have QGIS and ArcMap 9.3 ArcInfo licensing available. Its projected as WGS 1984. I'm working with a large polygon file so manually changing it would be very tedious. Any thoughts on how to do this?


Is there a standard st_relation_readable() function for translate DE-9IM strings?

Spatial databases, such as PostGIS, implement the _DE-9IM model_ with function st_relate(), which returns a string with domain of {0,1,2,F}, meaning 0=point, 1=line, 2=area, and F="empty set"...   See DE-9IM at Wikipedia. The _DE-9IM codes_ are not understandable for programmers and mortal users, but each code _have the semantic of a list of predicates_ , then, it can be translated into a human-redable list of predicates. Example: when `st_relate(a,b)='FF1F0F1F2'` or `st_relate(a,b)='FF10F0102'` or `st_relate(a,b)='FF1F0F1F2'` the DE-9IM code can be understood as "Intersects & Touches" or "Intersects & Touches with a point". **Is there a _standard_ function or library that implements this translation, from a DE-9IM code to a human-readable string?** * * * REPORT EXAMPLES: instead Report-1 I need Report-2. Report-1 (have a standard string, but not human readable)                0F1F00102 |       2 | group 1      0F1FF0102 |     616 |            total      618           1FF00F102 |       1 | group 2      1FF0FF102 |       1 |            total        2           1FFF0FFF2 |      23 | group 3           total        23           F01FF0102 |      31 | group 4      F01FFF102 |       1 |       FF10F0102 |      42 |       FF1F00102 |   19673 |       FF1F0F1F2 |      25 |           total     19772      Report-2 (human readable... There are a SQL function to do this?)                 618 | point-Intersects & point-Crosses & line-Overlaps         2 | point-Intersects & line-Crosses & line-Within & point-CoveredBy        23 | line-Equals     19772 | point-Intersects & point-Touches


PostGIS - table with 3d points with fast ordering by distance

I am pretty new to PostGIS and I am trying to solve the following problem. I need a table with 3D points (x,y,z) that will contain around 1-10million points. I want to be able to efficiently ask the table for 100-1000 points that are closest to some given point - parameter that is going to be different for each query. Now, I started playling around this with following table: > CREATE TABLE aa ( id serial NOT NULL, point point, s integer ) WITH ( > OIDS=FALSE ); > > CREATE INDEX aa_p_s_idx ON aa USING gist (point ); Queries like this: > select * from aa order by point <-> '0,0' limit 100; are lightning fast (between 10-100msec). But the problems started when I wanted to move to 3D. It seems I cannot use the `point` type anymore - I had to use `geometry`. And the `<->` operator works on 2D distance. I ended up with: > CREATE TABLE db_testpoints ( id serial NOT NULL, point geometry NOT NULL, > CONSTRAINT db_testpoints_pkey PRIMARY KEY (id ),   >  CONSTRAINT enforce_dims_point CHECK (st_ndims(point) = 3),   >  CONSTRAINT enforce_geotype_point CHECK (geometrytype(point) = 'POINT'::text > OR point IS NULL), CONSTRAINT enforce_srid_point CHECK (st_srid(point) = > 4326) ) WITH ( OIDS=FALSE ); > > CREATE INDEX db_testpoints_point_id ON db_testpoints USING gist   >  (point ); and even queries: > select * from db_testpoints order by point <-> ST_geomfromewkt('POINT(0 0 > 0)') limit 100; take around 2000msec!   1. Is there a possibility to have better performance here if I used some other column type, some other index etc?   2. Is there a similar operator to `<->` that works on 3D? I could probably use some distance function, but I heard then the index would not be used then... Any pointers appreciated, thanks in advance! **Update** EXPLAIN ANALYZE for both queries shed some light:               "1. Limit  (cost=0.00..1.28 rows=10 width=24)"     "  ->  Index Scan using aa_p_s_idx on aa  (cost=0.00..985278.95 rows=7691709 width=24)"     "        Order By: (point <-> '(0,0)'::point)"          "2. Limit  (cost=46786.64..46786.66 rows=10 width=136)"     "  ->  Sort  (cost=46786.64..49389.14 rows=1041000 width=136)"     "        Sort Key: (((point)::box <-> '(0,0),(0,0)'::box))"     "        ->  Seq Scan on db_testpoints  (cost=0.00..24291.00 rows=1041000 width=136)"      So it looks like in the second query, the index is not used at all...how can I use it and is it going to work with 3D?


Power line and/or power station vector (shapefile) data in Turkey

Looking for transmission power line / power station vector (shapefile) data in the country of Turkey. KML/KMZ files would also work. Found great vector data here yesterday for roads, rivers, etc: (http://download.geofabrik.de/osm and downloads.cloudmade.com) Turkish vector data thread http://www.platts.com/Products/gisdata has some but not they are not cheap... looking for a cheaper or free source... any ideas?


How to reduce transparency for Openlayers using Map Composer?

Increasing transparency of Openlayers will increase the contrast of others layers. For sure, it will increase the esthetical aspect of maps.


Adding Geographic Coordinate System and Projected Coordinate System layers

So I have two layers that I am adding into ArcMap. I know for a fact that when you added the first layer with Projected Coordinated System, the 2nd layer, which has a geographic coordinate system will project on the fly. My question is what would happen if the Geogrpahic coordinate System is added first. What would happen and what are the necessary steps to have them all fit properly in the same coordinate system ?


Python - formatting path strings and checking if a path exists

I would like to use the following code to determine if a path exists. The path I would like to check is being passed to my code via parameter on a ArcMap 10.0 tool dialog box. The parameters data type is folder, this folder path is being passed along to sys.argv[2] in my code below.               {import sys          import os          if os.path.exists("%s"): %(sys.argv[2])              pass          else:              #Do Something Magical}      Normally I would not have any issue with this script if I were explicitly stating the folder path. For example any of the following three works well and does what I need: `os.path.exists("C:\\Data\\Hardwar\\Folder"):` `os.path.exists(r"C:\Data\Hardwar\Folder"):` `os.path.exists("C:/Data/Hardwar/Folder"):` In the preceding code what I am finding is that as the path i.e. (`C:\Data\Hardwar\Folder`) is being passed from my parameter to sys.argv[2] the first letter after \ is being escaped and rightfully so.   How do I format the path in sys.argv[2] to a python acceptable path format?


Rounding error in qgis point sampling tool

I'm not sure if this is a bug or of it is due to the implementation. I am using a raster that has values greater than 1,000,000 and Qgis displays these numbers in a scientific notation. For instance, 1,101,702 gets displayed as 1.1017e+06 in the information dialogue. I know that the raster stores this number correctly, because I polygonized it and the polygon got the correct identifier of 1101702. But when I run the point sampling tool on the same area, the point gets marked as 1101700. Does anyone know why this is? And is there a simple way to fix this issue? If not, can anyone recommend a way to script a simple point sampling tool that I can include in my data processing scripts?


how to remove underscore from filename in directory using modelbuilder

Does anyone have a script I can use in modelbuilder that will?:   * parse an "_" from a filename   * usable in modelbuilder with an inline variable (%name%) and Feature class iterator   * transfer or copy the actual renamed shapefiles to another folder? Any help or suggestions will be greatly appreciated. ![enter image description here](http://i.stack.imgur.com/fILvS.jpg)


Script for numbering roads based on Cardinal Direction

I am kind of new to python, and am attempting to write a script that will give me a unique identifier for roads based on the cardinal direction. Ultimatley, I would like to have a system set up such as the interstate system in the united states, where North -South roads are odd numbered, and east west roads are even numbered. I would also like to reflect these numbers based on their position within the area I am working in. For example, the southern most w to e road would take the number 2, while the western most n-s road would take 1. So far, the only code I could find is code to conver the endpoints of the roads into a numerical direction:               180 + math.atan2((!Shape.lastpoint.Y! - !Shape.firstpoint.Y!),(!Shape.lastpoint.X! - !Shape.firstpoint.X!)) * (180 / math.pi)      I am assuming I will have to write some if/else statements, but I am not entirely sure how to set them up. I also found this block of code, but it didnt seem to work for me for numbering the n-s roads:               rec=0      def autoIncrement():        global rec        pStart = 1 #adjust startvalue, if req'd       pInterval = 2 #adjust interval value, if req'd       if (rec == 0):          rec = pStart       else: rec = rec + pInterval         return rec      Even if I were to get this to work, I still don't know how to get it to number roads based on how far north/south, east/west they are.


District border join in Google maps

I am developing a district editor for cities. The idea is that we divide the city into districts. I am using GoogleMaps, but any other js library is acceptible. **Problem 1** : districts are connected polygons, so changing one's border changes it's neighbour. I can not imagine a simple interface to join the polygons, and the ones, that I can think of are hard to implement (like sticky borders idea where borders 'stick' together when are near and 'unstick' when stretched far away.) **Question** : Is there some library or an example of an Editor that can join Polygons, and changing one's border changes the neighbour? (Even non web examples would be of use to give me an idea of the user interface.) **Problem 2** : I have a dataset based on data from wikimapia, that contains district polygons. Problem is that those polygons do not join by points and somehow overlap or have space between them. **Question** : How can I process those polygons to gain ones, that have joined borders. I can use Python scripts or any other if needed instructions are provided. This is a one time operation, no need to implement a graceful solution. Example of wikimapia dataset visualization


Create conditional to check if raster has value

I have a problem with this code:               ac = ExtractByMask(raster, "area.shp")     arcpy.RasterToPoint_conversion(ac, "point.shp", "VALUE")      The problem is that sometimes the raster has no value. (It's a flow accumulation and the precision of my raster is not enough for what I am asking but that's not the point). So the RasterToPoint can't work. So my question is:   How can I make a condition like: `"if my raster has no value, don't do the RasterToPoint"`


Join Field works in ArcMap but not in Python

I am trying to join a field of values found within a DBF to a multi-polyline shapefile. They share a common field name (filename) and the values found within each are identical. I was able to run Join Field without a hitch in ArcMap, but I'm receiving two errors when I try to run it in Python with identical parameters. Here's the block of code:               merge_features = r"C:/Users/kellyj/Desktop/Projects/CostAnalysis/merge_features"     import arcpy     from arcpy import env          arcpy.env.workspace = merge_features     arcpy.AddJoin_management("merged_lines.shp", "filename", "merged_table.dbf", "filename")      These are the errors I receive: > ExecuteError: Failed to execute. Parameters are not valid.   >  The value cannot be a feature class   >  ERROR 000840: The value is not a Raster Layer.   >  ERROR 000840: The value is not a Raster Catalog Layer.   >  ERROR 000840: The value is not a Mosaic Layer.   >  WARNING 000970: The join field filename in the join table merged_lines is > not indexed. To improve performance, we recommend that an index be created > for the join field in the join table. Any thoughts as to what's happening here?


How to improve Python script processing speed (performance)?

I've been working on a script which essentially reads in a large amount of point and polygon data and generates frequency values for a featureclass of 2.5 acre hexes covering California. I have found it necessary to write my own version of the frequency tool, as ESRI's default tool has been crashing ArcMap on an irregular basis, and this script needs to be reliable and predictable. To do this I have been using python dictionaries to store values that are read in from the input datasets. The dictionaries are 2 dimensional (each key contains another dictionary within it) and get quite extensive, as there are 60000+ keys with 1-28 secondary keys. Writing the dictionaries isn't the problem, however, those get written reasonably quickly. My problem is when the dictionaries are done being constructed, running my makeshift frequency tool takes a long time. Here's the code and a short example of the dictionary entries, I'll explain a bit more below: There are two dictionaries I read from, here's an example of 'otherSourceDict'. hexDict is handled a little differently (it uses two letter codes (AA, AB, etc...) instead of taxon names like 'Amphibian'), but basically stores the same information:               {13456: {'Amphibian': 2, 'Bird': 5, 'Mammal': 10, 'Plant': 20}, 43156: {'Fish': 1, 'Plant': 4}}      The primary keys (13456 and 43156) represent hex feature unique IDs. The secondary keys (Amphibian, Mammal...) contain the number of taxon observations that are in that hex. My frequency code:               #Build a list of important correlated values for reference later     taxaList = [['RAR2_AMPH', 'AA', 'Amphibian', 'R2_NRM_A'],                 ['RAR2_BIRD', 'AB', 'Bird', 'R2_NRM_B'],                 ['RAR2_FISH', 'AF', 'Fish', 'R2_NRM_F'],                 ['RAR2_MAMM', 'AM', 'Mammal', 'R2_NRM_M'],                 ['RAR2_REPT', 'AR', 'Reptile', 'R2_NRM_R'],                 ['RAR2_PLNT', 'P', 'Plant', 'R2_NRM_P']]     #Add fields for taxa value by hex     sendmsg("     Adding fields...")     fieldList = gp.listfields(inRare)     for taxa in range(len(taxaList)):         if not taxaList[taxa][0] in fieldList:             gp.addfield_management(inRare, taxaList[taxa][0], "SHORT")     cur = gp.updatecursor(inRare)     row = cur.next()     sendmsg("     Writing dictionaries to hexs")     c=0     while row:         #Count for user visualization of process completion         c+=1         if c%10000 == 0:             sendmsg("          Starting record number " + str(c) + "...")         #For each taxa, calculate the frequency and populate the corresponding field.         for taxa in range(len(taxaList)):             val=0             if str(int(row.HEX25_ID)) in hexDict.keys():                 #Search the CNDDB dictionary and count how many of each taxa per hex                 for elmcode in hexDict[str(int(row.HEX25_ID))].keys():                     #If dealing with taxa other than plants                     if elmcode != "ECO_SECT" and taxaList[taxa][1] != "P":                         if elmcode[:2] == taxaList[taxa][1]:                             val+=1                     #If dealing with plants                     elif elmcode != "ECO_SECT" and taxaList[taxa][1] == "P":                         if elmcode[0] == "P" or elmcode[0] == "N":                             val+=1             if str(int(row.HEX25_ID)) in otherSourceDict.keys():                 #Search the other source dictionary and count how many of each taxa per hex                 for otherTaxa in otherSourceDict[str(int(row.HEX25_ID))].keys():                     if otherTaxa == taxaList[taxa][2]:                         val+=int(otherSourceDict[str(int(row.HEX25_ID))][otherTaxa])             #Populate the total number of each taxa per hex to the rare species hex features             row.setValue(taxaList[taxa][0], val)         cur.updaterow(row)         row = cur.next()          del row, cur      So right now, I have it so that when it goes to populate the hex features, it loops through each row 5 times, one for each field, then runs the frequency calculation for the specified taxon, and populates the field. There are roughly 60000 rows that it does this for. Does anyone have any suggestions or alternative methods for populating the hex features that could speed up the process? The script performs several operations, this by far takes the most time (about 25 minutes) and I would like to get it to be as quick as possible. Thanks for your help and suggestions!


How to use field calculator from QGIS Sextante plugin

I am trying to use the Sextante field calculator to calculate a field for a buffer radius using a categorical text field. The formula works fine when I run it using the standard QGIS field calculator via the attribute table: ![QGIS field calculator](http://i.stack.imgur.com/B1TwZ.jpg) When I use the same formula from the Sextante toolbox however (algorithms for vector layers), it produces only null values. ![enter image description here](http://i.stack.imgur.com/Ndkw2.jpg) ![enter image description here](http://i.stack.imgur.com/ls8II.jpg) This is the formula I'm using:               case when  "PointConfL"  =  '10-50 km' then 50000      when  "PointConfL"  =  '5-10 km' then 10000      when  "PointConfL"  =  '2-5 km' then 5000      when  "PointConfL" =  'centroid of farm' then 10000      else 50000     end      It seems to not matter whether the new field exists before or not: if it doesn't exist, it is created, but in both cases, all values are NULL. Am I using the 'algorithm' incorrectly, or is this perhaps a bug in the plugin? **EDIT** : I found the error log in `~/sextante`, but it doesn't shed much light on the problem:               ALGORITHM|Wed Oct 24 2012 17:08:08|Sextante.runalg("sextante:fieldcalculator","/home/rudi/personal/GIS/projects/transform_count/364-236.shp","buffer_sextante","case when  "PointConfL"  =  '10-50 km' then 50000 when  "PointConfL"  =  '5-10 km' then 10000 when  "PointConfL"  =  '2-5 km' then 5000 when  "PointConfL" =  'centroid of farm' then 10000 else 50000 end")     ERROR|Wed Oct 24 2012 17:08:08|Problem evaluation formula: Wrong field values or formula


How to accomplish conditional labeling based on map scale and attribute in QGIS 1.7

How can I label with qgis 1.7, based on attribute and scale of map? For example scale>1:1000 then label all those features whose area>100000 at font size 12 and those features whose area<99999 at font size 5.


Distance from rivers, taking into account terrain elevation

I am interested in building a raster of the distance from rivers in a territory under study. I have digitized the course of the rivers in ArcGis 10.1. I have used the 'Euclidean Distance' tool to create a raster of the distance from rivers. Now, since we are moving in a 3D world, not in a 2D one, I would like to 'weight' the calculated distances in order to take the elevation into account. So, I would like to know how can I create a raster depicting the distance of any point from rivers, also taking into account the elevation variable.


How to symbolize vector features using RGB values stored in three fields?

I need to symbolize a vector layer in Arcmap based on RGB (or HSB - can do either) values found in fields in the attribute table. I'm working with up to 10 different datasets, each with over 100 features. As a result, I can't manually adjust each feature's fill attribute, nor can I use a template .lyr file and then apply its symbology. Is there a method via Arcpy that I can use to perform this? Looking at the documentation it appears that symbology isn't exposed to Arcpy but I'm not familiar enough to know for sure. I could also possibly use ArcObjects, although I try to avoid that rabbit hole like the plague. Otherwise, are there any third-party scripts or tools that can accomplish this? I could also possibly go with QGIS, but only as a last resort.


How to validate whether shapefile exists using ArcPy and Python function?

I am very new to Python and am trying to complete my final project with not a lot of success. My code works without functions, the problem is I need it to work with functions. In the main(): function I want the user to enter an .shp file path. Then I have an isValid(inPath): function that I want to call the file path the user entered and validate if the file exists. I have done this in many assignments before with .csv and .gpx files, but I am not having success with .shp files. When I keep everything under the main function, it works no problem. Any help would be greatly appreciated! Here is my code currently:               **# Import Modules:**     import arcpy     from arcpy import env     from arcpy import mapping     import os.path          **# Set workspace**     env.workspace = #this is where I set my workspace     env.overwriteOutput = True          **# Checks if shapefile is valid**          def isValid(inPath):         if arcpy.Exists(inPath):             print 'Exists'         else:             print ' Does NOT exist'          def main():         shpFile = raw_input("Enter a Map Document path: ") # User inputs a shapefile         shpFile = shpFile.replace("\\","/") #replaces backslashes with forward slashes


[mapserver]: layer filtering with layerObj.setFilter()

I'm trying to filter a layer ( _using mapserver_ ) backed by a Shapefile using **layerObj.setFilter()** but this doesn't seem to have any effect on the returned tile(s). Sample code:               layerObj = mapserver.layerObj()     layerObj.setFilter("id = 1)      What am I doing wrong? Nothing blows up per say and mapserver produces tile(s) but they are the same set of tiles as if I had not applied the filter at all. Even applying the filter in the mapfile using **FILTER "id = 1"** also has no effect. Here is a more detailed ( _in code_ ) example of what I'm doing:               def index(self, *args, **kwargs):         mapObj = mapscript.mapObj(self.mapfile)              layers = [layer.strip().split(":", 1) for layer in kwargs["layers"].split(",")]              # create layers         for i, (layerType, layerName) in enumerate(layers):             layerObj = mapObj.getLayerByName("raster" if layerType == "models" else "vector").clone()             layerObj.name = "{0:s}:{1:s}".format(layerType, layerName)             layerObj.data = str(self.models.join(layerName)) if layerType == "models" else str(self.regions.join(layerName))                  if "filter" in kwargs:                 layerObj.setFilter(kwargs.pop("filter"))                  mapObj.insertLayer(layerObj)              owsReq = mapscript.OWSRequest()              # add query string parameters into map request object         for k, v in kwargs.items():             owsReq.setParameter(k.upper(), v)              # write mapserver results to buffer         mapscript.msIO_installStdoutToBuffer()         try:             mapObj.OWSDispatch(owsReq)         except:             return SException(self.response, str(sys.exc_info()[1]))              # adjust content-type         self.response.headers["Content-Type"] = mapscript.msIO_stripStdoutBufferContentType()         output = mapscript.msIO_getStdoutBufferBytes()         self.response.headers["Content-Length"] = str(len(output))              # output WMS image data         return output


Automate map creation for 50k unique routes

I have a table with 50k entries. There is a to field and from field with location in either lat/lng or street address. All these location are in the USA I would now like to automate the creation of unique jpg maps for each entry showing the route to get from point a to b. I have a ArcGIS 10 license along with spatial analyst (not sure if these will help). Any suggested workflows to automate the creation of these maps?


Querying and summarizing/reporting a multiple tables database

I have to create a database with information on Scottish buildings from 17 and 18 centuries. In order for my data to be searchable I need to have a series of tables connected with 1 to many relationships. Each building must be positioned on a map, which will have other layers like geo-referenced historic maps, and other features, like industries that supply materials needed for the building's conservation, etc... The database will be continuously used and updated. I was using Access, but I found that the connection with ArcGIS was not ideal: either I had to export from Access and Import in ArcGIS a single table or query, or I had to create an OLE DB connection, which isn't able to "read" the relations between the tables.   Therefore I, thought doing all the database directly in ArcGIS would be better. I created different tables connected with relationship classes, and one of them has X Y coordinates that give me the position of the buildings. The **problem** is I can't query more than one table at a time, nor create a report from more than one table at a time. what am I doing wrong? I'm new to databases and to both Access and ArcGIS, so if you have any suggestions on how I could make my database work better please tell me. Thank you.


How long does it take to load the complete Tiger 2013 dataset into Postgis?

I'm loading the complete TIGER 2013 dataset into a Postgis database and finding that the process is taking an extraordinarily long time. I was surprised by how long it took to load the TIGER 2012 dataset locally (over 60 hours), but the TIGER 2013 load is so long as to be almost unusable. Loading a single state's worth of data (whether it be Alaska, Alabama, or Arkansas) is taking 12+ hours from my local machine on a high speed network into an Amazon RDS Postgres 9.3 instance with Postgis 2.1. Note that this doesn't include downloading the files from ftp2.census.gov, since I pre- downloaded all the files. This is all time taking to process the SHP files and insert them into Postgres. I don't seem to be throttled by local resources - my CPU is nearly idle, and my load average is hovering around 2. My network has plenty of spare bandwidth. I can't imagine I'm throttled by network on the RDS instance, although it could be limited by CPU or memory (it's an m1.large RDS). There is literally nothing else running against the database though, so the load should be minimal. This situation is further complicated by the fact that the default TIGER scripts for Postgis don't lend themselves to parallelizability - they drop and create the tiger_staging schema, which makes it impossible to load states in parallel. I'm planning to modify the scripts to allow parallel load, but before I do that I'd like to know if there's a more fundamental problem. Has anyone done a full soup-to-nuts load of TIGER 2013 data? If so, how long did it take? Are there any configuration parameters I should be looking at that might be throttling this process? Any advice or guidance would be appreciated.


How to define leaders to a label in QGIS 2

In QGIS 1.8 and 1.9 I used a plugin called Easy Labels to develop leader lines that would be saved as a memory layer. I have not been able to replicate this with QGIS 2.0, I cant even find the Easy Label Plugin. Assuming it is no longer valid in QGIS 2. Question: How can I create a leader from a label moved outside a polygon to the centroid of the polygon?


Add labels for printed map (GeoTools)

I have some problems with labels for printing map with GeoTools. Next code (with some cuts, code on Scala language) can help me for printing map:                   val map = new MapContent()         val parser = new GeometryJSON()         val featureTypeBuilder = new SimpleFeatureTypeBuilder()         featureTypeBuilder.setName("Field")         featureTypeBuilder.setNamespaceURI("http://www.geotools.org/")         featureTypeBuilder.setCRS(DefaultGeographicCRS.WGS84)              featureTypeBuilder.add("geography", classOf[MultiPolygon])         featureTypeBuilder.add("text", classOf[String])              val featureBuilder = new SimpleFeatureBuilder(featureTypeBuilder.buildFeatureType())         val featureCollection = new DefaultFeatureCollection()          ...              val featureLayer = new FeatureLayer(featureCollection, createPolygonStyle())         map.addLayer(featureLayer)         val stream = getImageStream(map, width)         val bytes = new Array[Byte](stream.available())         stream.read(bytes)          ...      Next code set style of polygons, which I want show on printed map:               def createPolygonStyle = {         val styleBuilder = new StyleBuilder()         val styleFactory = CommonFactoryFinder.getStyleFactory         val filterFactory = CommonFactoryFinder.getFilterFactory              // Stroke         val stroke = styleFactory.createStroke(           filterFactory.literal(Color.RED),           filterFactory.literal(3),           filterFactory.literal(1)         )              // Fill         val fill = styleFactory.createFill(           filterFactory.literal(Color.YELLOW),           filterFactory.literal(0.2)         )              // Set anchor label         val anchorPoint = styleBuilder.createAnchorPoint(           filterFactory.literal(0.5), filterFactory.literal(0.5)         )         val pointPlacement = styleBuilder.createPointPlacement(           anchorPoint,           null,           styleBuilder.literalExpression(0)         )              // Set label style         val font = styleFactory.createFont(           filterFactory.literal("Arial"),           filterFactory.literal("normal"),           filterFactory.literal("normal"),           filterFactory.literal("20")         )         val textSymbolizer = styleFactory.createTextSymbolizer(           styleFactory.createFill(             filterFactory.literal(Color.BLACK)           ),           Array(font),           styleBuilder.createHalo(),           styleBuilder.attributeExpression("text"),           pointPlacement,           null         )              textSymbolizer.getOptions.put("maxDisplacement", "150")              val polygonSymbolizer = styleFactory.createPolygonSymbolizer(stroke, fill, null)              val style = styleBuilder.createStyle()         style.featureTypeStyles().add(           styleBuilder.createFeatureTypeStyle(             "Field",             Array[Symbolizer](polygonSymbolizer, textSymbolizer)           )         )              style       }      And then I have next result, but not all polygons have good labels: ![enter image description here](http://i.stack.imgur.com/1ZSTl.png) What can I change in my code for showing all labels for polygons with scaled font size and without outbounds text?


Android ESRI map getting Failed to generate sequences for graphic error

I am using following code to add graphic layer in my ESRI map.               public void footprintdata(String option)      {         graphicsLayer.removeAll();            if(option.equalsIgnoreCase("ALL"))       {        try         {             Graphic[] resultGraphics = new Graphic[footprintdata.size()];         // Envelope to focus on the map extent on the results         Envelope extent = new Envelope();              for (i = 0; i < footprintdata.size(); i++)          {          double lattitude = 0.0;          double longitude = 0.0;                 if(!footprintdata.get(i).getLatitude().equalsIgnoreCase(""))          {           lattitude = Double.parseDouble(footprintdata.get(i).getLatitude());          }          if(!footprintdata.get(i).getLongitude().equalsIgnoreCase(""))          {           longitude = Double.parseDouble(footprintdata.get(i).getLongitude());          }                    mLocation = new Point(XCoordinateFromLongitude(longitude), YCoordinateFromLatitude(lattitude));               mapPoint = (Point) GeometryEngine.project(mLocation,            SpatialReference.create(4326),mapView.getSpatialReference());                 SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 20, SimpleMarkerSymbol.STYLE.DIAMOND);          // create graphic object for resulting location          //PictureMarkerSymbol imagesymbolicon = new PictureMarkerSymbol(imagemarker(i));               Graphic resultgraphics = new Graphic(mapPoint,resultSymbol);              resultGraphics[i] = resultgraphics;          extent.merge(mapPoint);         }              graphicsLayer.addGraphics(resultGraphics);         mapView.setExtent(extent, 100);         mapView.zoomToResolution(mapPoint, 10);         mapView.invalidate();                  } catch (Exception e) {         // TODO Auto-generated catch block         e.printStackTrace();        }       }       else       {             System.out.println("else of spinner selection");             try         {             int count = 0;         int temp = 1;         for (int i = 0; i < footprintdata.size(); i++) {               if (footprintdata.get(i).getLocationtype()            .equalsIgnoreCase(spinner.getSelectedItem().toString())) {                count++;          }         }              System.out.println("count :"+ count);         Graphic[] resultGraphics = new Graphic[count];         Envelope extent = new Envelope();               for (int i = 0; i < footprintdata.size(); i++) {               //PictureMarkerSymbol imagesymbol = null;          if (footprintdata.get(i).getLocationtype()            .equalsIgnoreCase(spinner.getSelectedItem().toString())) {                System.out.println("result success : "             + footprintdata.get(i).getLocationtype());                double lattitude = Double           .parseDouble(footprintdata.get(i)             .getLatitude());           double longitude = Double           .parseDouble(footprintdata.get(i)              .getLongitude());                mLocation = new Point(XCoordinateFromLongitude(longitude), YCoordinateFromLatitude(lattitude));                mapPoint = (Point) GeometryEngine.project(mLocation,             SpatialReference.create(4326),mapView.getSpatialReference());                SimpleMarkerSymbol resultSymbol = new SimpleMarkerSymbol(Color.GREEN, 20, SimpleMarkerSymbol.STYLE.DIAMOND);                //PictureMarkerSymbol imagesymbolicon = new PictureMarkerSymbol(imagemarker(i));           Graphic resultLocation = new Graphic(mapPoint,resultSymbol);                System.out.println("temp :"+ temp);           resultGraphics[temp] = resultLocation;           extent.merge(mapPoint);           temp++;               }         }              graphicsLayer.addGraphics(resultGraphics);         mapView.setExtent(extent, 100);         mapView.zoomToResolution(mapPoint, 10);         mapView.invalidate();                 } catch (Exception e) {         // TODO Auto-generated catch block         e.printStackTrace();        }       }      }      this code works fine at first time. but after it I am getting `MapCore(24187): Failed to generate sequences for graphic` in My Logcat. please help if some one have any idea about it.


Data Interproability Toolset not working ArcGIS 10.2

The Data Interoperability Tools .tbx appears in my system toolboxes, however when I double click quick export or import, a red X appears. I have gone into the administrator settings and the tool doesn't appear to be installed. How do I install it? I am using ArcGIS 10.2 for desktop trial. After I attempt to evaluate extensions, I receive a message which states all requested features have already been authorized on this machine.


How to convert an IGeometryCollection into a Polyline

I am using the CostPathAsPolyline method which returns the Polyline as an IGeometryCollection. I now need to get this converted back into a polyline. But it seems to be more complex than just a cast. Can someone please help me? I cannot find anything online.


Patents in GeoSpatial software: impact on practices?

I've seen on twitter a tweet saying: > Palantir has done well turning chapters of intro computational geometry, > GIS, and ontology textbooks into patents: Looking into the results, my main concern is about the patent concerning "Simplifying a polygon" (I use polygon simplification with the MapShaper tool or the Douglas Peucker algorithm in PostGIS or GDAL ...) Do you know the impact of this patent in particular? I have to stop using polygon simplification?


Would PostGIS offer an advantage over MySQL for a produce farm application?

I have a web app that stores the locations of farms in West Michigan. You can search for a product (e.g. "broccoli") and it will show you all the farms that grow that product. Right now I'm using MySQL and using trigonometry to calculate the difference between the user's location and the location of each farm. It's not a bad way to go but it did take some doing. Another thing I want to do soon is to map out growing seasons for different products for different regions. (For example, I want to show that avocados grow at a certain time of year in California but never Ohio.) I realize this is an open-ended and possibly naive question, but might it be worth it for me to make the switch to PostgreSQL/PostGIS to take advantage of its spatial capabilities?


What does the "Standard Distance" output from the spatial point pattern analysis in QGIS 2 represent?

I have a cluster of points and I am using the Spatial point pattern analysis tool from the processing toolbox in QGIS 2. I am having trouble understanding what the "Standard Distance" output is? It looks to me like it represents two standard deviations from the mean as it covers about 84% of my data, but this is only a guess. I clicked on the help tab of the tool but there were no details there. Any one know exactly what the "Standard Distance" layer (dotted circle) is showing? ![enter image description here](http://i.stack.imgur.com/SyrDF.png) Thanks Ando


How to create duplicate features based on related table - many-to-one conversion

I need to create duplicate features (in this case parcels), using a related table to populate ID fields. In essence, I need to use a related table of parcel owners to create duplicate parcels, each with its own unique ID from the related owner table. The related table already contains the many-to-one link to parcels, I just want to force a one-to-one relationship between the owners and parcels, by creating a duplicate parcel for each owner record. Thanks in advance for any suggestions! Jodi


Source for high-res subscription imagery service

I'm developing a diagramming tool using aerial imagery as a reference layer. This tool should allow the user to zoom in quite close to a roadway or intersection. Unfortunately none of the public map services I have tested supports zooming in close enough. Are there subscription map services out there that have imagery with resolution high enough to zoom in quite close to the roadway?


Convert polygon feature to line feature

I have a polygon shape-file i need to extract the line segments where the polygon features intersect each other and also the segment where they don't. Can we automate this process or can scripting like arcpy be used?


creating a buffer in a raster layer

I've got a raster layer separated into 3 zones, representative of marine park zones. What i'm trying to do is make it so that where zone 1 is adjacent to zone 3, there is a "buffer" between them, of zone 2. How would I go about this? ![enter image description here](http://i.stack.imgur.com/heMJz.png) i want a small buffer zone of the blue zone, where ever the red and green zones are adjacent to one another. short of cracking open photoshop and drawing it in myself, is there a way of doing this: ![enter image description here](http://i.stack.imgur.com/BD9N2.png) in arcmap?


Create moving map application from topographic maps

I'm trying to create a moving map application for an embedded ATOM device. Data source is a 400MB tif file (500dpi) plus projection and worldfile. My naive approach was to load that tiff into Global Mapper and export it to "Bing", using 4 zoomlevels. It works fine, but the tilecache uses up way too much diskspace. Can anyone point me to a better way of achieveing something like this? Would it be better to use some kind of runtime decompression?


Split polygon into lines

I have a polygon layer which looks like this ![enter image description here](http://i.stack.imgur.com/MxgNl.jpg). I used the QGIS `multiparts to singleparts` tool and also `polygon to lines`. In both cases i got this type of result ![enter image description here](http://i.stack.imgur.com/61XJ7.jpg). I want to extract polygon into individual lines like this![enter image description here](http://i.stack.imgur.com/3Hk0c.jpg)


What Avenue scripts/extensions do you still keep ArcView 3.x around for?

Alternatively, if you've completely moved on, which do you miss the most? Thanks and signed,     Not entirely idly curious. (As a side project, I'm looking into the effort required to (semi-) automate conversion from Avenue to python...) :)


STDistance Unit in SQL Server 2008

I've got a SPROC in SQL Server 2008 where I'm trying to calculate the distance between a point and a polygon, and I'm getting unexpected results. I am passing a parameter (@Radius) in miles to the SPROC, but the distances don't seem to be in KM. I can't figure out what they are in. My SPROC is below:               DECLARE  @Point geometry;     SET   @Point = geometry::STGeomFromText('POINT(' + CAST(@Longitude AS nvarchar(32)) + ' ' + CAST(@Latitude AS nvarchar(32)) +')', 4326);          SELECT  [FS_Geometries].[Description], ([Geometry].MakeValid()).STDistance(@Point)     FROM  [FS_Geometries]     WHERE  (([Geometry].MakeValid()).STDistance(@Point) <= (@Radius * 1609.344))     AND   [ParentId] = @CustomerId     AND   [ParentType] = 80     ORDER BY (([Geometry].MakeValid()).STDistance(@Point)) ASC      In all my other queries, I need to convert my radius from miles to meters. When I do that here, the results are not correct. I have a result set of about 750 polygons that are separated by about 25 miles of geography, so when I pass "1.0", I'd expect to get less than my 750 polygons. Unfortunately, I get the full 750 in the results. Is the STDistance() method in SQL Server 2008 based on something other than meters? Also, is the STDistance() method in this case measuring from the edge of the polygon or the centroid of the polygon? Thanks! UPDATE --- My updated conversion function...               public static double ConvertMilesToDegrees(double miles, bool isLatitude)     {         return isLatitude             ? miles * (((double)1) / 69)  // 1 Deg. Latitude = 69 Miles...             : miles * (((double)1) / 61); // Avg of 69 and 53...              // NOTES: A degree of longitude is widest at the equator at 69.172 miles (111.321)          // and gradually shrinks to zero at the poles. At 40° north or south the distance          // between a degree of longitude is 53 miles (85 km).     }


How To Convert A Set of ARC/Info ASCII .e00, .e01, .e02, etc Files Into .shp Files

I have a set files that I downloaded with extensions (.e00, .e01, .e02, etc). I have read that these are files used by ARC Info mainly, but I do not have ARC and nor am I really that interested in downloading it. The funnier thing is that I am able to convert a .e00 file in QGIS to a .shp set, but if the file has been broken into many .e0n files, QGIS does not recognize the others and leaves me with only have my shapefile. I have tried taking the other files and copying and pasting their contents to the end of the .e00 file, but this resulted in a very erroneous shape in QGIS. I have been searching for some while now if there is a way to do this with ogr2ogr, but haven't found anything for a set of files like this. I also downloaded e002shp, but had no idea on how to go about using it and didn't find much online for that one. If anyone can tell me any command-line tools I could use (preferably ogr2ogr) or a way to do this in QGIS, I'd gladly appreciate it :) Actually I'd appreciate any tips, but that is the software which I am more familiar with ;) Thanks, elshae


Algorithm to find nearest point

I've a list of a few hundred cities with their latitude/longitude. Given another location (also in lat/long) I need to find the nearest city. As I don't use any GIS, by now the obvious algorithm is to make a loop for all the cities, calculating the distance between the points. Making the loop is practicable for me, but there is some easy to implement algorithm to accomplish that more efficiently? Or some light Java library that can help to solve that? **Notes** : I don't need/want a complete GIS solution or heavy/complicated library. I prefer a less good but easiest and lighter solution because that is the only thing that I need to solve.


postgis insert query to store geometry and other data

I'm using Postgis functions `st_dump` and `st_split` to split a polygon based on line. Now, after splitting; output geometry stores in a database table as well. Here is the query:               insert into aoo(geom)     SELECT ST_AsTEXT ((ST_Dump(ST_Split(circle, line))).geom) As wkt     FROM (SELECT          ST_GeomFromText('LINESTRING(73.33393335342407 33.82005181729661,73.33685159683228 33.80960466650892)',4326) As line,         (select geom As circle from aoo where gid=71) ) As foo;      But, the issue is I want to store other data with these geometries as well. Like               insert into aoo(geom,name)      but I don't what is the way to do it.


How to disable a base layer in OpenLayers based on zoom level

> **Possible Duplicate:**   >  How can I switch baselayers as a user zooms in to the map in OpenLayers I have a map that has two base layers and several overlays. One of the base layers only has 5 zoom levels. I would like to disable that base layer in the layer switcher when the map is zoomed outside of the range of that base layer. I have found how to do that with overlays in this forum at this link. I changed dataLayers to baseLayers. My problem seems to come when the base layer that I am trying to limit is the base layer selected when I zoom outside the range of that base layer. If I then select the other base layer, it appears as if the zoom control is locked up. Any suggestions are greatly appreciated. Thanks.


different maps for different zoom levels in openlayers?

I'm trying to create a mixture of maps that will load in depending on zoom level However, it will only show as one map to the user, and depending on the zoom level, it will load in a different map I really like open street map data when zoomed out, and skobbler maps when zoomed in, so would like to create this one combined map I think from what i've read its possible, but all the examples i found refer to detail layers any examples or pointing in the right direction would be appreaciated


Problem in calculating length

I am Digitizing road line in India using open layer plugin.When I calculate the length of line using field calculator it gives me the result in millimeter . I thought it is the projection problem and defined the projection as wgs 84 UTM 44N . The same problem exixts . but when I measure the line using measure line tool it gives the result in meters . What is the problem? I want the result to be in meters in field calculator itself.


Merge shapefiles

I am a new user of ArcMap. I have several shape files of various portions of the West coast of India (boundary and contour files). I need to combine all these files into one shape file so that I can extract information from this file and make one bathymetric information file. I have tried using the merge option in ArcMap. But the shape files do not line up like I want them too. How can i solve this issue? Please Help.


How to convert ASCII in x,y,z format using gdal_grid?

I have a map saved in (AFAIK) Arc/Info ASCII format and I would like to convert it with gdal grid but I am getting errors. My data (`p.csv`) is in the following format:               319053.25,319301.12,544.28     319074.57,319275.26,546.44     319075.00,319250.00,546.34     319075.00,319000.00,468.74     319075.00,318950.00,466.19     319075.00,318925.00,472.06      and I have a `p.vrt` written by myself:               <OGRVRTDataSource>         <OGRVRTLayer name="dem">           <SrcDataSource>p.csv</SrcDataSource>            <GeometryType>wkbPoint</GeometryType>            <GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>         </OGRVRTLayer>     </OGRVRTDataSource>      When I launch `gdal_grid` I get the following error :               $ gdal_grid -l dem p.vrt p.tiff     ERROR 1: Failed to find layer 'dem' on datasource 'p.csv'.     No point geometry found on layer dem, skipping.


How to convert data type from float to integer in QGIS?

Currently I am working on importing data from MSSQL to Qgis 2.4. In imported database table attributes are shown in the format of integer ( in attribute table it showing like 48.23 and 16.20 in column). But when i export it ( save as shapefile ) then it got automatically converted into float ( in attribute table it showing like 48 and 16). I wanted it in integer format only ( 48.23 and 16.20 like that) so my question is does any other way to convert it into integer format in QGIS? Or does any other saving option, any plug in available to solve this issue?


best route change the starting time automatically?

I want to find out the best route from point A to point Z. But this should always be at a different time. For example:   * How is the best route from point A to point Z at 07:00?   * How is the best route from point A to point Z at 07:05?   * How is the best route from point A to point Z at 07:10? and so on ... Is there a possibility to change the start time every minute automatically? I am working with ArcGis 10.1


Download OSM data using "ArcGis Editor for OSM"

My actions: 1) Add Basemap -> OpenStreetMap 2) zoom to area (in this area about 300 nodes) 3) OpenStreetMap Toolbox -> PostgreSQL Download, Extract and Symbolize Tools -> Download, Extract and Symbolize OSM Data (PostgreSQL) Then DownloadExtractSymbolizeOSMData222 run There are a lot of messages. But I have 3 warnings:               ...OSMGPAAttributeSelector "...fstutorial.ftuser.TestOSM\fstutorial.ftuser.TestOSM_osm_ply" ALL     The process did not execute because pecondition is false               ...OSMGPAAttributeSelector "...fstutorial.ftuser.TestOSM\fstutorial.ftuser.TestOSM_osm_ln" ALL     The process did not execute because pecondition is false               ...OSMGPAAttributeSelector "...fstutorial.ftuser.TestOSM\fstutorial.ftuser.TestOSM_osm_pt" ALL     The process did not execute because pecondition is false      When this process finished I can not add this "feature dataset" to the Table of Contents. _**Update_** I use ArcMap 10.1, postgres 9.0.5, ArcGIS Editor for OSM 2.1 Final for 10.1 It is the result of downloading OSM. ![not all objects](http://savepic.su/3234373.jpg)