title: Blank MapServer WMS image at low zoom levels in OpenLayers

text: I have an OpenLayers map using OSM as the baselayer with several layers coming from MapServer via WMS. The OL map is in EPSG:3857 and my mapfile (and shapefiles) are in EPSG:4326. In my mapfile I have 'epsg:3857' as one of the values for 'wms_srs'. So my WMS layers produce the correct images at high zoom levels (zoomed in to the area they cover) around some islands in Hawaii. But when I zoom out (lower than OL zoom level 6 or so) these WMS layers disappear. What is more confusing is that if I make the map very small I can get it to show up down to level 3. This indicates to me that is a projection issue and it is the requested extents that matter. Here is an example request where it does work:               http://localhost:8080/cgi-bin/mapserv?map=/vagrant/djangoproject/djangoproject/site_media/media/outputs/HAKOU_v2/118/result_wave_deter.map&LAYERS=wave&FORMAT=image%2Fpng&TRANSPARENT=true&ISBASELAYER=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A3857&BBOX=-19159399.70874,918467.30427795,-16055444.864568,3714228.0504472&WIDTH=1269&HEIGHT=1143      and where it doesn't:               http://localhost:8080/cgi-bin/mapserv?map=/vagrant/djangoproject/djangoproject/site_media/media/outputs/HAKOU_v2/118/result_wave_deter.map&LAYERS=wave&FORMAT=image%2Fpng&TRANSPARENT=true&ISBASELAYER=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A3857&BBOX=-20848352.285494,-452507.23485414,-14640442.59715,5139014.2574847&WIDTH=1269&HEIGHT=1143      Here is an example mapfile:               MAP       NAME 'wave'       STATUS ON       # Map image size       SIZE 512 256       MAXSIZE 4096       UNITS METERS       FONTSET '/vagrant/djangoproject/djangoproject/data/fonts/font.list'            EXTENT -159.87 20.33 -156.3 22.7       PROJECTION         'init=epsg:4326'       END            # Background color for the map canvas -- change as desired       #IMAGECOLOR 195 220 252       IMAGECOLOR 255 255 255       IMAGEQUALITY 95       IMAGETYPE png24            #CONFIG "MS_ERRORFILE" "/var/log/mapserver/ms_error.txt"       #DEBUG 1            #OUTPUTFORMAT       #  NAME png       #  DRIVER 'GD/PNG'       #  MIMETYPE 'image/png'       #  IMAGEMODE PC256       #  EXTENSION 'png'       #  TRANSPARENT ON       #END            OUTPUTFORMAT         NAME 'png24'         MIMETYPE 'image/png'         DRIVER 'AGG/PNG'         EXTENSION 'png'         IMAGEMODE RGBA         TRANSPARENT ON       END # OUTPUTFORMAT                 # Legend       LEGEND           IMAGECOLOR 255 255 255         STATUS ON         KEYSIZE 18 12         LABEL           TYPE BITMAP           SIZE MEDIUM           COLOR 0 0 89         END       END            # Web interface definition. Only the template parameter       # is required to display a map. See MapServer documentation       WEB         # Set IMAGEPATH to the path where MapServer should         # write its output.         IMAGEPATH '/tmp/'              # Set IMAGEURL to the url that points to IMAGEPATH         # as defined in your web server configuration         IMAGEURL '/tmp/'              LOG '/tmp/zoowps/mapserver.log'              # WMS server settings         METADATA           'wms_title'           'wave'           'wms_onlineresource'  'http://cybereye.crc.nd.edu/portal/mapserver/?map=/vagrant/djangoproject/djangoproject/site_media/media/outputs/HAKOU_v2/118/result_wave_deter.map'           'wms_srs'             'epsg:4326 epsg:3857'           'wms_enable_request'  '*'         END              #Scale range at which web interface will operate         # Template and header/footer settings         # Only the template parameter is required to display a map. See MapServer documentation     #    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'       END                      LAYER         NAME 'wave'         TYPE POLYGON         DUMP true         TEMPLATE fooOnlyForWMSGetFeatureInfo         EXTENT -159.87 20.33 -156.3 22.7         DATA '/vagrant/djangoproject/djangoproject/site_media/media/outputs/HAKOU_v2/118/result_wave_deter.shp'         METADATA           'ows_title' 'wave'         END         STATUS ON         TRANSPARENCY 100         PROJECTION         'init=epsg:4326'         END              LABELITEM 'HEIGHT_STR'         #LABELMAXSCALEDENOM 1451339.3664              CLASSITEM 'HEIGHT_STR'                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '0.001')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 0 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '1')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 48 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '2')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 96 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '3')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 145 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '4')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 193 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '5')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 242                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '6')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 193                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '7')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 145                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '8')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 96                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '9')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 48                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '10')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 0 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '11')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 48 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '12')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 96 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '13')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 145 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '14')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 193 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '15')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 242 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '16')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 193 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '17')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 145 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '18')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 96 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '19')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 48 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END                  CLASS                 EXPRESSION ('[HEIGHT_STR]' eq '20')                 LABEL                     ANGLE FOLLOW                     MAXOVERLAPANGLE 20                     FONT 'arial'                     MAXSIZE 10                     MINSIZE 10                     SIZE 10                     BUFFER 2                     COLOR 255 255 255                     MINDISTANCE 75                     MINFEATURESIZE 20                     OFFSET 0 0                     OUTLINECOLOR 0 0 0                     PARTIALS FALSE                     POSITION CC                     #SHADOWSIZE 1 1                     TYPE TRUETYPE                 END # LABEL                 STYLE                     COLOR 242 0 0                     WIDTH 0.91                     OUTLINECOLOR 0 0 0                 END             END            END     END      Any ideas on how to go about fixing this? In the end I would like it to show up at all zoom levels. Thanks in advance.


title: python gdal_polygonize error

text: I am trying to use gdal_polygonize to create a polygon from a binary raster. My code is:               os.system('gdal_polygonize.py ' + filename + ' -f ESRI Shapefile ' + shapefile)      where filename is a string file path with a '.tif' extension and 'shapefile' has a .shp I am receiving the following error message:               Creating output Shapefile of format ESRI.     Traceback (most recent call last):       File "/usr/bin/gdal_polygonize.py", line 164, in <module>         dst_ds = drv.CreateDataSource( dst_filename )     AttributeError: 'NoneType' object has no attribute 'CreateDataSource'      I have browsed the internet for help but to no avail. I am running the programme from NXclient on a windows 7 machine. Any help would be greatly appreciated. Becky


