rpy2 installation on Mac OSX. A still unresolved problem on StackExchange and rpy-list

following lgautier's advice on rpy2 installation on Mac OSX, I posted my request on **rpy-list** and got in touch with Yair Benita who said he could only install rpy2 through his default Mac OS X python and wondered if I had not another version running. In **/usr/bin** , I can actually find **python** , **python2.5** and **python2.6**. Asking `which python`, the default one is `/usr/bin/python`. Running `/usr/bin/python`, I get that:               Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)         [GCC 4.2.1 (Apple Inc. build 5646)] on darwin         Type "help", "copyright", "credits" or "license" for more information      I get the same answer running `/usr/bin/python2.6` Is that ok or should I define a specific PYTHONPATH in my ~/.profile file? * * * Yair also suggested I defined the R variables correctly in my ~/.profile file: `export R_LIBS=/Library/Frameworks/R.framework/Versions/2.14/Resources/library export R_HOME=/Library/Frameworks/R.framework/Versions/2.14/Resources` That didn't work either. * * * He finally stated I had a not found error he coudn't see. Here is the log message I get running `python setup.py build` :               running build     running build_py     running build_ext     Configuration for R as a library:       include_dirs: ('/Library/Frameworks/R.framework/Resources/include', '/Library/Frameworks/R.framework/Resources/include/x86_64')       libraries: ('Rblas', 'Rlapack')       library_dirs: ('/Library/Frameworks/R.framework/Resources/lib/x86_64',)       extra_link_args: ('-framework R', '-F/Library/Frameworks/R.framework/..')      # OSX-specific (included in extra_link_args)       framework_dirs: ('-F/Library/Frameworks/R.framework/..',)       frameworks: ('-framework R',)     building 'rpy2.rinterface._rinterface' extension     gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -I./rpy/rinterface -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -c ./rpy/rinterface/_rinterface.c -o build/temp.macosx-10.6-universal-2.6/./rpy/rinterface/_rinterface.o     In file included from ./rpy/rinterface/_rinterface.c:63:     /Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:79:     /Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:132:     ./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’     ./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’     ./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’     ./rpy/rinterface/_rinterface.c: At top level:     ./rpy/rinterface/sequence.c:2173: warning: ‘ComplexVectorSexp_AsSexp’ defined but not used     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowFiles’:     ./rpy/rinterface/_rinterface.c:748: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_FlushConsole’:     ./rpy/rinterface/_rinterface.c:602: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ReadConsole’:     ./rpy/rinterface/_rinterface.c:470: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_WriteConsole’:     ./rpy/rinterface/_rinterface.c:328: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowMessage’:     ./rpy/rinterface/_rinterface.c:402: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_CleanUp’:     ./rpy/rinterface/_rinterface.c:896: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ChooseFile’:     ./rpy/rinterface/_rinterface.c:646: warning: ‘gstate’ may be used uninitialized in this function     In file included from /Library/Frameworks/R.framework/Resources/include/R.h:34,                      from ./rpy/rinterface/_rinterface.c:61:     /Library/Frameworks/R.framework/Resources/include/Rconfig.h:5:25: error: ppc/Rconfig.h: No such file or directory     In file included from ./rpy/rinterface/_rinterface.c:62:     /Library/Frameworks/R.framework/Resources/include/Rversion.h:5:26: error: ppc/Rversion.h: No such file or directory     In file included from ./rpy/rinterface/_rinterface.c:63:     /Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:79:     /Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:110:     ./rpy/rinterface/r_utils.h:13: error: ‘R_MAJOR’ undeclared here (not in a function)     ./rpy/rinterface/r_utils.h:13: error: ‘R_MINOR’ undeclared here (not in a function)     ./rpy/rinterface/r_utils.h:13: error: ‘R_STATUS’ undeclared here (not in a function)     ./rpy/rinterface/r_utils.h:14: error: ‘R_SVN_REVISION’ undeclared here (not in a function)     In file included from ./rpy/rinterface/_rinterface.c:132:     ./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’     ./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’     ./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’     In file included from ./rpy/rinterface/_rinterface.c:63:     /Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:79:     /Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype     In file included from ./rpy/rinterface/_rinterface.c:132:     ./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’     ./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’     ./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’     ./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’     ./rpy/rinterface/_rinterface.c: At top level:     ./rpy/rinterface/sequence.c:2173: warning: ‘ComplexVectorSexp_AsSexp’ defined but not used     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowFiles’:     ./rpy/rinterface/_rinterface.c:748: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_FlushConsole’:     ./rpy/rinterface/_rinterface.c:602: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ReadConsole’:     ./rpy/rinterface/_rinterface.c:470: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_WriteConsole’:     ./rpy/rinterface/_rinterface.c:328: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowMessage’:     ./rpy/rinterface/_rinterface.c:402: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_CleanUp’:     ./rpy/rinterface/_rinterface.c:896: warning: ‘gstate’ may be used uninitialized in this function     ./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ChooseFile’:     ./rpy/rinterface/_rinterface.c:646: warning: ‘gstate’ may be used uninitialized in this function     lipo: can't open input file: /var/folders/5L/5Li0yCI7EqmkqJ+Ra--M9U+++TI/-Tmp-//cchTMCy0.out (No such file or directory)     error: command 'gcc-4.2' failed with exit status 1      * * * I also tryed to install rpy2 through **Macport** with `sudo port install py26-rpy2`and got the following error message:               --->  Computing dependencies for py26-rpy2     --->  Dependencies to be installed: R cairo glib2 libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit openssl python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto xrender xorg-libX11 xorg-kbproto xorg-renderproto gcc45 cctools cctools-headers llvm-3.0 llvm_select gcc_select gmp ld64 libmpc mpfr ppl glpk icu jpeg pango Xft2 gobject-introspection readline tcl tiff tk xorg-libXScrnSaver xorg-libXext xorg-xextproto xorg-scrnsaverproto xorg-libXmu xorg-libXt xorg-libsm xorg-libice python26     --->  Applying patches to glib2     Error: org.macports.patch for port glib2 returned: command execution failed     Error: Failed to install glib2     Please see the log file for port glib2 for details:         /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log     Error: The following dependencies were not installed: R cairo glib2 libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit openssl python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto xrender xorg-libX11 xorg-kbproto xorg-renderproto gcc45 cctools cctools-headers llvm-3.0 llvm_select gcc_select gmp ld64 libmpc mpfr ppl glpk icu jpeg pango Xft2 gobject-introspection readline tcl tiff tk xorg-libXScrnSaver xorg-libXext xorg-xextproto xorg-scrnsaverproto xorg-libXmu xorg-libXt xorg-libsm xorg-libice python26     To report a bug, follow the instructions in the guide:         http://guide.macports.org/#project.tickets     Error: Processing of port py26-rpy2 failed      And on the log file for glib2 :               version:1     :debug:main changing euid/egid - current euid: 0 - current egid: 0     :debug:main egid changed to: 502     :debug:main euid changed to: 502     :debug:main Executing org.macports.main (glib2)     :debug:main Privilege de-escalation not attempted as not running as root.     :debug:main Skipping completed org.macports.archivefetch (glib2)     :debug:main Privilege de-escalation not attempted as not running as root.     :debug:main Skipping completed org.macports.fetch (glib2)     :debug:main Privilege de-escalation not attempted as not running as root.     :debug:main Skipping completed org.macports.checksum (glib2)     :debug:main Privilege de-escalation not attempted as not running as root.     :debug:main Skipping completed org.macports.extract (glib2)     :debug:main Privilege de-escalation not attempted as not running as root.     :debug:patch patch phase started at Mon Jul 16 11:43:43 CEST 2012     :debug:patch Executing org.macports.patch (glib2)     :notice:patch --->  Applying patches to glib2     :info:patch --->  Applying patch-configure.diff     :debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6'     :debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0'     :debug:patch Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/glib2/files/patch-configure.diff'     :info:patch sh: line 0: cd: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3: No such file or directory     :info:patch Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/glib2/files/patch-configure.diff'     :info:patch Exit code: 1     :error:patch org.macports.patch for port glib2 returned: command execution failed     :debug:patch Error code: CHILDSTATUS 4581 1     :debug:patch Backtrace: command execution failed         while executing     "system $fullcmdstring"         ("eval" body line 1)         invoked from within     "eval system $notty $nice \$fullcmdstring"         invoked from within     "command_exec patch "" "< '$patch'""         (procedure "portpatch::patch_main" line 35)         invoked from within     "$procedure $targetname"     :info:patch Warning: targets not executed for glib2: org.macports.activate org.macports.patch org.macports.configure org.macports.build org.macports.destroot org.macports.install     :error:patch Failed to install glib2     :debug:patch couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory         while executing     "open [file join $dir tclIndex]"     :notice:patch Please see the log file for port glib2 for details:         /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log      Has anybody another idea about what I could try ? Thanks a lot stan


Convert point file to polyline but not joining every set of points in ArcGIS10

I have a dataset that looks like :                  OBJECTID   Shape   KP     DESCRIPTION  EASTING  NORTHING           1       Point   0.04    Span;Start   525112.2 6728715.4           2       Point   0.0506  Span;End     525122.2 6728716.5           3       Point   0.0667  Span;Start   525138.6 6728718.7           4       Point   0.0506  Span;End     525142.7 6728719.2      Projection is UTM30-ED50 and there are 1462 points in the file. What I want to do is **join** each pair of points **between** the Start and End span, then leave a gap between the End and the next Start point. I have run Point to Line, easy, but this joins every point. Is there a way of specifying only the pairs of points I want to join? Or dissolving the parts of the line I don't want to keep after I have used, say, XTools, to split the line by points? Dumb question, I realise, but I just can't work this out!


Georeferencing help (GeoTiff into MapWindow6)

I'm a newbie with MapWindow6 and I would like to figure out a couple of things. 1 - Whenever I drag and drop a GeoTiff into the map (MapWindow6) I can not see that image at its place, I mean that Image is not georeferenced, so if I put another GeoTiff the latter overlaps the first one. With MapWindow4 it was quite simple after creating an instance for the grid raster. 2 - Is there any particular way to implement DotSpatial in my project? I'm using Visual Studio 2005. Any tips would be really appreaciated. Thanks a lot guys, Carmelo


Converting WKB to WKT

how can i convert wkb to wkt form ... i stored coordinates in wkb but now can it will display to use in wkt form


When I import polygon kml layer, how do I change projection and offset to correct for GMT wrap?

I created a polygon in Google Earth and saved to kml. After importing as a vector layer, where the polygon crosses the prime meridian, the polygon wraps around the world. So far, I have figured out that I need to change the projection [and offset?], but I cannot figure out how to do that. I am new to QGIS (and GIS in general). I have already spent many hours trying to figure this out. Can somebody please help?


ArcMAP SQL Statement Iterate Feature Selection 'IN' 'BY' 'IS' - escape character

We have a problem when selecting Features from a Feature Class in ArcMAP 10.2 using the Iterate Feature Selection tool in Model builder Our dataset has a Attribute Field with two character codes like 'AO', 'IN','BY','TR' and 'IS'. However the tool crashes because the SQL Statment cannot be evaluated. IN, IS and BY are reserved Words in SQL. How can i escape this behaviour? Edit This is the Error message in the log:   * ERROR 999999: Error executing function.   * An invalid SQL statement was used.   * An invalid SQL statement was used. [BY]   * An invalid SQL statement was used. [SELECT * FROM BY]   * Failed to execute (Feature Class to Feature Class). And the model is this: https://www.dropbox.com/s/msgo810uz28tprg/Modelbuilder.jpg


Shaded relief from DEM in GRASS and QGIS

I have been trying to get a good looking shaded relief model out of GRASS and Qgis for a day or so now and just can't seem to get it. The biggest problem I'm having is the valleys look like mountains, but I just can't seem to get the right combination in order to show mountains and valleys look right. Bellow is a some pictures of the problems: **DEM** _(Brown is high and Red is low, red is only used for a visual check)_ ![DEM](http://i.stack.imgur.com/zddmA.png) **Shaded Model 1 with DEM** _Sun position 180 degress from North, sun height 80_ ![alt text](http://i.stack.imgur.com/UOUL2.png) **Problem:** Hills look good but the river (in red) still looks like a mountain even though it's the lowest point on the map. **Shaded Model 2 with DEM** _Sun position north west (315 degrees), sun height 60_ ![alt text](http://i.stack.imgur.com/4wvvR.png) **Problem:** Again the hills look good but the river (in red) still looks like a mountain even though it's the lowest point on the map. I have tried all different combinations of angles and sun heights and I just can't seem to get the river to look like a river, it always looks like a hill. Can anyone point me in the right direction on what I might be doing wrong? **EDIT: So I took the contour data home and ran the process from the start and used the defaults for r.shaded.relief and got this:** ![alt text](http://i.stack.imgur.com/4KyLX.png) This looks much better to me, not the greatest colours but we can change that. I think my work install of grass must be busted because even the defaults looked bad.


wkb/wkt according to OGC

how can i store my coordinates in wkb.. i want to know its implementation of wkb and wkt in db .. any one can please guide me.


topology of geometries in gis

http://imm.io/2cpJ What is the thinking of OGC to keep this point that "point have no boundry , it just has interior"... what do they mean? this notation: `F**F*****`...still i am confused due to OGC model. It should be `TFTTFTTFT` as far as I know: the point have no interior, it has just a boundary, so it should be an F and T relation between point and line.


How to fix incorrect SRID of the geometry column?

I've been told to use AddGeometryColumn to properly add a column with correct/preferred SRID. however I wonder if it's possible to fix/change the current column instead of adding a new? If there's no other way but to use this function should I remove the previous column? Thanks a ton.


ArcGIS Attribute Assistant method not working

I don't know how many of you are using Attribute Assistant for ArcGIS 10.1, hope many:) I have some difficulties with a couple of methods. Well, I got the INTERSECTING_EDGE, the GENERATE_ID, and a couple of other simple ones right, but I still can't make it work for other ones. For example, several methods give me the approximately same error: > *Field is not specified, empty, or set for all. Trying: CREATE_LINKED_RECORD > ERROR: ID or Field to Copy was not found > >   * INTERSECTING_FEATURE_DISTANCE : ERROR/WARNING: was not found. > >   * NEAREST FEATURE: ERROR/WARNING: was not found. > >   * INTERSECTING_FEATURE: Source Layer not found. > >   * CASCADE_ATTRIBUTE: ERROR Target layer was not found* > > Not sure why "they cannot be found". I hope I wrote the syntax correct. I can imagine it would be difficult to find the problem for each one of them, but is it somewhere a section on ESRI help resources dedicated to the errors in Attribute Assistant log file, and especially how can I fix them? Say on a "Field to Copy not found" error what should I do. So, if anyone is willing to further help me with debugging this I would be grateful. I tried this on two computers:   * 1) arcgis 10.0 + attribute assistant addIn for 10.0.     * 2) arcgis 10.1 + attribute assistant addIn for 10.1


Creating geotiff in arcgis

I've added a shapefile and a raster image to ArcGIS, the raster image in geotiff format spreading over some of the features. Now, I want to create a buffer (of radius 1 mile) around the features and clip them and convert it as a Geotiff image to use it as a raster image.


color code wms maps

I have various WMS map layers showing state/province capitals and various lower level administration (eg. district) head quarters. I want to demarcate the state capitals and district head quaters using colors or something else. By default both are in red. I am using geoserver with openlayers. Is this even possible, since I have done some searches, but it results only in stylization of vector layers; not WMS layers.


Where did the edit UI tab go in QGIS 2.0?

QGIS 2 looks like a big improvement in the software, but a feature I really loved seems to have either moved or been dropped. I have been using Qt Creator to make custom forms for attribute entry, and then just linking them in through this nice simple tab in the layer properties dialog. Does anyone know if there is a new way to do this (python???) or am I just out of luck and did all that work making forms for nothing?


QGIS 2.0 cannot open TIFF

I've just installed QGIS 2.0 on my Windows 7 computer. I'm trying to open a raster and the system reports this message:               Cannot open TIFF file due to missing codec.       How can I solve it? Thanks in advance.


HSLayers WPS client with GeoServer issue