title: Overlaying Line (Vector) Layer on Raster Zones?

text: I will make my best attempt to clearly explain my problem. I am using ArcGIS 10 I have a raster layer with 3 values that make up zones. For the purpose of this example, lets say these zones are forest, grass, and open water. My whole raster is made up of these three values. I also have a line layer (it is currently a vector file but I'm fine converting to raster if I need to). This line layer is streams. I want to attach this stream layer to the raster layer based on zones. so I will end up with 6 values (Forest with stream, forest without stream, grass with, grass without, open water with, open water without). I basically want to do an overlay, but apply the stream value to the whole zone and not just a pixel. If a stream falls into a forest pixel, I want all neighboring forest pixels to also have that stream. I really want to avoid converting the raster to vector. I looked into the zonal function tools but they seem to only give me statistics and values based on zones rather than overlay two layers based on zones.


title: How to Plot Every Other Address on Street?

text: I have no idea if this is even possible. We run a Utility software company and need to know where to put the leak sensors. The sensors are put at either every other house or every two houses depending on the size and material of the water pipe. We have all of the data (size of the pipes, material, etc.) in our GIS server and the meters and water lines are being plotted on a map. Is it possible for us to be able to create an automated process for this? Basically, one of our employees would go on our map and be able to click a button on our map and it would automatically plot these points based on the pipe material and the pipe size.   1. Can you plot every other address is ESRI?    2. Will I need a database of all the addresses in the United States?    3. Is there a basemap in ESRI with all of these addresses?    4. Or am I making this way harder than it actually is?  Any help would be appreciated. Thanks.


title: SQL cursor issue

text: I am trying to create a new table using a cursor and a select statements.                Declare          Cursor c1 is           select store_number from table1  where CLIENT_ID= 1 and ORG_ID = 1 ;               Type C1_TAB_TYPE is table of c1%ROWTYPE;                c1_list c1_TAB_TYPE;                 Begin                     For r1 in c1                      Loop                 select  store_number                    BULK COLLECT INTO c1_list from                          (                      SELECT store_number,                     ( (SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(a.geometry,b.geometry, 0.005), 0.005, 'unit=sq_mile') /SDO_GEOM.SDO_AREA((a.geometry), 0.005, 'unit=sq_mile'))*100) Total_area                      FROM table2 a, table1 b                      Where store_number != r1.store_number                      AND sdo_relate(a.geometry, b.geometry, 'mask=anyinteract') = 'TRUE');                             For i in 1..c1_list.count loop                                      insert into temp_Prop_area                      (STORE_NUMBER,TOTAL_AREA)                       values (r1.store_number,Total_Area);                             End Loop;                  End Loop;           End;      Here I am using a store number to pass into a cursor.Now once have a store number ,I check want to get the area of overlapping between polygon for each store and the small polygons from table 1 over which the stores overlay. That area is called as Total_area. I am trying to pass this store number and total area in to the temp_Prop_area table. But I wont be able to do since in my cursor type I just have store_number . So what could I be doing to fix this. Thank You.


title: Trouble with INSERT in PostgreSQL 9.1

text: I am trying to execute the following:                   INSERT INTO lithic (cp_east, cp_north, type, material, art_count, comment, field_no, gps_unit, initials, rec_date, cortex, geom)          SELECT (cp_east, cp_north, type, material, art_count, comment, field_no, gps_unit, initials, rec_date, cortex, geom)           FROM lithic_9375_1230          WHERE lithic_9375_1230.rec_date > '12/18/2013'      My goal is to insert the rows in lithic_9375_1230 with rec_date later than 12/18/2013 into the table lithic. When I execute the above code I get the following:               ERROR: INSERT has more target columns than expressions     SQL state: 42601     Hint: The insertion source is a row expression containing the same number of columns expected by the INSERT. Did you accidentally use extra parentheses?     Character: 30      I have been beating my head on this for a few hours now. I'm running PostgreSQL 9.1 which was installed as a component of the OpenGeo suite. The two tables are different versions of the same shapefile which have been imported into Postgres via the pgShapeLoader tool. They use the same SRID. Any help is appreciated.


title: GIN/GiST Full Text searches through openlayers, geoserver and postgres

text: I have a a web app that automatically maps recent tweets and allows you to search for certain keywords. it uses Postgres for the database, geoserver as the server, and openlayers as the cartographic library. Right now tweet keywords are done using the ILIKE query. This works pretty well if the keyword i'm looking for is a commonly used word, like 'love' , 'friend', 'OMG', etc. but less common words like "geospatial" need to search through a lot more data in order to find the last n instances of the word. This is dead slow. To combat my slowness I'm building a GIN index on my tweet field in postgres. Two days later and i'm still waiting for the index to complete. Once it's built though, I'll try a few queries using SQL view parameters and hopefully this will dramatically speed things up. Even if this approach works though, it's not going to be all that useful if the index takes so long to create -- the maintenance of it will not be able to keep up will the incoming flood of data. I think I will try out the GiST index next and see how long it takes as I understand it is much faster to this build index. Beyond this, what can I do next? Do options like Solr work with Geoserver?? Are there any common approaches to this type of problem and data size/rate?


title: Geoserver integrated GWC not 'seeing' tiled layers