I have a local Geoserver set up. I want to use the WPS example given with HSLayers. It doen't work. I enter the server's URL, click "Connect" and nothing happens. Here is the original WPS.html located in hslayers-3.4.0/examples : I only changed the style part (so it doesn't affect the code), and I replaced the original folders for proj4js and ext3 with the ones I have installed.                             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />         <title>HSLayers test</title>                       <link rel="stylesheet" type="text/css" href="../build/theme/default/style.css" />                       <link rel="stylesheet" type="text/css" href="ext3/resources/css/ext-all.css" />         <link rel="stylesheet" type="text/css" href="../build/theme/default/style.css" />

                Anybody got a clue as to why ? I tried disabling the same-origin-policy on both Chrome and Firefox, doesn't solve the problem. It seems I am the only one on the Internet to have that problem because google simply has no acquaintance of the issue. Running on windows XP. Thanks


How to create a multipatch layer in arcmap?

I would like to create a multipatch layer in ArcMap using the editor tool. I have looked online but couldn't find any tutorials or help. How can I create a multipatch layer in ArcMap? Thanks.


Distributing processed OpenStreetMap data legally?

I'm working on different hiking maps, based on OpenStreetMap data. I want to distribute them, but I'm not sure, if I'm allowed to do so. Would it be OK to lay them out at a park entrance and accept little donations for the print?


Accessing features via arcpy

i try to use arcpy to accessing the features of a shapefile. I tried to use a searcheCursor, like that:               cursor = arcpy.da.SearchCursor(Points, ["SHAPE@XY"])     for row in cursor:         x, y = row[0]         print "Origin"         print("{0}, {1}".format(x, y))         row = cursor.next()         x, y = row[0]         print "End"         print("{0}, {1}".format(x, y))      Its just a example. In the first loop i want to use feature 1 and 2, in the second feature 2 and 3. But my problem is that i cant do the access by the row-index. Is there a possibility to do what i want?


Filtering out canopies and buildings from DEM to have a bare earth elevation

Can anyone suggest methods in filtering out trees and buildings from a DEM so as to come up with a reliable DTM? What I have is a grid from a LIDAR data. I was going to clean out the unnecessary items so I presume that I can solicit suggestions from here.


How to delete overlapping polygon features from one of two layers?

I really need your help! I have two overlapping layers of polygons, and i need to somehow erase the areas the overlaps. -This way i should end up with two layers of non overlapping polygons. Sounds pretty simple but i just can't get it right with any of the tools in Qgis!? Should i use "clip" or "cut shape by polygons", or perhaps the "difference" tool and the "clip"? Whatever I do the product isn't right. Best regards


Euclidean distance tool in ArcGIS refuses to calculate in meters

I have a shapefile with the several roads. I am using the Euclidean distance tool in ArcGIS to create different distance bands from the roads. However, despite being careful to ensure that all the layers are in a projected co- ordinate system (UTM in this case), the tool refuses to calculate the distances in meters. The image below shows a screenshot of the settings used for the euclidean distance tool (the cell size is being left out, and hence getting calculated automatically): ![enter image description here](http://i.stack.imgur.com/0XQZC.jpg) The following screenshot shows the output, using a discrete symbology: ![enter image description here](http://i.stack.imgur.com/uziQY.jpg) As you can see the distances seem to be calculated in decimal-degrees and not in meters. The roads layer cover a significantly large areas, thus a value of 0.007 is too small. I have used the distance measure tool too: ![enter image description here](http://i.stack.imgur.com/eyuGP.jpg) Where am I going wrong? How can I ensure that the distances being calculated by the Euclidean distance tool are in meters (i.e. the map units)?


Register folder on other drive ArcGIS 10.2.1

I have ArcGIS for server 10.2.1. I've installed his on drive C but i wanna register folder on drive D. ![enter image description here](http://i.stack.imgur.com/SyeCL.png) ArcGIS Server Account have full premissions to drive D. How can I register the folder on server?


ArcPy Append Ignores Domains

I've been working with the append tool inside arcpy and discovered that, even though I have domains constraining the values of some of my columns, I never receive an error when the domains are violated. I've read through the documentation for the append tool, and it doesn't discuss this in any way. Other google searches have failed me in finding an article about this issue. Have others had this problem? Does anyone have references to articles that have discussed this problem? Are there any strategies to ensure that domains are enforced properly? **UPDATE** Thanks for the great answers. It unfortunately seems that there isn't an easy way to validate features using arcpy. I can't make the switch to 10.2 because this script has to run on a variety of versions that aren't 10.2 (with no plans to upgrade soon). Thanks to everyone's help, I was able to find this article about the sdelayer -o feature_info command. It seems like this command will at least give me a list of invalid features, but I haven't had the chance to try it yet. I'll update when I've played around with it.


How to unselect WFS feature using geoextjs2?

I am using Openalayer 2.12, extjs 4.1 and geoextjs 2. I have created toolbar using geoext js Using link. Now in this link you can find select feature. but i have modified the code as               action = Ext.create('GeoExt.Action', {         tooltip: "select",         icon: 'Images/sel.png',         control: new OpenLayers.Control.SelectFeature(building),         map: map,         // button options         toggleGroup: "tools",         enableToggle: true,         group: "tools",         handler: function() {                         //alert("Select the feature");                         ed=null;                         sm=1;                     }                             });          actions["select"] = action;     toolbarItems.push(Ext.create('Ext.button.Button', action));      Now this code select the layer building now i want to unselect this selected feature on click of other tool in toolbar and code i have               action = Ext.create('GeoExt.Action', {             tooltip: "Unselect",             icon: 'Images/unsel.png',             handler: function() {                              }                                 });      actions["unselect"] = action;     toolbarItems.push(Ext.create('Ext.button.Button', action));      Can any one please help me to unselect the feature in this example


Import Zip codes into qgis

I have a list of zip codes (nearly thousands) which I want to show in qgis. After researching I found that I need to geocode them first into Lat/Long then I can use them to create a layer for qgis. I have the zip codes in an excel file and I have imported it in sql server 2008. Here is the table :               Zip     90001     90002     90003     90004      I just wanted to ask is there a plugin or an easier way to show these zip's in qgis ? Thanks


Is there a way to add Common Fields to multiple Feature Class's in ArcCatalog?

I've got a File Geodatabase that has many different feature class's. Now versus adding common fields one feature class at a time to the attribute table is there a toolbox or way to add a field to multiple feature classes at once?


How to join information from an excel table to a road feature in QGIS?

I'm working with GQIS 2.2.0 Valmiera. I've made a shapefile of a road that consists in a single line. Now I want to add information that I have in an excel table about several point in the road. How can I join this informations?


Fast zipcode detection from latitude/longitude

I need a way to get the zipcode of a lat/long pair fast (<10 ms), and at a high rate (thousands of qps) I've loaded a shapefile from the US Census Bureau into a mysql database with spatial indexing and I've been using the following code to query it:               select         zipcode     from         geo.part     where         ST_Contains(boundary,                 POINT(?, ?))         LIMIT 1;      It works great, only I'm seeing response times between 20 and 100ms. Do you have any suggestions to have it run faster? A different stack? (postgres with postgis maybe?) The shapefile had quite a lot of points per zipcode, I don't really need that much resolution. Would pruning those files make much of a difference (remove half of the points for each zipcode)? Something else?


Problem loading SID to geoserver

I have a folder with .sdw and .sid files I want to server using geoserver. I've followed the instructions here which basically means to install GDAL extensions and binaries on the geoserver machine. When I go back to stores after reseting the service I still don't see MrSID store. any thoughts? running on windows server 2008. Here are the steps I did to install it on server 2008 x64 on geoserver 2.4.0:   1. Downloaded GDAL extention from here and put it in Geoserver/web-inf/lib   2. Downloaded Imageio-Ext jars from here and put them in Geoserver/web-inf/lib   3. Downloaded gdal-data.zip from here and put it in program files\gdal-data   4. Added GDAL_DATA with path to the folder in no. 3 in system variables   5. Downloaded gdal-1.9.2-MSVC2008-x64.zip and put the content in program files\gdal-1.9.2   6. Added no.5 folder to system variable PATH   7. Installed gdal-19-1500-x64-mrsid.msi and put the dll in PATH location (system32)   8. checked that gdalinfo.exe --format MrSid works (and it did)   9. Since I run geoserver as service , I moved the DLLs from 5 (native) to the wrapper\lib folder.   10. Restarted Geoserver service ... Don't see MrSID or any change in stores. What did I miss ? There is a section saying : > Adding support for ECW and MrSID on Windows If you are on Windows and you > want to add support for ECW and MrSID there is an extra step to perform. In > the Windows packaging ECW and MrSID are built as plugins hence they are not > loaded by default but we need to place their DLLs in a location that is > pointed by the GDAL_DRIVER_PATH environmental variable. GDAL uses internally > this env variable to look up additional drivers (notice that there are a few > default places where GDAL will look anyway). For additional information, > please, check this link. Did I miss it ? If so , what needs to be done here ? which files I need to put where ?


does anyone have any links to free gis university courses?

Just wondering if anyone knows of any free Study resources for GIS, cartography or Photogrammetry from recognized universities? Language can be english or german.


openlayers undoRedo and Ragbag of components library conflict

I am currently using this example (link below) for modifying feature http://jorix.github.io/OL-Ragbag/examples/modify-feature.html and now I'm trying to add functionality for undo/redo (http://dev.openlayers.org/sandbox/tcoulter/examples/undo-redo-control.htm) Unfortunately it's conflicting with modify feature and showing the following error:               TypeError: OpenLayers.Util.isArray is not a function          if(!(OpenLayers.Util.isArray(this.deleteCodes))) {      Is there any way around it?


Openlayers - Zoom to selected feature

if I have this vector layer:               var vectors = new OpenLayers.Layer.Vector("vector", {isBaseLayer: false});          var feature = new OpenLayers.Feature.Vector(                     OpenLayers.Geometry.fromWKT(                         "POLYGON ((-18 -3, -18 14, 15 14, 15 -3, -18 -3))"                     )                 );          vectors.addFeatures([feature]);      How I can zoom to selected feature of the layer by a single click event? Thanks, Alfredo


Problem with full extent after using python code

I delete my previous post on the same topic because it was not clear. I made a python code for ArcGIS 9.3 which :   * copy a shapefile   * every feature in the shapefile are shift for an x and an y given.   * For example I have features near 888888888 , 888888888 and i move all of them near 0,0 The problem is when I use the full extent zoom after using this code, it is exactly as if my feature get the old and the new features position (but i am sure there is only the new position features in my shapefile). So, the full extent is from 0,0 to 888888888, 88888888 when it should be only concentrated near 0,0. If I export the data and open the exported data, then it works !!! The full extent is only on my new feature location. So I think there is something in the code i forgot when moving the feature, like   * refresh extent ???    * Delete previous position ???


MapServer Mapfile: Scalebar not displaying correct distances?

Scalebar:               SCALEBAR       LABEL         COLOR 0 0 0         SIZE SMALL       END       STYLE 0       SIZE 180 8       POSITION lc       COLOR 0 0 0       UNITS MILES       INTERVALS 2       TRANSPARENT TRUE       STATUS EMBED     END      I didn't even have a projection prior to adding the scalebar, I would just use the same projection per layer. So, I added that same projection outside the layers:               PROJECTION       "proj=latlong"       "ellps=WGS84"       "datum=WGS84"     END      Currently the scale bar comes up correct in size and intervals (2). **_The distance is 40 miles, which is definitely incorrect._** Any ideas on how to fix this? ![Picture of map](http://i.imgur.com/vAlM3vR.jpg)


Add regular points to each polygon in QGIS

> **Possible Duplicate:**   >  assign and move centroids to their polygons I'm trying to find out a method to define a unique ID based on specific coordinates for each polygon of a shp. The problem is since I need to avoid the points to lay out of the polygon boundaries, I may need to find an alternative to "centroid" function. Like a centroid forced to lay within each polygon's outlines (I know that it's against the definition of centroid itself, but I hope it's clear what I want). Like a "random points" function but which should always output the same result (as say "lat/long of the centre of the Polygon", given a definition of "centre"). I hope there's a way to do it, I'd rahther an automatic procedure than do all the stuff manually since I have plenty of polygons.


What Application for Vector and Cartesian Coordinate System

**Goal:**   Visualize a picture in SQL server 2012 spatial data based on geometry **Problem:**   In order to display a vector picture I need to retrieve X, Y coordinate (cartesian coordinate system) and display it in the SQL server spatial data. I'm looking for a tool that can draw vector graphic. Every object of line, point or zone you make, you shall enable to retrieve X and Y coordination from the start to the end of the object. For instance line object has start point (0,0) and end point (5,3). The reason why I need this X,Y data is to use them in SQL server to visualize a vector picture. > What tool do I need to use? **Other Important Info:**   * Please take account that I do not want to use geography data because the x-and y-coordinate data that are not defined in relation to any particular model of the Earth, it's using the geometry datatype with SRID = 0   * The X and Y data retrieve from the special application shall be enable to use in SQL server. In other word, same cartesian coordinate system without measurement of unit.   * It's important that this application can apply gif or jpeg picture to act as a background and om top on it, you draw a vector geometry data.   * This application should also take account to Well-known text to be customized with SQL server and its spatial data. In other word, take account to OGC standard   * The picture from a paper map or jpeg will be a subway map that is a linear cartogram ![linear cartogram](http://i.stack.imgur.com/fFvf0.gif)


How to Export a Personal Geodatabase to ArcSDE

I want to copy/export my personal geodatabase which consists of feature datasets, relationship class etc to an Enterprise geodatabase. What would be the best approach?


ST_Intersects returns "incomplete" results

I've created a PostGIS database of bus stops and train stations (from the gtfs file of two transit authority -- CITLA is the bus and AMT_Trains is... well, the train). I've created a 200 meters buffer around each train station and tried to select each bus stop that intersects those buffers :               CREATE TABLE citla.stop_stations AS         SELECT citla.stops.stop_id AS cit_stop_id, amt_trains.stops.stop_id AS amt_stop_id, citla.stops.the_geom AS the_geom         FROM amt_trains.stops, citla.stops         WHERE ST_Intersects(amt_trains.stops.the_geom, citla.stops.the_geom);       In this screenshot, ![screenshot](http://i.stack.imgur.com/ZEm4u.jpg) we see that the buffers (the grey circles) are correct (I'm telling you, they are at the right place... I've just removed the train stations symbol for clarity). The red dots are bus stops. The bigger blue dots are intersecting point (results from a spatial selection in QGIS). The single yellow dot is the PostGIS query result. It's just a sample, but only 6 of the supposed bus stops are selected. I tried with               WHERE ST_Contains(amt_trains.stops.the_geom, citla.stops.the_geom);      but I have the exact same results. I'm new to PostGIS and I'm stuck. Any ideas? THANKS!!


How to build a geographic database of GPS logs?

On our aerial wildlife surveys we typically generate dozens of GPX files, and usually convert most of them into shapefiles for display in a GIS application. GPX files are a terrific way of keeping all (or almost all) of your GPS data in one place – they are xml files that store tracklog, waypoint & route information in one convenient format. They store multiple tracks, even old saved tracks from a Garmin. I'd like to store all this track data in a spatialite database, in parallel with other tables that have point observational data from the same survey. ogr2ogr will let me convert the track to a spatialite database:               ogr2ogr -append -f "SQLite" -dsco SPATIALITE=yes # add to table with Spatialite filetype       -dsco INIT_WITH_EPSG=yes -t_srs epsg:4326 # using WGS84       SURVEYDATA.sqlite GPXFILE.gpx tracks -nln tracktable; # adding tracks to 'tracktable'      However, this imports each saved track as a line – losing the time / location information for each track point! Anyone know of any clever ways of building a tracklog database that will preserve that information? **EDIT** : Tracklogs are not just a line - they are collections of sequential points, each with an elevation and time attribute. Each point belongs to a track segment, which in turn belong to a given track, and points within each track segment were taken without interruption and may be assumed to be linked. For example:               <trk><name>ACTIVE LOG</name>     <trkseg>     <trkpt lat="-13.471403" lon="31.382982"><ele>467.818725585938</ele><time>2009-09-09T03:53:38Z</time></trkpt>     <trkpt lat="-13.471403" lon="31.382982"><ele>468.780029296875</ele><time>2009-09-09T03:53:50Z</time></trkpt>     <trkpt lat="-13.471403" lon="31.382982"><ele>465.896118164063</ele><time>2009-09-09T03:54:43Z</time></trkpt>     </trkseg>      Thus, to save a tracklog you need to save this collection of points with their associated data. One solution might be to load these tracks as points, with additional columns for track name, segment, elevation and time; I don't think ogr will convert the tracks as points, though. **Solution** Thanks to @scruss who pointed out gpx2spatialite, which I installed (OS X 10.9) with `sudo easy_install gpx2spatialite`. This set of tools is designed for the 'drawinglife' project (and thus has some 'city' information that is probably unnecessary for most of us); the main gpx2spatialite page doesn't explain much, but the drawinglife wiki is better. Still, lots of undocumented features - like removing duplicates! Create a spatialite database for GPX files which will hold track segments, tracks, trackpoints and waypoints. It also has 'users' set up (which is odd, since sqlite is not a user-access system) designed to label the various tracks:               gpx2spatialite_create_db MyGPXArchive.db      Load a whole folder of GPX files, including all subfolders, checking and removing duplicates along the way:               gpx2spatialite -s -d MyGPXArchive.db -u SL25 Selous2013/       Options:   * `-s`= don't check if the trackpoints are in the city database (speeds it up a LOT)   * `-d MyGPXArchive.db` = database to use;   * `-u SL25` = add the user SL25 (just a label I used for the set of tracks collected);   * `Selous2013` = the folder (with subfolders) that has the tracks I'm interested in. Bugs:   * If you have saved tracks on an older Garmin that discards time stamp info, it'll crash the import (remove those saved tracks using a utility like GPSU).


How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? `dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the first data frame for lyr in arcpy.mapping.ListLayers(mxd,"lyr", dataFrame)[0]: Current_Layer=lyr.name if lyr.name=="Polygons": lyr.definitionQuery = "[Floor] ="+ Floor_num and "[Physical_number_1] = "= physical_num dataFrame.extent=lyr.getSelectedExtent() `


gdalwarp results in incorrect extent

I have a GeoTIFF that's 172800x86400 on the MODIS "250 meter" Sinusoidal grid (more like 231.7, but who's counting?). (You can find its metadata at the bottom of this post.) This bounty of resolution has turned out to be quite a pain. My goal is to get it into a global half-degree grid (720x360) for compatibility with other datasets I'm using. The best solution appears to be the following. Steps 2 and 3 are based on info gleaned from this thread:   1. Use gdalwarp to re-project into WGS84 using nearest-neighbor, with size 172800x86400, longitude range [-180 180], and latitude range [-90 90]. This will result in a map at 7.5-second resolution.   2. Use gdaladdo to create a "240" overview using "average." This will result in a 720x360 image at 0.5-degree resolution.   3. Use gdaltranslate to turn that overview into a GeoTIFF with all the proper tags and such. Sounds good, right? (Of course if there's a better way, please let me know!) But when I run gdalwarp like so (without \ line breaks, which I added here for readability):               gdalwarp -s_srs "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs" \     -t_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0" \     -te −180 −90 180 90 -ts 172800 86400 -co COMPRESS=PACKBITS infile.tif  outfile.tif      The result is a GeoTIFF (metadata at end of post) with the correct size, but the wrong corner coordinates. Instead of the entire world, it only contains the Northern part of the Eastern hemisphere (i.e., the quadrant of the Earth with positive longitudes and latitudes). The resolution is, correspondingly, ¼ of what it should be (0.25 degrees per side instead of 0.5). I have tried various other structures of the gdalwarp command. These include:   * Not specifying s_srs, which I got from the original's metadata (same result)   * Specifying t_srs using the EPSG code (same result)   * Combination of the above (same result)   * Specifying _-tr 0.002083333333333 0.002083333333333 -tap_ instead of _-te_ and _-ts_. (I'm not sure what precision actually gets accepted into gdalwarp; that might be handy to know, too.)      * This results in a GeoTIFF of the right resolution, but wrong latitudinal size/extent (172800x86350, slightly > 3 minutes short of the poles). One solution would be to somehow "pad" the rest of this with zeros, which is realistic for my data, to make it 172800x86400. I know the other two steps work, as I went ahead and did them before realizing what gdalwarp had done. Like I said, let me know if there's a better way to do this, but I would really like to understand why I'm getting these results from gdalwarp. In case it helps, I'm running Mac OS X 10.7.4 with GDAL 1.8.1. Thanks in advance! * * * Here is the metadata from gdalinfo for the original GeoTIFF (infile.tif):               Size is 172800, 86400     Coordinate System is:     PROJCS["SIN         E019",         GEOGCS[,             DATUM["unknown",                 SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],             PRIMEM["Greenwich",0],             UNIT["degree",0.0174532925199433]],         PROJECTION["Sinusoidal"],         PARAMETER["longitude_of_center",0],         PARAMETER["false_easting",0],         PARAMETER["false_northing",0],         UNIT["metre",1,             AUTHORITY["EPSG","9001"]]]     Origin = (-20015108.640000000596046,10007554.320000000298023)     Pixel Size = (231.656350000000003,-231.656350000000003)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       COMPRESSION=PACKBITS       INTERLEAVE=BAND     Corner Coordinates:     ERROR 1: tolerance condition error     Upper Left  (-20015108.640,10007554.320)     ERROR 1: tolerance condition error     Lower Left  (-20015108.640,-10007554.320)     ERROR 1: tolerance condition error     Upper Right (20015108.640,10007554.320)     ERROR 1: tolerance condition error     Lower Right (20015108.640,-10007554.320)     Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)     Band 1 Block=172800x1 Type=Byte, ColorInterp=Gray      And here's the metadata from the result of gdalwarp (outfile.tif):               Size is 172800, 86400     Coordinate System is:     GEOGCS["WGS 84",         DATUM["WGS_1984",             SPHEROID["WGS 84",6378137,298.257223563,                 AUTHORITY["EPSG","7030"]],             AUTHORITY["EPSG","6326"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4326"]]     Origin = (0.000000000000000,90.000000000000000)     Pixel Size = (0.001041666666667,-0.001041666666667)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       COMPRESSION=PACKBITS       INTERLEAVE=BAND     Corner Coordinates:     Upper Left  (   0.0000000,  90.0000000) (  0d 0' 0.01"E, 90d 0' 0.00"N)     Lower Left  (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)     Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)     Lower Right ( 180.0000000,   0.0000000) (180d 0' 0.00"E,  0d 0' 0.01"N)     Center      (  90.0000000,  45.0000000) ( 90d 0' 0.00"E, 45d 0' 0.00"N)     Band 1 Block=172800x1 Type=Byte, ColorInterp=Gray


How to outsource scanning and georeferencing maps?

We have some historical paper maps and we want to get them scanned and geo- referenced and ultimately make a seamless map for a particular time. What vendors supply this service? (I have found Fuzecore and DDS so far from a Google search.) What experience have you had with them? In general,   * How does one go about evaluating these vendors--what criteria should be used to assess the quality, timeliness, and price of their work?   * What kinds of issues might arise in outsourcing this? What are the risks? To keep this thread within the StackExchange format, please provide objective and well-supported answers only.


Why can't I load more than 12 elevation files into NVIZ?

I have a large set of rasters in a GRASS mapset, which I would like to use as frames in an animation, visualizing the raster data as elevation. NVIZ is an obvious tool for this, but I'm having trouble getting started. Here's my basic approach so far. I'm starting with grey scale rasters that are actually RGB +alpha where R=G=B. I load one color channel from each raster into nviz as follows:               nviz elevation=file1.tif.blue@default,file2.tif.blue@default,...      This starts up NVIZ as expected for <12 files. With more than 12 files, the first 12 load successfully and then the process fails like this (tail end of log only):               Loading raster map <mean-L1-A1-000011_clipped.tif.blue@default>...      100%     Translating colors from raster map     <mean-L1-A1-000011_clipped.tif.blue@default>...      100%     WARNING: Loading data failed     WARNING: Loading data failed     WARNING: Loading data failed     zsh: segmentation fault  nviz      Do you have any idea why this is and how I can fix it? I'll need to load several hundred file at least, to pull off the animation. EDIT: In the interest of full-disclosure, and because I might be goofing with shell commands, here's what I'm actually entering at the GRASS command line. My original post was intended as a minimal example.               nviz elevation=`cat /Users/gregory/SimData/blue_channel.txt tr '\n' ','`      Where the file blue_channel.txt contains 659 lines has the form:               mean-L1-A1-000000_clipped.tif.blue@default     mean-L1-A1-000001_clipped.tif.blue@default     mean-L1-A1-000002_clipped.tif.blue@default      In order to test cases with different numbers of files as input for the elevation parameter, I'm varying the number of files passed to `head` in the syntax: nviz elevation=`cat /Users/gregory/SimData/blue_channel.txt | head -10 | tr '\n' ',' | sed -e 's/,$//g'` I've also tested that the problem isn't with specific files (seemed unlikely). For example, nviz does not crash on files 1-10, or 11-20, but it does crash on files 1-20.


How do I tell GRASS where to find Python?

For some reason, when I start GRASS on my Mac it says that it has found Python 2.6.7. However, /usr/bin/python version is 2.7.2 and I can't find a lower version anywhere on my system. Potentially relevant system info follows: Mac OS X 10.8.3 GRASS version 6.4.2 (2012) and all required frameworks installed with binaries from http://www.kyngchaos.com/software/grass in the past few days, so everything should be as up-to-date as I know how to make it. I suppose this is really a two-part question.   1. How can I tell where GRASS is finding Python?   2. How can I tell GRASS where it should be finding Python?


prohibited: getting knowledge from GoogleEarth photos/videos, and use it for own map?

Is it prohibited to use knowledge you get from proprietary images or videos? Example: I found a geotagged photo (ponramio) in Google Earth with a well on it. So I know: "Ah, there is a well where I can get water!". Can I use that knowledge to mark that well on my map? ...


Geoserver tiles mismatch

I tried to get WMS tiles from geoserver like _/geoserver/gwc/service/tms/1.0.0/layername@EPSG%3A4326@png/15/19142/9530.png_ or with another projection _/geoserver/gwc/service/tms/1.0.0/layername@EPSG%3A900913@png/15/19142/9530.png_ But all the time I got empty tile. For grabbing them I use openlayers. All in all the tile, which should be in 19142/9530.png are located in: _geoserver/gwc/service/tms/1.0.0/layername@EPSG%3A900913@png/15/19801/22523.png_ So as I could understood all the tiles have pretty big offset The offset tiles location and I got them in the center of the map.That layer which should be in Europe Where tile are really located are located in the part of Africa and ocean(link 1). That's why I couldn't use them with OSM maps and ect(because my tiles are simply empty). Can someone help me to manage with this problem? Is this a issue of geowebcache (geoserver) or I'm doing something wrong?


Is it a bad idea to hold references to ArcObjects inside business classes?

According to best practices is it a bad idea to cache features and geometries inside business objects? If it is bad, what is the alternative way? References to features may be replaced with their Ids, but what about geometries?


How to get linestring length while drawing?

I've got a control to draw lines:               new OpenLayers.Control.DrawFeature(vecLayer, OpenLayers.Handler.Path, {                 callbacks : {                 //    "done" : doneHandler,                     "point" : function(aPoint){                         console.log(aPoint);                     }                 }             })      and now i can get all points from linestring i add to the map. But what i need is to get length of the feature that is not finished (the reason i can't use `done` callback). How can i make this? I'm completly stuck, any help!