text: I am having trouble using Geoserver 2.4.1 integrated GWC, Ubuntu 13.04 and tomcat7 My data directory is set by setenv.sh with this string:               export CATALINA_OPTS="$CATALINA_OPTS -DGEOSERVER_DATA_DIR=/opt/gisdata/data"      When I check the /gwc folder in that directory, there are seeded folders and images. IE: ![enter image description here](http://i.stack.imgur.com/Fv9R7.png) However, geoserver's tiled layers screen does not show any disk usage. ![Tile Layers Screenshot](http://i.stack.imgur.com/1R4Dx.png) How can it be writing to the correct directory but not see those layer that it just wrote? Chmod 777 does not seem to help. Any advice, need more information?


title: Calculate ground nadir line from PV coordinates

text: I'm using an API which returns a satellite's PVCoordinates (Position/Velocity pairs).               {P(1036869.5330731269, 6546536.584960848, 9.892293545390519E-11), V(-9994.355195123433, 1582.9503539842497, -1242.4491245907245)}      **Given an array of these PV coordinates, how can I calculate or derive latitude and longitude coordinates for the nadir line (ground sub-track)?** Does anyone know of a Java API which might help me or is the math easy enough that I can write a function myself? (Full Disclosure: I have a math disorder) ![Nadir line example](http://i.stack.imgur.com/OTLNe.jpg) I've looked around the web and everything I see tends to make my eyes glaze over and humble me to the point of wishing my pathetic self should have taken more math in college.


title: Steps to publish ArcGISTiledMapServiceLayer and the best practice

text: Please suggest some URL or steps to publish ArcGISTiledMapServiceLayer service on ArcGIS 10.1 server so I can add in my application.What are the best practice to do that to increase performance.


title: Gdal_polygonize: How to filter pixels above a given value (elevation)?

text: **Given a topographic GIS raster** of one country: **Given an elevation threshold n = 50 (meters)** **How to polygonize pixels when z >= n ?** gdal_polygonize.py is not clear on this point. It states _`This utility creates vector polygons for all connected regions of pixels in the raster sharing a common pixel value`_. So I guess it MUST be like `z = something and only this`. I don't understand where to state the condition. * * * **Current workflow details:**               # download:     curl -o ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip'     # unzip:     unzip ETOPO1.zip     # crop:     gdal_translate -projwin -005.50 051.30 10.00 041.00 ETOPO1_Ice_g_geotiff.tif crop.tif      Related to: Topography: How to convert raster into vector layers?, Get a pixel value.


title: Detecting invalid polygons (self-intersecting or touching)

text: An invalid polygon can be defined as one that intersects itself, or one where the lines make contact, ie, the two shapes at the top of this picture. ![http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Straight_skeleton_2/invalid_polygons.png](http://i.stack.imgur.com/sS8oe.png) Given the XYPoints of a polygon, what logic (using C# preferably, but as long as I see logic, I can translate) could be implemented to detect these situations? I've looked at the Bentley-Ottmann_algorithm, however this detects if lines intersect and not if they touch. Not to mention, it says in the wikipedia article that it's slow.


title: Gdal: How to get a pixel's value from raster image?

text: Given a topographic raster image. Given a pixel's coordinate in pixel/lines or geocoordinate. **How to get it's pixel value ?**


title: need to clear cache memory using python

text: I have looked at several posts here and on other sites but have not found a solution to the problem I am having with this python script. In this script I use 2 nested 'for' loops to extract a series of variables by month (month = 0 - 11) from 5 netcdf files and then mosaic together each extracted variable. The script runs but after processing about 3 variables, I get the following error statement: ExecuteError: ERROR 999999: Error executing function. Failed to copy raster dataset Failed to execute (MosaicToNewRaster). My suspicion is that the cache memory has been exceeded. I tried using arcpy.Delete_management(SCRATCH) but then received the error that the scratch space no longer existed after only one variable was processed. Maybe I am putting that statement in the wrong place? Any other suggestions?               # Import arcpy module     import arcpy     import os          # Set Geoprocessing environments     arcpy.env.scratchWorkspace = "C:\\WORKSPACE\\Process_4"     SCRATCH = arcpy.env.scratchWorkspace               # Script arguments     ENA = arcpy.GetParameterAsText(0)     if ENA == '#' or not ENA:         ENA = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_ena_eh5_2030-2034_avg_trim_v4.nc"           NRM = arcpy.GetParameterAsText(1)     if NRM == '#' or not NRM:         NRM = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_nrm_eh5_2030-2034_avg_trim_v4.nc"          PNW = arcpy.GetParameterAsText(2)     if PNW == '#' or not PNW:         PNW = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_pnw_eh5_2030-2034_avg_trim_v4.nc"           PSW = arcpy.GetParameterAsText(3)     if PSW == '#' or not PSW:         PSW = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_psw_eh5_2030-2034_avg_trim_v4.nc"           SRM = arcpy.GetParameterAsText(4)     if SRM == '#' or not SRM:         SRM = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_srm_eh5_2030-2034_avg_trim_v4.nc"           Output_Location = arcpy.GetParameterAsText(5)     if Output_Location == '#' or not Output_Location:         Output_Location = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\summary\\"                #Variable list     for variable in ['SNOW', 'SMR', 'SWI', 'T0',  'T33', 'TA']:               #    SCRATCH = arcpy.env.scratchWorkspace               I attempted to place SCRATCH within the loop thinking that it would be recreated.  Nope.              #Month Iteration         for month in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]:             ENA_Layer = SCRATCH +"\\ENA"+variable+str(month)             NRM_Layer = SCRATCH +"\\NRM"+variable+str(month)             PNW_Layer = SCRATCH +"\\PNW"+variable+str(month)             PSW_Layer = SCRATCH +"\\PSW"+variable+str(month)             SRM_Layer = SCRATCH +"\\SRM"+variable+str(month)                  # Process: Make NetCDF Raster Layer (169)             arcpy.MakeNetCDFRasterLayer_md(ENA, variable, "x", "y", ENA_Layer, "", "time "+ str(month), "BY_INDEX")                  # Process: Make NetCDF Raster Layer (157)             arcpy.MakeNetCDFRasterLayer_md(NRM, variable, "x", "y", NRM_Layer, "", "time "+     str(month), "BY_INDEX")                  # Process: Make NetCDF Raster Layer (145)             arcpy.MakeNetCDFRasterLayer_md(PNW, variable, "x", "y", PNW_Layer, "", "time "+ str(month), "BY_INDEX")                  # Process: Make NetCDF Raster Layer (133)             arcpy.MakeNetCDFRasterLayer_md(PSW, variable, "x", "y", PSW_Layer, "", "time "+ str(month), "BY_INDEX")                   # Process: Make NetCDF Raster Layer (121)             arcpy.MakeNetCDFRasterLayer_md(SRM, variable, "x", "y", SRM_Layer, "", "time "+ str(month), "BY_INDEX")                            # Process: Mosaic To New Raster (25)             arcpy.MosaicToNewRaster_management("\"" + ENA_Layer +";"+ NRM_Layer +";"+ PNW_Layer +";"+ PSW_Layer +";"+ SRM_Layer +"\"", Output_Location, variable+"_"+str(month)+"2032", "PROJCS['WGS_1984_Lambert_Conformal_Conic',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',-102.3000030517578],PARAMETER['standard_parallel_1',30.0],PARAMETER['standard_parallel_2',60.0],PARAMETER['latitude_of_origin',52.0],UNIT['Kilometer',1000.0]]", "", "1", "1", "MEAN", "FIRST")             arcpy.Delete_management(SCRATCH)


title: Creating Training Pixels in GIS

text: I have a map that I've built up. It contains an aerial photo for the background (raster) and it has layers of flight paths of birds on top of it. I want to: 1) classify each pixel based on whether or not it contains a flight path of a bird in it. 2) classify each pixel according to a habitat type 3) classify each pixel based on the distance from a particular habitat type I have no idea how to even go about this process, so any help and guidance would be welcome. I have been told that I might be able to create a set of training pixels that will allow the reclassification to happen quickly? Thanks in advance, I appreciate it.


title: Legacy Geocoder Retiring - Alternatives to ESRI World Geocoder

text: Knowing that ESRI is retiring their legacy geocoding systems, what good alternatives for batch geocoding do you know of? Thanks


title: Spatial search to find featureclasses in SDE

text: Is there a way to find all featureclasses within SDE that fall within a spatial search e.g a user draws a rectangle on screen over a map of the world say. (I would like to do this progrmammatically, the native search tool in ArcCatalog is horrible). I'm thinking you may be able to do something with ArcSDE system tables to find things out or maybe go down to the level of creating some custom code in C/Java SDE API. So this is like doing a spatial search WITHIN a featureclass to find features - but a step further up in thinking. Many thanks.


title: Is there a way to get Openlayers' KML reader to deal with tessellation?

text: I'm trying to use OpenLayers' KML reader to display a KML file on a map, but the KML itself has LinearRings tha have a tessellate value of 1. I realize that this is used by google earth to snap the object to the ground for a more accurate drawing, but it causes the KML to be useless as far as the OpenLayers KML reader is concerned. So my question then is, what can be done to convert these tessellated regions? I'm assuming there's not simply a setting I can change in OL to have it properly display the regions without tessellation. Thanks.


title: What algorithm should I use to remove outliers in trace data?

text: I have GPX traces and want to remove outlying observations. There are some route points that are impossible because it would require acceleration that the vehicle can not achieve. Are there good algorithms for filtering out such extreme noisy observations?


title: Hotlinking Images using PickListener(MOJO)

text: I have a class               class MyPickAdapter implements PickListener {         public void beginPick(PickEvent pe) {}         public void endPick(PickEvent pe) {}         public void foundData(PickEvent pe) {              }     };      and a class               class HotPick extends Tool { }      In the HotPick class, I have a mouseClicked method that takes the point a user clicks and transforms it to world coordinates. If the coordinate is within a small distance from a certain point, it'll open a certain html file. The problem is I have to call the HotPick class from my foundData method in the MyPickAdapter class but I can't call the mouseClicked method and pass it a MouseEvent parameter. Is there a way around this or a way to transform pixels to world coordinates with a PickEvent? EDIT               class MyPickAdapter implements PickListener {         public void beginPick(PickEvent pe) {}         public void endPick(PickEvent pe) {}         public void foundData(PickEvent pe) {                 java.awt.event.MouseEvent m = pe.getMouseEvent();                 HotPick hotpick = new HotPick();                 hotpick.mouseClicked(m);         }     };          class HotPick extends Tool {         String l = "C:\\milwaukee.html";    //-87.9500,43.0500           java.text.DecimalFormat df = new java.text.DecimalFormat("0.0000");         public void mouseClicked(MouseEvent me) {             Map map = HotLink3.map;             com.esri.mo2.cs.geom.Point point = map.transformPixelToWorld(me.getX(),me.getY());             double x = Double.parseDouble(df.format(point.getX()));             double y = Double.parseDouble(df.format(point.getY()));             try {                 if (x < 1 && y < 50) {                     java.awt.Desktop.getDesktop().open(new File(l));                 }             } catch(IOException e){}         }     }      I'm just trying one point for now. Nothing pops up when I click near the point. I think the problem is in the HotPick class. Any help?


title: How to determine stream channel Reach locations?

text: I have a stream network and want to determine stream reach locations ![Stream Network](http://i.stack.imgur.com/sOPdv.png) In attached figure, Reach 4 is at the junction of sub2 and sub5, and Reach 3 is at the junction of sub1 and sub4. Any suggestions to determine these junctions based on confluence points using ArcPy or within ArcMap will be very much helpful.


title: inserting Cached .mxds into Flex viewer 2.5

text: I am trying to cache a number of operational layers in my flex viewer 2.5 application but after the layer type is changed from dynamic to tiled they are not visible in my viewer they are still visible in the Table of Contents widget. When I change them back to dynamic and reset they are still invisible. Is anyone familiar with this issue and have a solution? Thanks, jay


title: Creating contours for specific elevations

text: Input data: 1. an SRTM raster. 2\. Point file of peaks. -Attributes contain ID, x, y, z and the elevation at which the peak is completely isolated from a neighboring peak. The output I want is a line/polygon/point/raster file containing contours for that specific elevation of peak-isolation, for all the peaks. Simply put I want to draw a contour at a particular elevation below that peak. I have reviewed r.contour.level and r.contour.step commands in QGIS's GRASS toolbox, which can give me contours for exactly the elevations I want, but I need contours at different elevations for all the peaks, as their elevation of complete isolation would be different. I could manually do it for every peak I have, but could it be done through raster calculator for all the peaks and at specific elevations? (Added) I need something of a floating raster which masks some areas 'on the fly', while generating contour levels of choice. For example if I am generating contours for peakA at contour levels z1 - z10, i need to mask anything >25km (for eg.) around the peak. Creating masks for every peak in a batch is a solution. But i will still have to specify contours for as many peaks. Could there be an automated method in which contour attributes could match with a peak attribute and therefore a logical selection of required contours could be made from an existing layer of contours throughout the raster. Doing a spatial query of intersection/contains between contours_levels and Peak_points yields no result as they don't seem to be associated to each other on "canvas", but in reality they do. Thanks! More comments = awesome!


title: Nested TabControl & Map Control Binding Issue

text: I'm having a binding problem with the Map control when referencing a map I defined in XAML. I have a situation where I need to use nested TabControls that all reference the same map via element binding.               <UserControl x:Class="NestedTabControl.MainPage"               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"              xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"              xmlns:esri="http://schemas.esri.com/arcgis/client/2009"              xmlns:nestedTabControlControls="clr-namespace:NestedTabControl.Controls"              mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">     <Grid x:Name="LayoutRoot">         <esri:Map x:Name="map_TestMap" WrapAround="True">             <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com:80/ArcGIS/rest/services/World_Street_Map/MapServer"/>         </esri:Map>         <sdk:TabControl x:Name="tc_1" HorizontalAlignment="Right" Width="300">             <sdk:TabItem x:Name="ti_1" Header="TabItem 1">                 <!--<nestedTabControlControls:TestControl x:Name="test_4" VerticalAlignment="Top" Map="{Binding ElementName=map_TestMap}"/>-->                 <sdk:TabControl x:Name="tc_2">                     <sdk:TabItem x:Name="ti_Nested1" Header="Nested TabItem 1">                         <nestedTabControlControls:TestControl x:Name="test_1" VerticalAlignment="Top" Map="{Binding ElementName=map_TestMap}"/>                     </sdk:TabItem>                     <sdk:TabItem x:Name="ti_Nested2" Header="Nested TabItem 2">                         <nestedTabControlControls:TestControl x:Name="test_2" VerticalAlignment="Top" Map="{Binding ElementName=map_TestMap}"/>                     </sdk:TabItem>                 </sdk:TabControl>             </sdk:TabItem>             <sdk:TabItem x:Name="ti_2" Header="TabItem 2">                 <nestedTabControlControls:TestControl x:Name="test_3" VerticalAlignment="Top" Map="{Binding ElementName=map_TestMap}"/>             </sdk:TabItem>         </sdk:TabControl>     </Grid>      Everything above works fine except for the last TestControl (test_3) does not get a value for the property "Map". It's null. However, if I comment out the nested TabControl (tc_2) and uncomment TestControl "test_4" everything will work as expected. There seems to be something with element binding to the map in a nested TabControl that prevents element binding to the map on subsequent controls. Any ideas? TestControl:                   using System.Windows;         using System.Windows.Controls;         using ESRI.ArcGIS.Client;              namespace NestedTabControl.Controls         {             [TemplatePart(Name = TestControl.MapNameElementName, Type = typeof(TextBlock))]     public class TestControl : Control     {         private const string MapNameElementName = "txt_Map";              public const string MapPropertyName = "Map";              public TestControl()         {             this.DefaultStyleKey = typeof(TestControl);         }              private TextBlock _txtMap;              public static readonly DependencyProperty MapProperty = DependencyProperty.Register(MapPropertyName, typeof(Map), typeof(TestControl), new PropertyMetadata(OnMapPropertyChanged));              private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)         {             (d as TestControl).OnMapPropertyChanged(e.NewValue, e.OldValue);         }              private void OnMapPropertyChanged(object newValue, object oldValue)         {             if (_txtMap != null)                 _txtMap.Text = ((Map)newValue).Name;         }              public override void OnApplyTemplate()         {             base.OnApplyTemplate();                  _txtMap = GetTemplateChild(MapNameElementName) as TextBlock;         }              public Map Map         {             get { return (Map)GetValue(MapProperty); }             set { SetValue(MapProperty, value); }         }     }      }


title: What is the syntax for using a Bounding Box in QGIS WFS?

text: I am connecting our company Web Feature Service (WFS) to QGIS. I want to set the bounding box in the Expression string builder but the syntax is not working. bbox(79170, 3971, 99152,18095) The error message for this syntax is 'Function is called with wrong number of arguments'. I have also tried brackets. thanks for your help


title: How to use scale -rule based renderer in QGIS?

text: I wish to render a shapefile of builindings such that at scales below 1:5000, they have a border, and above 1:5000, they do not have a border. For this, I went into layer properties, selected Rule-Based, and then selected the current Rule and then went to Refine Current Rules>>Add Scales to rule. After this I set the symbol for scales >5000, like I wanted. ![enter image description here](http://i.stack.imgur.com/cTrAK.png) Here is my layer properties. ![enter image description here](http://i.stack.imgur.com/QynaF.png) You can see that there is an initial symbol. How Do I remove this? This causes problem because it is present behind the symbol; for example You can see the boundary here even though the scale is greater than 1:5000: ![enter image description here](http://i.stack.imgur.com/8qRX7.png) I have found that that if I remove the boundary of the first symbol(the one in blue), the layer appears as expected at scales >1:5000. This seems like a workaround rather than the straightforward procedure. What is the correct procedure to use scale -rule based renderer in QGIS?


title: How to avoid duplicate labels on each tile?

text: When I display my map using tiles a label gets drawn on each tile - is there any way to avoid this? I have attached an example image to show the problem: ![enter image description here](http://i.stack.imgur.com/ITahB.png)


title: Avoid multiple labels geoserver styling

text: > **Possible Duplicate:**   >  Labeling Geoserver SLD I have a geoserver 2.1.x installation with SLD stylization. I have used a property to label the polygons which forms a map. But the issues is the labels are getting repeated as in the figure ![enter image description here](http://i.stack.imgur.com/PwC1N.png) Is there any way to prevent this from happening?? * * * What I have done so far ---   1. I have tried to use the geoserver Vendor option for grouping of polygons with perticular label                 <VendorOption name="group">yes</VendorOption>      but this doesn't help.   1. I have used a custom solution suggested by someone from the mailing list ..               <Geometry>                 <ogc:Function name="centroid">                         <ogc:PropertyName>the_geom</ogc:PropertyName>                       </ogc:Function>                    </Geometry>      but removes the multiple labels, but adds some unwanted artifacts into the map, and I want to avoid using that...   1. I also tried the metatiling functionality by doing this -               tiling:true,     tileorigin: [map.maxExtent.left,map.maxExtent.bottom],      This removes certain multiple labels but not all... * * * Any other solutions??


title: How to stop multiple labes showing for a single item

text: On top of some other styling, I have used GeoExplorer to edit the scale based rendering of labels for the names of fields in an area. It all works fine but when I zoom in of fields that have a large area, the labels display multiple times spread out over the field. Is there any way to stop this and just have one label for each field?


title: Geometry errors when importing data from ESRI file geodatabase to PostGIS

text: When I run the following command to import by data from an ESRI fgdb to postgis...               ogr2ogr -f "PostgreSQL" -a_srs "EPSG:28355" -t_srs "EPSG:3857" PG:"dbname=tp_test user=postgres port=54321 password=xxxxxxx host=localhost" -overwrite P:\2012\183_TownPlanning_Symbology\Working\QueryLayer\TP_Query_Final_28355.gdb      ...I get...! > Warning 1: organizePolygons() received an unexpected geometry. Either a > polygon with interior rings, or a polygon with less than 4 points, or a non- > Polygon geometry. Return arguments as a collection. Warning 1: Geometry of > polygon cannot be translated to Simple Geometry. All poly gons will be > contained in a multipolygon. I have checked geometry in ESRI and it reports no errors. I am running multipart to singlepart to see if this resolves the issues but this is crashing arcmap 10.1 as is dissolve. It ran a sort without issues and you can open the dataset. I successfully imported the dataset earlier but then had to run the ESRI Dice tool to split the large polygons to no more than 15,000 vertices so that it processes faster. ![enter image description here](http://i.stack.imgur.com/gsnYA.png) I am new to postgis. **Is there a way to correct the issues in the new gdb or to split the polygons in postgis itself?**


title: Convert map to use space oblique mercator projection

text: I have a map document in ArcMAP which I want to convert to using Space oblique mercator projection, but not sure if ArcMap supports it. Any hints on how to achieve this? thanks!


title: How to export only certain columns to a CSV file in ArcGIS?

text: I've written a python script using arcpy which outputs a polygon feature class into a File Geodatabase. I have added a function to export the attributes to a separate CSV file. I am using the code which I have found in this post which works perfectly. However, that code exports every column in the feature class. I only want to export the fields that do not have the following names: `OBJECTID`, `Shape`, or `Shape_Length`. My CSV file generates successfully, and it correctly **does not** include the `OBJECTID` or `Shape_Length` fields. However, the `Shape` field **is** written to the file. An example value that is written to that field is:               <geoprocessing describe geometry object object at 0x28CB90A0>      I have added a line to print the field names as it iterates through them and surprisingly, `Shape` is not printed. It's as if ArcGIS is hiding it or gives it a different name. The code for my function is below:               def exportToTable():         """              Exports the final outputs to a CSV File.         """              # Create path to CSV File (note the varialbe outputPath is declared elsewhere).         CSVFile = outputPath+'\\FinalOutput.csv'         arcpy.AddMessage("Created CSV File: %s" %CSVFile)              # Get all fields in FinalOutput feature class and remove unwanted fields.         fields = arcpy.ListFields('FinalOutput')         for field in fields:             arcpy.AddMessage("Field.name is:"+field.name) #not printing 'Shape' field name             if field.name in (['OBJECTID', 'Shape', 'Shape_Length']):                 fields.remove(field)              i = 1         f=open(CSVFile, 'w')         for field in fields:             #--write the wanted field names to the output file             if i < len(fields):                 f.write('%s,' % field.name)                 i += 1             else:                 f.write('%s\n' % field.name)              # Use a search cursor to iterate through the rows of the table and write them to the CSV file.         rows = arcpy.SearchCursor('FinalOutput')         for row in rows:             i = 1             for field in fields:                 if i < len(fields):                     f.write('%s,' % row.getValue(field.name))                     i += 1                 else:                     f.write('%s\n' % row.getValue(field.name))         del rows         f.close()      Does anyone know what's going on here? * * * **EDIT to reflect modifications done as per @sgrieve's recommendations.** I modified my code to follow the advice of @sgrieve and it was still writing the `Shape` field. If I add a line to print the field names as it iterates through them, it lists all the fields **_except_** the `Shape` field, yet it still writes to the CSV. It also added the X a Y coordinates of the polygon as two new columns and the columns no longer aligned with the column names. I've modified the line where @sgrieve declares the fields to be the following: `fields = [f.name for f in arcpy.ListFields('FinalCadastre') if f.type <> 'Geometry']` The now code works fine, but I'm still unsure what the problem was. Does anyone know what was going on? What's the deal with the `Shape` field?


title: Error in passing geometry column to SQL query

text: When I execute the following query with a static table name it's working fine:               SELECT pe.structure_category_name,SDO_NN_DISTANCE(2),pe.bt_object_subid,     pe.bt_owning_node_id INTO v_sDPsct,v_saddDPdist,v_dpTypeNearSrvAdd,     v_sbtOwningNodeID FROM piper_equipment pe WHERE     SDO_NN(pe.shape,(unservedValue.shape),'sdo_batch_size=10',2) = 'TRUE' AND ROWNUM < 2 AND pe.bt_object_id = v_saddDPid      Here **unservedValue** is the data_record fetching through cursor. I have to pass table name as variable , so I have changed above query into the following:               stmt_piperequipment3 := 'SELECT pe.structure_category_name,SDO_NN_DISTANCE(2),      pe.bt_object_subid,     pe.bt_owning_node_id INTO v_sDPsct,v_saddDPdist,v_dpTypeNearSrvAdd, v_sbtOwningNodeID      FROM '||VWPIPERDATA||' pe WHERE     SDO_NN(pe.shape,(unservedValue.shape),''sdo_batch_size=10'',2) = ''TRUE'' AND     ROWNUM < 2 AND pe.bt_object_id = v_saddDPid';     execute immediate stmt_piperequipment3;      While executing above query it's giving following error               ORA-00904: "UNSERVEDVALUE"."SHAPE":invalid identifier.      My question is how to pass a shape into the string variable?


title: Recommend topics to be included in a Computer Science for Geospatial Technologies course

text: I will be instructing a course at the local university titled Computer Science for Geospatial Technologies. This is an introductory course meant to introduce computer science concepts to geospatial technologies students (GIS & Remote Sensing). In the past I have introduced programming concepts, but I found this went over many of the students' heads. Currently, I am planning to discuss computer hardware, spatial data types (i.e. shapefiles vs geodatabases), ESRI Geodatabase Model (the university works on an ESRI platform), basic database theory with ArcSDE Personal. Could anyone recommend some other computer science related topics that practitioners of GIS and Remote Sensing should know before entering the workforce? UPDATE: Last years curriculum included:   * Google Maps Javascript API/HTML/Google Earth/KML - 5 weeks   * Python Scripting - 6 weeks   * Database Theory/MS Access - 2 weeks   * VBA - 2 weeks The response I received from students was that not enough time was spent on each topic. I am speaking to the university to offer a next level course in GIS Programming using Python.


title: Error adding a delimited text layer in QGIS

text: I'm a GIS beginner here. I'm trying to add a delimited text layer in QGIS. The plug-in is okay. I have created a table in Excel, saved as CSV file, imported the file with QGIS, selected the delimiters (comma for csv files), XY fields long/lat, but when I click okay the next message shows up: _The layer file:///D:/josimar,agromet/IIAM- est%C3%A1gio/J.Biosse%20small%20database22222.csv?delimiter=%5B,%5D &delimiterType=regexp&xField=Long&yField=Lat is not a valid layer and can not be added to the map._ What could be wrong?


title: Why not measure elevation from the center of the earth?

text: In trying to understand Geoid vs Ellipsoid height, I ran across this page. One of the claims is: > Zero elevation as defined by Spain is not the same zero elevation defined by > Canada Basically, they are indicating that MSL is not constant and that makes comparing things harder. So my question is: **why not measure elevation as a radius from the center of the earth**? I guess I'm proposing `{lat, lon, radius}` to define a point on or near the earth. This could eliminate many problems in my thinking. (Let's use inertial center of the earth as our reference point...) Who cares that the topography of the earth is not constant? It wasn't constant in the first place, and to get height above ground, you just need some terrain data and a simple subtraction. I guess I'm proposing using one common reference point that doesn't change.


title: Are there any work-arounds for WMS width and height limit when printing?

text: I get the following error when trying to export in QGIS to PDF: "Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed" I am utilizing an WMS for my aerial imagery in the map and can't export it to a PDF or image. Does anyone know what is going on and whether there is a fix or work around? Thanks, Mickey


title: pgrouting how to implement driving directions with php

text: I am stuck on implementing driving directions. I have no clue how to do it. I wanted to do it just like this:   iMaptool LeadDog routing example Please advise


title: PostGIS ST_Buffer Radius Help

text: I am trying to find all points within a five-mile radius of a given point. I have a query like this:               SELECT * FROM table WHERE ST_Contains(ST_Buffer(geomFromText('POINT(0 0)', 4326), ?), latlon)      I cannot figure out what I put in place of `?` (radius) to get five miles. Everything is in EPSG 4326, and according to PostGIS documentation (as best as I can tell), my radius should be in meters. If I put in 12,070.0m (approximately 5-miles), I get matches half way across the country. Does anyone know what I am missing?


title: Mosaic To New Raster Changes Pixel Values

text: I am using the mosaic to new raster tool to mosaic two rasters together, one 2-bit and one 4-bit, and the output raster has given all the previously nodata pixels the value 3. Some of the pixels in the output should be 3, their original and intended value, while the majority should be nodata or a much higher or lower value like 255 or -/+ 32,768 that appears when I use the mosaic tool on data with different extents. Any idea what could be causing this? Should I be converting the 2-bit data to 4-bit to match the other raster? I have used the tool on very similar data for the exact same process and not had an issue like this before.


title: Why does tool take longer to run when in Python script?

text: I have written a python script that does some euclidean allocation. For that I use arcpy.gp.EucAllocation_sa() method. Now, my python script takes 30-40% extra time than spatial analyst euclidean allocation tool.                   arcpy.gp.EucAllocation_sa(in_raster_name, out_allocation_raster_name, "", "", cellSize, "VALUE", out_distance_raster_name, "")      **Question:** Is there any process that help me to improve the running time of this method? Is there any environment setting issue?


title: Iso metadata element gmd:credit

text: Trying to find details for a ISO element. We looking for a place to put a formatted citation that users of a content management system include in a dataset description. These citations are in reference to a published papers. We have the general details of the dataset (title, author detail(s), abstract), these would be put into the citation element. We could repeat a the MD_datasetInfo/gmd:citation, but the citation is not fielded, it's as input by the user using what they see as a standard citation reference. I am thinking that the appropriate MD_datasetInfo fields are citation, or suppliemental information. If I look in the XML schema, there is no annotationof what citation is intended for. So, what is appropriate content to put in gmd:credit element http://www.schemacentral.com/sc/niem21/t-gmd_MD_DataIdentification_Type.html Answering myself, since I guess questios about actual iso geographic metadata specs are out of scope. > Credit - recognition of those who contributed to the resource(s) Found on pdf page 55 in retired OGC document: The OpenGIS Abstract Specification: Topic 11: OpenGIS(tm) Metadata (ISO/TC 211 DIS 19115) (may require OGC member access)


title: Problem using test search for tags in ArcGIS JavaScript API

text: I have the next problem with a query using the ArcGIS Javascript API, when I execute this code:                portal.queryItems({              q: queryGroup+' AND tags:"' + tagsInserted+ '" ',              num: 100          })      The query is executing in a very strange way.if I the tags of the webmap are "A, B, C". These inputs are not working in the textbox: "C,B" "A,C" but "B,C" "A,B" "A" "B" or "C" are working. I don't have any idea what can be happening. More information here http://resources.arcgis.com/en/help/arcgis-rest- api/index.html#/Search_reference/02r3000000mn000000/ Thanks!!!


title: Is there a way to delete a raster using arcpy / ArcGIS 10.0?

text: I'm trying to find a way to delete a raster dataset (in any format) using arcpy. As it is now I have been writing custom functions for each file type (eg, delete directory and pyramids for grids, delete .tif, .tfw, ...etc for geotiffs). Seem like this should be an obvious thing but I can't find it in the function list.


title: ArcGIS No font options for Character symbol

text: I can't get the font options to display when trying to use character symbol in ArcMap. This problem is local to my machine only. See screenshot below. ArcMap 10.2.2 & Windows 7 Enterprise 64bit ![enter image description here](http://i.stack.imgur.com/BL27T.jpg)


title: how would one get the end points of a polyline?

text: I am attempting to write a script to get the end points of a series polylines, and then use those end points to create a polygon. I'm not sure which tools to begin to use on this project. I would prefer to use QGIS or even better a python script using open source tools. Thanks, Ryan


title: ArcGIS Select Tool: Do Not Create Empty Feature Class

text: I am creating an ArcGIS Model that imports a number of Bentley .dgn files to a geodatabase. My workflow involves:   1. Running the CAD to Geodatabase Tool, which brings all the drawing features into a feature dataset.   2. Taking the feature types and then selecting features by the "layer" attribute and writing them to a feature class with an appropriate name. My issue occurs at the Select tool. It will create a feature class even if it did not find any features to place in the feature class. This creates a whole bunch of empty feature classes since there are a number of layers which may or may not show up in any of my .dgns. So, I would like to know if there is a way to keep my model from creating blank feature classes?


title: A globe without borders

text: I would very much like to purchase a globe that has no political borders. I don't want the continents all diced up into countries and I certainly don't want any names or labels: just the geography of our planet. I suppose I wouldn't mind geographical wonders, tectonic plates, or other such intrinsic features labeled, but I want nothing political. I've searched and searched and haven't been able to find anything. Does anyone know where I could purchase such a globe?


title: How to include a quotation mark in a text field from field calculator

text: I'm trying to attribute pipe size and need to include a quotation mark in a text field. How do I include that in the field calculator. "4"" doesn't work.


title: Data Driven Pages, Graphs, and selections in ArcMap 10.1

text: Is it possible in python to create a selection set based on the extent from a Data Driven Page (DDP)? I have a layout view with a map and a graph. The graph is set to only plot the selected set of features. Right now I am paging through the DDP and drawing the selection box manually. I would like to add code to have the DDP also select point FC within the feature extent.


title: ArcMap Addin - add interoperability connection programatically

text: I'm currently building an add-in for ArcMap - ArcView using the .Net framework. The user of ArcMap and the Add-in should access data published from WFS services. I am aware that it is possible to manually add WFS services via the Interoperability Connections interface. But, is it possible to add these WFS services programatically? (chances are - my users will find it difficult to add these manually) And if it is, how could it be done? I can't seem to find any info on this subject. Best regards


title: Naming conventions PostGIS Database

text: We are starting to build up a database with PostGIS. The database is supposed to be for a team of about 5-8 researches who work frequently with geodata and statistics. Has anybody experience with naming conventions when setting up a database? some important things I already figured out are:   * use only lowercase    * use_underscores not spaces    * don't use special characters like ä,é, etc   * only use one language (might seem trivial but we are international)   * name tables and columns always in singular   * find a standardized way to name the objects in the database i.e. topic_year_source_format Especially the last point is tricky. Storing my own data i recognized that sometimes you'll get enormous names. So would it be bether to store this information in a metadata that is easy accessible instead of making these huge names that can be quite annoying... Can anybody give me some advice? thx!


title: GeoTiff specs for coordinate transformation definition

text: I would like to define a GeoTiff coordinate transformation by a set of GCPs only. The intention is to publish the GeoTiff as a coverage in GeoServer. However if I specify tie points only, GeoServer complains that I also need to specify the scale tag, which then results in only one tie point used, eg no inclination or shearing. Is this normal? Can't I use GCPs alone for projection? On the other hand I could define a transform, but the transformation is rather limited compared to let say a set of 10 GCPs. Thanks for any help, Thomas


title: Unable to put data into infowindow

text:
I've followed this tutorial to create a custom Google Map. I've included a few other elements such as linking it up to Wordpress and clustering the markers. It's all working great apart from the info in the info windows on each marker. I just can't seem to change the info within each one. I thought by changing the following lines it would change it but nothing affects it:               var html = "" + name + "
" + address;      This is the working map Where can I put in my own custom data into the window? Also, if I could style the window on that would be even better. * * * It seems the clusterer is the problem, mainly this section, how can I take the html content and place it into the info window?                 // Change this depending on the name of your PHP file       downloadUrl("<?php bloginfo('stylesheet_directory'); ?>/phpsqlajax_genxml.php ", function(data) {         var xml = data.responseXML;         var markers = xml.documentElement.getElementsByTagName("marker");         for (var i = 0; i < markers.length; i++) {           var name = markers[i].getAttribute("name");           var address = markers[i].getAttribute("address");           var type = markers[i].getAttribute("type");                var offsetLat = markers[i].getAttribute("lat") * (Math.random() * (max - min) + min);           var offsetLng = markers[i].getAttribute("lng") * (Math.random() * (max - min) + min);                var point = new google.maps.LatLng(offsetLat, offsetLng);           var html = "" + name + "
" + address;           var icon = customIcons[type] || {};           var marker = new google.maps.Marker({             map: map,             position: point,             icon: icon.icon,             shadow: icon.shadow           });           google.maps.event.addListener(marker, 'click', (function(marker, i) {                         return function() {                             infowindow.setContent(markers[i].getAttribute("name"));                             infowindow.open(map, marker, html);                         }                     })(marker, i));           cluster.push(marker);         }         var mc = new MarkerClusterer(map,cluster);       });     }          function bindInfoWindow(marker, map, infoWindow, html) {       google.maps.event.addListener(marker, 'click', function() {         infoWindow.setContent(html);         infoWindow.open(map, marker);       });     }      Specifically this, it's not putting the html content through the clusterer... at least this is actually changing the data in the window, just need to output the html content without breaking the clusterer:                     google.maps.event.addListener(marker, 'click', (function(marker, i) {                         return function() {                             infowindow.setContent(markers[i].getAttribute("name"));                             infowindow.open(map, marker, html);                         }                     })(marker, i));           cluster.push(marker);


title: esri draw graphic at a fixed screen coordinate

text: I am using ESRI silverlight. I have graphic objects on the screen and each graphic object has an attached silverlight label. What I want to do is to have each label shown at a fixed screen (pixel) distance from graphic object. This seems not possible as esri draws the labels according to the envelope given in map coordinates. Is there an easy way to show labels at fixed screen coordinates, not in map coordinates? thanks,