Merge 2 layers based on an attribute column in QGIS

I have a vector shapefile map that is divided into polygons. I want to add 2 columns to the attribute table with the eastings/northings coordinates of each polygon centroid. So far what I've tried is: menu > Vector > geom tools > polygon centroids This gives me the centroids, but as a new layer. What I cant figure out how to do is to merge this layer with the original. There is a command: menu > vector > join attribute by location. But what I want is, I guess, 'join by attribute column' or something.


Displaying UTM basemap and blocks

Im using arcmaps 10.1 and i have to imput pen points off a buch of old maps into arcmaps i have everything in order in arc maps but need help displaying the utm zones, basemaps, blocks, possibly sub-blocks as well. Having a shapefile with that all in it would be nice or if theres a simple way to get this to display in data view that would be appreciated.


validate SDE features within arcObjects (cant use sdeLayer)

I'm trying to sweep through a feature class checking for invalid features (and log the invalid features). Would IValidation.Validate work or does that just check for rules? If not I'm guessing I might be able to do something like (to force re- validation):               ((IGeometryCollection)featureClass.GetFeature(oid).Shape).GeometriesChanged();      However I'm not clear on what would happen if the feature was invalid I would still need find the ids of the invalid feature. Any suggestions?


Delta tables for versioning

I am doing versioning of sde. I have done this using the ArcMap. I want to look at the delta tables in sql server. In sql, I don't see the delta tables. I just see few tables named as a144. How do I look at the delta tables?


Is there any software (with a graphical user interface) for creating Style Layer Descriptors?

Is there any software that can easily create a Styled Layer Descriptor (SLD) without using a script?


How to Auto Increment Attribute Based on Nearest Point?

An authority I am working with would like their Hydrants, a point shapefile, to be renumbered based on their location. I am looking for any python script that would help me A. Find the next closest Hydrant B. Generate a number C. Increment that number for all hydrants. I am using ArcGIS Desktop version 10.0.


ArcGIS Python Script Tool Validation: Control Overwrite Behavior

I'm creating a script tool to read the USGS earthquake GeoRSS feeds. It works fine as a script with hardcoded values. The script also works fine as a tool for creating a new feature class for a given feed (hourly, daily, weekly possible choices). The problem I run into is when I want to control the overwrite behavior. I want to give the user a choice: overwrite the selected feature class or append the selected feed to that feature class. My tool has 3 parameters:   1. Output File    2. Feed Type: Hour, Day, Week   3. Overwrite: Boolean In the tool validation script, I disable the overwrite until the output file parameter selects a feature class that already exists. The problem is my script won't run because of the default behavior of the tool validation. My question is how best to overcome this problem. I want it to default to letting the user just select a possibly existing feature class and append records to that feature class. If the user checks the now enabled overwrite parameter, then it should delete that feature class and build a new one at its location. Even if allowing the overwrite possibility seems like bad programming practice, I'm still facing the problem of having an automated updating to the feature class, which is what I'm trying to make default: e.g., if they select the week feed to an hour feed they just ran, then it should give the entire week, including the hourly records it already possesses, without duplicating them--my script already handles this process; the validation is the problem. I have some ideas, but tool validation is new to me and the documentation isn't exactly robust. I'm thinking that using arcpy.env.Overwrite in the validation might help? I'll try and finalize my script this Saturday, so I'll update then.


import grass.script as grass under windows 7

OS: Windows 7 64bit GIS: QGIS 1.8 (qgis.org/downloads/QGIS-OSGeo4W-1.8.0-2-Setup.exe) I have created a plugin for QGIS, with the QGIS plugin builder. Now i would like to import grass.script into this script               # Import the PyQt and QGIS libraries     from PyQt4.QtCore import *     from PyQt4.QtGui import *     from qgis.core import *          # Initialize Qt resources from file resources.py     import resources_rc          # Import the code for the dialog     from testdialog import testDialog          # Import grass.script     import os, sys     import grass.script as grass      If i run this Script then i get the following error: ImportError: No module named grass.script The whole Error massage is: Couldn't load plugin test due an error when calling its classFactory() method               Traceback (most recent call last):       File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 164, in startPlugin         plugins[packageName] = package.classFactory(iface)       File "C:/Users/admin/.qgis//python/plugins\test\__init__.py", line 52, in classFactory         from test import test       File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 309, in _import         mod = _builtin_import(name, globals, locals, fromlist, level)       File "C:/Users/admin/.qgis//python/plugins\test\test.py", line 31, in          import grass.script as grass       File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 309, in _import         mod = _builtin_import(name, globals, locals, fromlist, level)     ImportError: No module named grass.script          Python version:     2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]               QGIS version:     1.8.0-Lisboa Lisboa, f440b60          Python path: ['C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/admin/.qgis//python', 'C:/Users/admin/.qgis//python/plugins', 'C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\bin\\python27.zip', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\DLLs', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\qgis\\bin', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']      How could i fix this problem? How could i "import grass.script as grass" into my script ? regards Marcus * * * --------------------- **update** --------------------- Now, i have add the following path variable:               GISBASE=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2     LD_LIBRARY_PATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\lib          PATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc;     C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc\python;     C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\bin;     C:\Program Files (x86)\Quantum GIS Lisboa\apps\msys\bin;     C:\Program Files (x86)\Quantum GIS Lisboa\apps\Python27;          PYTHONLIB=C:\Program Files (x86)\Quantum GIS Lisboa\apps\Python27     PYTHONPATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc\python     GRASS_SH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\msys\bin\sh.exe      Now i have an other error. But i create a new question for this. Thx for helping


How can I create/draw "freehand" polygon features in QGIS 2.2?

I installed the Freehand Editing plugin but it doesn't seem to work with the latest version of QGIS; the icon appears on the Ditizing Toolbar but the icon is disabled. Is there any way to use a freehand drawing/editing using a Wacom tablet and a pen in QGIS 2.2?


Suggestions for an efficient way to store raster files for lab use?

I'm trying to create a repository for our raster files from various sources and Im exploring the possibilities on how to store them and deliver them in our local intranet. I have come across rasdaman and seems like the tool for that kind of job. Any suggestions on how to create a system like that would be really helpful I'd prefer open source solutions over proprietary ones


What is the difference between Geoprocessing Map object vs. MapDocument object in Python

I have the following code:               mxd["C1"] = arcpy.mapping.MapDocument(os.path.join(fRoot, filename))     mxd["C2"] = [arcpy.mapping.MapDocument(os.path.join(fRoot, filename))]      C1 creates a geoprocessing Map object C2 creates a MapDocument object What is the difference between them in terms of functionality and/or limitations? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000n000000 UPDATE: Still not really sure what the difference is but found out in order to run my program I required to have geoprocessing Map objects and not MapDocument objects. Things like mxd.save(), and assigning the dataframe only seem to work with the geoprocessing object.


Generating MapQuest Style tiles for offline use

I need to create about a 9-level deep SLIPPY map of the world from OSM data (for offline use). So I cannot use the MapQuest, CloudMade, etc. servers). The projection must be EPSG4326 (LL84) which is another reason I cannot use them. The viewer is Leaflet which I have working fine with EPSG4326 tiles (currently I am diced the NASA Blue Marble to 9 levels). I like the look of the mapquest tiles the best: `http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg` but I could deal with others. The main reason I like MapQuest is the worldwide english labeling (with foreign subtitles) and the look of the topographic terrain (useful in regions with no roads). Tools that I have at my disposal include FME Professional (my favorite), QGIS, PostGIS 2.0, and GDAL. I am working on a large Windows 7SP1 box. I cannot use cloud services like like mentioned in the following article at OSM.org: http://wiki.openstreetmap.org/wiki/Deploying_your_own_Slippy_Map   * See Switch2Osm.org for more information on serving your own tiles.   * Tiledrawer is a free, quick-start, out-of-the-box renderer and server using the standard OSM toolchain for Amazon EC2, other virtual servers, and fresh installs of Ubuntu on any hardware.


How to keep NULL values in attributes until the user choses from the value map?

When I set up a attribute domain by using value map in QGIS then create a feature which in turn pops up the attribute pop up window - the value mapping for the attribute inserts the first value from the mapping into the attribute by default. I would like the value mapping to leave the attribute as null UNLESS an analyst chooses to click on the attribute in the attribute pop up window to reveal the value mapping pull down AND THEN choose a value for the attribute. Does anyone have an idea how to do that?


How to convert a raster (array) to a NetworkX graph and do a * search?

I want to use a slope-raster for a a_star path analysis in NetworkX. I am using Python for this project. My test raster looks like this![enter image description here](http://i.stack.imgur.com/12fFh.jpg) First I read in the raster with GDAL               input_raster = "slope5.tif"     raster = gdal.Open(input_raster)      Next I read the raster as an array               bandraster = raster.GetRasterBand(1)     arr = bandraster.ReadAsArray()      The array looks like this               >>> arr     array([[ 15.26072407,  16.01073837,  27.81685448,  24.49266815,              32.94010162],            [ 26.0834446 ,  21.01086426,  30.02531815,  25.44641304,              19.48436928],            [ 21.98579979,  19.06574059,  24.44838905,  26.67520905,              26.61030769],            [ 20.42549133,  28.58900261,  17.00629425,  31.25236893,              32.34066772],            [  8.33120537,  24.303339  ,   7.85025167,  35.50911713,              29.56856346]], dtype=float32)      Then I create from the array a graph               G = nx.DiGraph(arr)      As far as I understand it my graph looks like this               (0,0) (0,1) (0,2) (0,3) (0,4)     (1,0) (1,1) (1,2) (1,3) (1,4)     (2,0) (2,1) (2,2) (2,3) (2,4)     (3,0) (3,1) (3,2) (3,3) (3,4)     (4,0) (4,1) (4,2) (4,3) (4,4)      So for example the weight of `G[3][2]` is `{'weight': 17.00629425048828}` How do I now find the A star path? I tried the following to find the way from `(1,0)` to `(3,3)`?               nx.astar_path(G,(1,0),(3,3))      But that only gave               Traceback (most recent call last):       File "<pyshell#44>", line 1, in <module>         nx.astar_path(G,(1,4),(4, 2))       File "C:\Python27\lib\site-packages\networkx\algorithms\shortest_paths\astar.py", line 108, in astar_path         for neighbor, w in G[curnode].items():       File "C:\Python27\lib\site-packages\networkx\classes\graph.py", line 319, in __getitem__         return self.adj[n]     KeyError: (1, 4)      My nodes and edges look likes this:               >>> G.nodes()     [0, 1, 2, 3, 4]     >>> G.edges()     [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4)]        1. Is this the right approach?   2. How do I find the path?   3. Did I mix up something with nodes and edges?


Can ArcMap display the individual dimensions of a polygon?

I'm working with parcel data to get the dimensions of each lot to correspond with known dimensions. Is there a way to display the individual lengths of each line comprising the perimeter of a polygon? In other words, is there a way to display the distance between each vertex of a polygon in the map while editing?


Python Field Calculation

> **Possible Duplicate:**   >  Iterative position within Field Calculator/Python I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to start from 1 and progress up until the end of the county group and then start over.


How to update feature positions with clustering in OpenLayers?

I have an OpenLayers 2.12 map with a vector layer with a cluster strategy. All the static behavior is how I want it. Now I'd like to add the possibility to update the features' position. I do this with refresh code outside of the OL API, so I can easily add extra events, options lists and so related to the incoming data. The problem is that the clustering strategy doesn't update the position for features inside a cluster. If they are not clustered, they are moved. At first, the features are added to an array and then the array is stored and used to add all the features to the layer:               var myUnit = {     ...     this.layer = new OpenLayers.Layer.Vector(             "Voertuigen",             {                 strategies: [                     new OpenLayers.Strategy.Cluster({                         active: true,                         autoActivate: true,                         distance: this.clusterDistance,                         threshold: this.clusterThreshold})                 ],                 styleMap: new OpenLayers.StyleMap({                     "default": style,                     "hover": hoverstyle                 }),                 isBaseLayer: false,                 rendererOptions: {yOrdering: true}             }         );     ...     myUnit.layer.addFeatures(myUnit.features);      and for the update of the position I find the feature in myUnit.features array and move it               feature.move(pos_lonlat);      This works for all features not in a cluster. I tried many other things, including removing all the features from the layer and re-adding them. Strangely this also doesn't move the cluster. How can i trigger the strategy to recluster everything?


Is it possible to create multiple buffers using QGIS?

I'm new to QGIS and have no programming skills, is there an easy/uncomplicated way to create multiple buffers around a line feature.


error while running a geoprocessing service using IGPServer

I getting the " **the remote procedure call failed** "error message while running the following code....               enter code here //Here i am getting the polygon geometry from one featureclass......                IGeometry queryGeom = getBasinGeometry(queryBasin);                      pservContext = SOM.CreateServerContext("ReportGen/buffer_clip", "GPServer");                 IGPServer pgpServer = pservContext.ServerObject as IGPServer;                      string taskName = "State_Clip";                      IGPToolInfo task = pgpServer.GetToolInfo(taskName);                 IGPValues taskValues = (IGPValues)pservContext.CreateObject("esriGeoprocessing.GPValues");                 IGPParameterInfos paramInfos = task.ParameterInfo;                 IGPParameterInfo paramInfo = null;                 string parameterStr = string.Empty;                      for (int i = 0; i < paramInfos.Count; i++)                 {                     paramInfo = paramInfos.get_Element(i);                     taskValues.Add(paramInfo.Value);                     //add to parametername strin.....                     parameterStr += paramInfo.Name;                          if (i != paramInfos.Count - 1)                     {                         parameterStr += ";";                     }                 }                      //Now start assigning input values....                             IGPRecordSet gprecSet = (IGPRecordSet)taskValues.get_Element(0);                 IQueryFilter qf = pservContext.CreateObject("esriGeodatabase.QueryFilter") as IQueryFilter;                 gprecSet.RecordSet.Table.DeleteSearchedRows(qf);                      IRecordSet rs = gprecSet.RecordSet;                 IFields flds = rs.Fields;                 int shpIndx = flds.FindField("SHAPE");                 IField fld = flds.get_Field(shpIndx);                 ISpatialReference inputrs = fld.GeometryDef.SpatialReference;                 IRecordSetInit rsi = (IRecordSetInit)rs;                 ICursor cur = rsi.Insert();                 IRowBuffer rb = rsi.CreateRowBuffer();                      IPolygon iplgon = (IPolygon)pservContext.CreateObject("esriGeometry.Polygon");                 iplgon = queryGeom as IPolygon;                      //IPoint ipnt = (IPoint)pservContext.CreateObject("esriGeometry.Point");                 //ipnt.PutCoords(4099805.666, 3444416.24);                 //rb.set_Value(shpIndx, ipnt);                      rb.set_Value(shpIndx, iplgon);                      //exception is occuring here..........                 cur.InsertRow(rb);      If i run a same kind of tool with esriGeometryPoint datatype as Input featureset, Working fine. But the problem is only with polygon data type. Any suggestion will be useful Thanks Srinivas...............


How to load big ASCII rasters in Revolution R?

Is there anyone in this site using Revolution R with big spatial data ? I am trying to load raster files (ascii format) into revolution r using the xdf format, with no luck. Did anyone tried this already?


How to Set Page Numbers with Strip Map Index Features Tool

I have used the `Strip Map Index Features` tool to create an Index Layer for Data Driven Pages. The problem is with the page numbering that the tool creates. Some of the page numbers are in order, but others seem random. Here is the tool as I ran it: ![Tool](http://i.stack.imgur.com/CSofj.jpg) Here is the result I got: ![Result](http://i.stack.imgur.com/VNGNf.jpg) How can I modify the tool so that the page numbers are in some order? My preferred order would be along individual polylines from West to East and North to South.


Opening TIFF DEMs in QGIS

I have files, in Tiff format, downloaded from ASTER-GDEM. Can I open this file with QGIS? If yes, how? Thanks in advance


ArcGIS Online without basemap

I am trying to create a Web App, using the ArcGIS Online feature of downloading the javascript code, with the map id being used for connecting to the ArcGIS Online. I was able to do that successfully but the only issue is that I do not want a basemap. I only want the overlaying shapefile to be visible. How can I do that? Or is it not possible? ArcGIS Online does provides an option, where I can make my shapefile as the basemap and then the features of popups cannot be used on it. Any ideas how I can work it out?


How can I modify layer order with the QGIS python API

Typically, after a new_layer = addRasterLayer(...) that inserts new_layer before the active layer, I'd like to move it to the top of the table of contents. How to do it? I use an existing QGIS project, and I write an action in python in the layer properties, that calls qgis.utils.iface.addRasterLayer(pathgeotiff,name). When clicking the action, the layer "name" is created just above the current layer, and I'd like, in the action, to move it to the top.


How to find ring of coverage of GPS Satellite on WGS-84 ellipsoid?

# Given the following:   1. Time, t   2. The set of IS-200 Ephemeris data, E, of a GPS Satellite corresponding to time t   3. The ECEF position of the GPS satellite, P=(x,y,z), derived from the time and ephemeris, (t,E).   4. Assume the earth is just the WGS-84 ellipsoid.   5. All points on WGS-84 have the mask angle, m. # Find the following:   1. the ring of coverage, R, on WGS-84 of the GPS satellite. i.e., the boundary which distinguishes which WGS-84 points are in view the satellite at point P=(x,y,z) and which WGS-84 points are not in view ![A conceptual illustration of the problem.  P is the red point, PRN12; and the black ring is the "ring of coverage"](http://i.stack.imgur.com/3cAX4.jpg) # Acceptable solutions:   1. A spline over WGS-84 that approximates R.   2. A polygon over WGS-84 that approximates R.   3. Or a formula(s) that gives me R. # What I have tried so far:   * Let e^2 = 0.0066943799901264; eccentricity squared We have a ECEF WGS-84 position by geodetic latitude phi and longitude lambda: r = 1/(sqrt(1-e^2 sin^2(phi))) * (cos(phi)*cos(lambda), cos(phi)*sin(lambda), (1-e^2) * sin(phi)) I then convert ECEF to east-north up (ENU) geographic frame with phi and lambda using the matrix:                    (-sin(lambda)                  cos(lambda)                  0       )     C=   (-cos(lambda)*sin(phi)        -sin(lambda)*sin(phi)         cos(phi))          ( cos(lambda)*cos(phi)         sin(lambda)*cos(phi)         sin(phi))        * Let G = C ( P - r )   * Take the z component of G. should the z component of G be greater than sin(m) then I know the point, r, is in view. But that isn't sufficient get the solution that I am after. I could just find a bunch of points that are in view and take the convex hull of those points, but that is not efficient at all.


Advantages of WFS over GeoJSON/KML?

I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines on top of an OSM map in several layers. Those points and polygons should contain meta data (at least an ID) to show the user extra information on mouse over, click or touch events. Now I'm looking for the best way to send that data to the client. The whole area, where these features are placed, is subdivided into several sections and most of the time, a user is working in one section (reading information - writing is a very rare case, that will not be implemented right now). But these sections are placed next to each other and most of the time at least 3 sections are visible. Also the points could be clustered or hidden at a higher zoom level. I've heard about WFS, but I can't see the advantages over GeoJSON or KML. Would it be possible to just retrieve the features within the bounding box of the current view with WFS? We've got a MSSQL database and a webservice between the database and the web application and if it has not really advantages, we don't want to set up a GeoServer and a Postgres DB. Also it wouldn't be a problem to tell the webservice: Give me all features of layer L between X1,Y1 and X2,Y2 (as GeoJSON, KML or whatever). What are the advantages of WFS? What is the way, you would go or what more information is relevant for this decision?


ArcCatalog Error Adding WMS Server

When I tried to add a wms server in ArcCatalog, the following message came up: "The URL you passed in uses a protocol that is not supported." . The WMS Server is the following gis.ktimanet.gr/wms/wmsopen/wmsserver.aspx?. It's the Greek Cadastre WMS Server. I use ArcGis 10.2. Exactly the same message came up in QGIS. Any ideas? Thank you in advance for all the answers.


How to count and rasterize polygon overlaps in QGIS?

I have a large number of polygons that are overlapping. I'd like to create a heat map and plan on using raster calculation to do this. My plan: to give each polygon a raster value of 1, and adding them up. But, when I convert to raster, it will only the entire shape so that all overlapping polygons have the raster value of 1. Can I make it convert the individual polygons? I'm doing this in QGIS but come from an ArcGIS background, so either explanation may give me enough to get this done.


Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using:               africa_sat = 'E:/Research_Work/data/processing_data/carbon_satcchi/data/raw_data/africa_carbon_1km.tif'     name_clipshp = 'data/grid_clipped/' + name_hol + '_grid_cl.shp' # create object to point to clipped grid file          africa_stats = raster_stats(name_clipshp, africa_sat,stats=['mean'])      I have approximately 260 grid surface areas that I am employing. The grid areas have between ~10,000 polygons and ~40,000 polygons in them. Here is the error message I get for some of grids:                Traceback (most recent call last):      File "<stdin>", line 16, in <module>      File "C:\Python27\lib\site-packages\rasterstats\main.py", line 153, in raster_stats      rvds.SetGeoTransform(new_gt)      AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'      I do not get this error message, if the polygon overlaps completely with the raster image (tiff file) or if the polygon does not at all overlap with the polygon. However, if only a part of the polygon overlaps with the raster I get the error that is above. See picture below: ![enter image description here](http://i.stack.imgur.com/TtIUA.png) Does anyone know how to force gdal to create null / NA value in the polygons that don't overlap? Does anyone know a create solution to this issue?


get and change style property openlayers

i need to change the property of some style after its created, and i need to change it with knowing only the string of the property name. i am getting string like "fillColor" and value like "blue", and i need to change the style object. how can i do it? i didnt find anything in the api. the style code:                           var selectStyle = new OpenLayers.Style({                 externalGraphic: 'styles/tree_selected.png',                 graphicWidth: 16, graphicHeight: 26, graphicYOffset: -24,                 title: 'tree'             });


How to access and/or manipulate table data in QGIS composer label?

When setting up a map to print using the QGIS Composer, how can I insert a label linked to a specific table record? I have been using the latest development build (1.9.0) which has the new Expression Builder functionality, but still can't figure out how to do this. Example: I have a paddock layer with hundreds of paddock areas scattered over the country. Each area polygon is linked to a farm ID attribute. I want to create a composer view for each farm. On each view, I want a label that inserts the total hectares of all paddocks for that one farm. Either I have to get the Expression Builder to filter then add up areas and produce a total, or do this separately in a database table which is easy enough - but then how to access it? Thanks


Geoserver Reprojection Results in Northerly Shift Compared to GDAL

I have data in a postgresql data store in EPSG:2163 and am displaying that using OpenLayers in EPSG:3857. This results in a ~25 km northerly shift when displayed either in QGIS or OpenLayers. To test the reprojection I used GDAL and the Geoserver reprojection console, which confirmed that the x-coordinates were reprojecting correctly but the y-coordinates were artificially high. **GDAL:** gdaltransform -s_srs EPSG:2163 -t_srs EPSG:3857 1494718.24465831 -1025289.47657808 output = -9310869.18028598 4090931.77295946 0 (this displays correctly). **Geoserver:** Reprojection Console output =-9310869.180285975 4115158.942481106 (this displays north of expected). Resulting in a difference of 24.2 km. It seems to me that this a projection problem within Geoserver, any ideas what the problem is or how I can get around this? If I reproject my source data in postgresql to EPSG:3857, there are no projection problems but I want to keep my source data in EPSG:2163.


how to display the coordinates of a openlayers map with a jquery in my asp.net textbox?

**this is my initmap.js**               OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {     defaultHandlerOptions: {     },          initialize: function (options) {         this.handlerOptions = OpenLayers.Util.extend(             {}, this.defaultHandlerOptions         );         OpenLayers.Control.prototype.initialize.apply(             this, arguments         );         this.handler = new OpenLayers.Handler.Click(             this, {                 'click': this.trigger             }, this.handlerOptions         );     },          trigger: function (e) {         var lonlat = map.getLonLatFromPixel(e.xy).transform("EPSG:4326", "EPSG:900913");         alert("You clicked near " + lonlat.lat + " N, " +                                   +lonlat.lon + " E");         //document.getElementById("TextBox1").value = lonlat.lat;         //document.getElementById("TextBox2").value = lonlat.lon;          }          });     function init() {     size = new OpenLayers.Size(26, 30);          var mapOptions = {         projection: new OpenLayers.Projection("EPSG:900913"),         displayProjection: new OpenLayers.Projection("EPSG:4326"),         //units: "m",         //maxResolution: 156543.0339,         //numZoomLevels: 18,         controls: [                         new OpenLayers.Control.Navigation(),                         new OpenLayers.Control.NavToolbar(),                         new OpenLayers.Control.PanZoomBar(),                         new OpenLayers.Control.LayerSwitcher({ 'ascending': false }),                         //new OpenLayers.Control.Permalink(),                         new OpenLayers.Control.ScaleLine(),                         //new OpenLayers.Control.Permalink('Refresh'),                         new OpenLayers.Control.MousePosition(),                         new OpenLayers.Control.LayerSwitcher(),                         new OpenLayers.Control.OverviewMap({                             mapOptions: mapOptions,                             maximized: true,                              }),                     ]     };          map = new OpenLayers.Map('map', mapOptions);          nav = new OpenLayers.Control.NavigationHistory();     map.addControl(nav);     panel = new OpenLayers.Control.Panel(         { div: document.getElementById("panel") }     );     panel.addControls([nav.next, nav.previous]);     map.addControl(panel);               //Ajouter les couche google     var gphy = new OpenLayers.Layer.Google(         "Google Physical",         { type: google.maps.MapTypeId.TERRAIN }     );     var gmap = new OpenLayers.Layer.Google(         "Google Streets", // the default         {numZoomLevels: 20 }     );     var ghyb = new OpenLayers.Layer.Google(         "Google Hybrid",         { type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20, isBaseLayer: true }     );     var gsat = new OpenLayers.Layer.Google(         "Google Satellite",         { type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 20}     );     map.addLayers([gsat, ghyb, gmap, gphy]);               map.addControl(new OpenLayers.Control.MousePosition({ div: document.getElementById("LabelCoords"), numDigits: 5, prefix: "", separator: ",", mapOptions: mapOptions }));     map.setCenter(new OpenLayers.LonLat(-9.2, 31.9).transform("EPSG:4326", "EPSG:900913"), 7);     var click = new OpenLayers.Control.Click();     map.addControl(click);     click.activate();           }


TIN when generated goes off the limits ARCGIS 9.3

i have to creat TINs for a specific areas so the original points or countours are exactly whithin the geographical limits of the area, but when i generate TIN it goes out of those limits and its normal based on the principle of triangulation but is there anyway to gard the same shape and limits after creating a TIN ? right now im using "paint" to clean the mess so please help me :) thanks


Getting OSM data for a particular jurisdiction

I'm trying to make a street map of New York City (and only New York City). I've downloaded OSM data for the area (from here), but it contains lots of data from the suburbs. Currently, I've loaded this data into PostGIS (with osm2pgsql), but there's nothing obvious which would let me distinguish roads in the city from those in the suburbs. What's the best way to get streets only within the city?


Account for bridge overpasses in a ground DEM to allow for water flow under the overpass

I have a bare earth DEM made from lidar data (A). It works well and has passed all accuracy tests. It is used in storm surge models. The problem we are having is on underpasses. I need to allow water to flow through underpasses when one road crosses another. My thought is to: 1) Get all roads marked as bridges from OSM. 2) The select all the crossing roads that cross under them (intersect). 3) Then on the new selection of new road segments (2) convert these to raster. 4) Extract all the DEM (A) values under these road segments. 5) Select the minimum of these values under the new road segment (2). 6) Burn this minimum value into the DEM I have to cut a channel through the underpass. Open to all suggestions, improvements, ideas on how to achieve this including entirely different solutions. Other options are just get the intersect point and grow this out or maybe identify sinks and work back from this.


Pack table option in MapBasic

I write a code pack all table in Map Window, after pack all table, some tables are removed from map window, How do I known which table is pack, and open table to map window in the order as original layer.


Is there a source for historical shapefiles of Europe in the modern era?

Is there a source for historical shapefiles of Europe in the modern era, i.e. starting ca. 1400? I know that "where can I find historic border data" questions were asked multiple times but I couldn't find an answer to my specific question.


How to convert numeric fields into strings with leading zeros?

I'm trying to define an action in Quantum GIS using on of my fields but I have some problems with its format. I have a numeric string like '5' and I need to have a format like '005'. I've tried function "tostring(myfield)" but I am not able to define the format that I want. Is there any way to do something like tostring(myfield,"000")? What I'm looking for is a function like this one: http://office.microsoft.com/en-us/excel-help/text- HP005209313.aspx?CTT=5&origin=HP005204211 Thank you!


What can cause an ArcIMS server process to run away with the CPU?

We have an old application running in ArcIMS (don't ask, we're getting rid of it as soon as we can :)). All who had anything to do with the application's design or programming are long gone. We're trying to make this 9.3.1 application run in version 10 so we can upgrade our production servers to ArcGIS Server 10. Our ArcIMS runs on a server along with ArcGIS Server. Every 24 hours or so one or more arcimsserver.exe processes go rogue and take up 99 - 100% of the CPU. On the ESRI forums this type of question doesn't seem to get a response, and ESRI support has failed to help is for the last several incidents. Does anybody here have a suggestion for what to check? EDIT: The data includes image and map services. The data is in shapefiles and SDE. EDIT: After some testing and exploring, we found that a database server had been moved since the application was built. The server connection was buried in the application. When we corrected it and restarted, the problem did not occur as often. After some more digging, we found other obsolete data connections. We have corrected them and now the problem occurs only about once every ten days or so.


How can a 9.2 user access a geodatabase created in 9.3?

I have a colleague that uses 9.2 and has access to our server in which I have multiple geodatabases that were created in 9.3. Is there any way for her to access the data?


PostGIS: Select features that do NOT intersect

This seems to me like such a simple question (and it probably is) yet I cannot seem to find an example that gives me the answer. Using PostGIS, I just want to select points that fall _outside_ of polygons. Ultimately this is the inverse of the ST_Intersects, as far as I can see it. Example: I have a taxlot layer and a address point layer. I assume I should be using the ST_Intersects, but how do I tell it to do teh reverse selection? I thought maybe adding a _NOT_ statement in front of the code below, but that did not work.               CREATE table t_intersect AS     SELECT        hp.gid,        hp.st_address,        hp.city,        hp.st_num,       hp.the_geom     FROM        public.parcel as par,       public.housepoints as hp     WHERE        ST_Intersects(hp.the_geom,par.the_geom);      Thanks for the input!


Clustering table on geohash index and geohash ordered table

I wonder if there could be a performance gain to re organize the rows in a table by Geohash and then CLUSTER this table on the Geohash index of the geometries.               CREATE TEMPORARY TABLE tmptbl AS     SELECT *, (st_geohash(st_transform(geom,4326),10))as geohash     FROM mytable  ORDER BY geohash;          DELETE FROM  mytable;          ALTER TABLE tmptbl DROP COLUMN geohash;          INSERT INTO mytable SELECT * FROM tmptbl;          DROP INDEX mytable _geom_gist;          CREATE INDEX mytable _geom_gist     ON mytable USING gist(geom);          CREATE INDEX mytable_geom_geohash     ON mytable  (st_geohash(st_transform(geom,4326),10));          CLUSTER mytable USING mytable_geom_geohash;      Thanks


No ogr module despite having gdal installed?

I am trying to use the mapping component of the wonderful PySAL package, but for some reason I do not have the ogr module. I was under the impression that it came packaged with gdal. Am I missing something?               import gdal     import ogr          ---------------------------------------------------------------------------     ImportError                               Traceback (most recent call last)     <ipython-input-29-ef9eb3418665> in <module>()     ----> 1 import gdal           2 import ogr          ImportError: No module named gdal      **UPDATE:** I am afraid I was in a bit of a hurry to catch a plane, so I failed to include some critical information. I already installed python-gdal using the apt-get method described here, because I wanted to leave little to chance. Is it possible that the package manager did not install it correctly?               choct155@choct155-Q550LF:~$ sudo apt-get install python-gdal     Reading package lists... Done     Building dependency tree            Reading state information... Done     python-gdal is already the newest version.     The following packages were automatically installed and are no longer required:       firefox-globalmenu libfftw3-3 libgeos-3.3.3 libogdi3.2 libxerces-c28     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.      I am afraid I am not finding osgeo either...               from osgeo import gdal          ---------------------------------------------------------------------------     ImportError                               Traceback (most recent call last)     <ipython-input-28-a04b80bf4e65> in <module>()     ----> 1 from osgeo import gdal          ImportError: No module named osgeo      Additionally, I should add that I am using Ubuntu 13.04.


GPS NÜVI 50 -Garmin

I would like to know the accuracy in degrees (not feet) of the latitude and longitude coordinates that the GPS NÜVI 50 gives for a point.


Can I "stack" semivariogram data?

I have several synoptic measurements (every few months) of a gravity field I would like to interpolate by kriging. Each group of measurements comprises about 45 measurement locations, and spatial correlation is relatively poor. I would like to use a single semivariogram model for all of the interpolated surfaces, rather than fitting a unique model for each measurement time. I think this is appropriate because the changes over time are caused by the same underlying phenomena (groundwater level change), and the spatial correlation should be unchanging with time. Is there any problem with "stacking" the semivariogram data? I would have to calculate the semivariance-distance pairs independently for each measurement time, but could then combine all of them on a single semivarogram plot and fit my model to all of the data pairs. I'm primarly an arc user, but I think I could create the semivariogram model outside of arc (e.g., MATLAB) and simply specify the nugget/sill/major range for spatial analyst. Thanks-