title: Installing python GDAL with pip in local (user) space on RHEL6 server: failure due to missing headers

text: There are similar themed questions for other platforms, but the solutions out there do not work for me. (e.g. http://stackoverflow.com/questions/11336153/python-gdal-package-missing- header-file-when-installing-via-pip) I am using a virtualenv to have a user-space implementation of python on a RHEL GNU/Linux server. I have installed lots of favourite packages into my local python directory with little problem, using pip. pip install gdal, on the other hand, fails, with many missing header file errors. I have tried > pip install --no-install gdal followed by navigating to (my python path)/build/GDAL and then > python setup.py build_ext --include-dirs=/usr/include/gdal but that fails with lots of other errors:               running build_ext     building 'osgeo._gdal' extension     gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/gdal/ -I/usr/include/python2.7 -I/home/projects/sprawl/pythonSprawl/lib/python2.7/site-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o     extensions/gdal_wrap.cpp:3000: error: ‘VSILFILE’ has not been declared     extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFReadL(void**, int, int, int*)’:     extensions/gdal_wrap.cpp:3035: error: cannot convert ‘int*’ to ‘FILE*’ for argument ‘4’ to ‘size_t VSIFReadL(void*, size_t, size_t, FILE*)’     extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, const char*, void*)’:     extensions/gdal_wrap.cpp:3237: warning: the address of ‘_Py_NoneStruct’ will never be NULL     extensions/gdal_wrap.cpp: In function ‘void PyCPLErrorHandler(CPLErr, int, const char*)’:     extensions/gdal_wrap.cpp:3373: error: ‘CPLGetErrorHandlerUserData’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘CPLErr PushErrorHandler(void (*)(CPLErr, int, const char*), void*)’:     extensions/gdal_wrap.cpp:3387: error: ‘CPLPushErrorHandlerEx’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘void PopErrorHandler()’:     extensions/gdal_wrap.cpp:3394: error: ‘CPLGetErrorHandlerUserData’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIStatL(const char*, StatBuf*, int)’:     extensions/gdal_wrap.cpp:3488: error: ‘VSIStatExL’ was not declared in this scope     extensions/gdal_wrap.cpp: At global scope:     extensions/gdal_wrap.cpp:3496: error: ‘VSILFILE’ has not been declared     extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFWriteL(int, char*, int, int, int*)’:     extensions/gdal_wrap.cpp:3503: error: cannot convert ‘int*’ to ‘FILE*’ for argument ‘4’ to ‘size_t VSIFWriteL(const void*, size_t, size_t, FILE*)’     extensions/gdal_wrap.cpp: At global scope:     extensions/gdal_wrap.cpp:3832: error: ‘GDALAsyncReaderH’ does not name a type     extensions/gdal_wrap.cpp:3838: error: ‘GDALAsyncReaderH’ does not name a type     extensions/gdal_wrap.cpp: In function ‘void DeleteAsyncReaderWrapper(void*)’:     extensions/gdal_wrap.cpp:3857: error: ‘struct GDALAsyncReaderWrapper’ has no member named ‘hAsyncReader’     extensions/gdal_wrap.cpp: At global scope:     extensions/gdal_wrap.cpp:3867: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:3868: error: expected primary-expression before ‘void’     extensions/gdal_wrap.cpp:3868: error: initializer expression list treated as compound expression     extensions/gdal_wrap.cpp:3869: error: expected ‘,’ or ‘;’ before ‘{’ token     extensions/gdal_wrap.cpp: In function ‘void DisableAsyncReaderWrapper(void*)’:     extensions/gdal_wrap.cpp:3885: error: ‘struct GDALAsyncReaderWrapper’ has no member named ‘hAsyncReader’     extensions/gdal_wrap.cpp: At global scope:     extensions/gdal_wrap.cpp:3892: error: ‘GDALAsyncStatusType’ does not name a type     extensions/gdal_wrap.cpp: In function ‘void GDALAsyncReaderShadow_GetBuffer(GDALAsyncReaderShadow*, void**)’:     extensions/gdal_wrap.cpp:3905: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:3905: error: expected ‘;’ before ‘hReader’     extensions/gdal_wrap.cpp:3906: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘int GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow*, double)’:     extensions/gdal_wrap.cpp:3915: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:3915: error: expected ‘;’ before ‘hReader’     extensions/gdal_wrap.cpp:3916: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:3920: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:3920: error: ‘GDALARLockBuffer’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘void GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow*)’:     extensions/gdal_wrap.cpp:3923: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:3923: error: expected ‘;’ before ‘hReader’     extensions/gdal_wrap.cpp:3924: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:3928: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:3928: error: ‘GDALARUnlockBuffer’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘GDALAsyncReaderShadow* GDALDatasetShadow_BeginAsyncReader(GDALDatasetShadow*, int, int, int, int, int, char*, void*, int, int, GDALDataType, int, int*, int, int, int, char**)’:     extensions/gdal_wrap.cpp:4095: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:4095: error: expected ‘;’ before ‘hAsyncReader’     extensions/gdal_wrap.cpp:4098: error: ‘hAsyncReader’ was not declared in this scope     extensions/gdal_wrap.cpp:4100: error: ‘GDALAsyncReader’ was not declared in this scope     extensions/gdal_wrap.cpp:4100: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:4100: error: expected ‘;’ before ‘CreateAsyncReaderWrapper’     extensions/gdal_wrap.cpp:4100: error: ‘CreateAsyncReaderWrapper’ cannot be used as a function     extensions/gdal_wrap.cpp: In function ‘void GDALDatasetShadow_EndAsyncReader(GDALDatasetShadow*, GDALAsyncReaderShadow*)’:     extensions/gdal_wrap.cpp:4114: error: ‘GDALAsyncReaderH’ was not declared in this scope     extensions/gdal_wrap.cpp:4114: error: expected ‘;’ before ‘hReader’     extensions/gdal_wrap.cpp:4115: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:4119: error: ‘hReader’ was not declared in this scope     extensions/gdal_wrap.cpp:4119: error: ‘GDALEndAsyncReader’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow*, const char*)’:     extensions/gdal_wrap.cpp:4305: error: ‘GDALSetRasterUnitType’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘int GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, GDALRasterBandShadow*, int (*)(double, const char*, void*), void*, char**)’:     extensions/gdal_wrap.cpp:5010: error: ‘GDALTransformGeolocations’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘GIntBig wrapper_GDALGetCacheMax()’:     extensions/gdal_wrap.cpp:5015: error: ‘GDALGetCacheMax64’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘GIntBig wrapper_GDALGetCacheUsed()’:     extensions/gdal_wrap.cpp:5021: error: ‘GDALGetCacheUsed64’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘void wrapper_GDALSetCacheMax(GIntBig)’:     extensions/gdal_wrap.cpp:5027: error: ‘GDALSetCacheMax64’ was not declared in this scope     extensions/gdal_wrap.cpp:5027: error: return-statement with a value, in function returning 'void'     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFReadL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:5220: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:5220: error: ‘arg4’ was not declared in this scope     extensions/gdal_wrap.cpp:5220: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:5220: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetAuthorizationURL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:5553: error: ‘GOA2GetAuthorizationURL’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetRefreshToken(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:5606: error: ‘GOA2GetRefreshToken’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GOA2GetAccessToken(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:5661: error: ‘GOA2GetAccessToken’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_ReadDirRecursive(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:6081: error: ‘VSIReadDirRecursive’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFOpenL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:6935: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:6935: error: ‘result’ was not declared in this scope     extensions/gdal_wrap.cpp:6956: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:6956: error: expected ‘;’ before ‘VSIFOpenL’     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFCloseL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:6983: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:6983: error: ‘arg1’ was not declared in this scope     extensions/gdal_wrap.cpp:6983: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:6983: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFSeekL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:7013: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:7013: error: ‘arg1’ was not declared in this scope     extensions/gdal_wrap.cpp:7013: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:7013: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFTellL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:7063: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:7063: error: ‘arg1’ was not declared in this scope     extensions/gdal_wrap.cpp:7063: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:7063: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFTruncateL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:7102: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:7102: error: ‘arg1’ was not declared in this scope     extensions/gdal_wrap.cpp:7102: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:7102: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp:7126: error: ‘VSIFTruncateL’ was not declared in this scope     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSIFWriteL(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:7147: error: ‘VSILFILE’ was not declared in this scope     extensions/gdal_wrap.cpp:7147: error: ‘arg5’ was not declared in this scope     extensions/gdal_wrap.cpp:7147: error: expected primary-expression before ‘)’ token     extensions/gdal_wrap.cpp:7147: error: expected ‘;’ before numeric constant     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:7501: warning: deprecated conversion from string constant to ‘char*’     extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_AsyncReader_GetNextUpdatedRegion(PyObject*, PyObject*)’:     extensions/gdal_wrap.cpp:10998: error: ‘GDALAsyncStatusType’ was not declared in this scope     extensions/gdal_wrap.cpp:10998: error: expected ‘;’ before ‘result’     extensions/gdal_wrap.cpp:11019: error: ‘result’ was not declared in this scope     extensions/gdal_wrap.cpp:11019: error: expected ‘;’ before ‘GDALAsyncReaderShadow_GetNextUpdatedRegion’     extensions/gdal_wrap.cpp:11027: error: ‘result’ was not declared in this scope     error: command 'gcc' failed with exit status 1      I've also tried editing setup.cfg to put > gdal_config =/usr/bin/gdal-config near the top, and then running pip install > --no-download GDAL but that failed as well, with the original header file failures: > Installing collected packages: GDAL Running setup.py install for GDAL > building 'osgeo._gdal' extension gcc -pthread -fno-strict-aliasing -O2 -g > -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector > --paeneric -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall > -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protectotune=generic > -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I../../port -I../../gcore -I../../alg > -I../../ogr/ -I/usr/include/pyhonSprawl/lib/python2.7/site- > packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o > build/temp.li.o extensions/gdal_wrap.cpp:2853:22: error: cpl_port.h: No such > file or directory extensions/gdal_wrap.cpp:2854:24: error: cpl_string.h: No > such file or directory extensions/gdal_wrap.cpp:2855:27: error: > cpl_multiproc.h: No such file or directory extensions/gdal_wrap.cpp:2856:22: > error: cpl_http.h: No such file or directory > extensions/gdal_wrap.cpp:2858:18: error: gdal.h: No such file or directory > extensions/gdal_wrap.cpp:2859:23: error: gdal_priv.h: No such file or > directory extensions/gdal_wrap.cpp:2860:22: error: gdal_alg.h: No such file > or directory extensions/gdal_wrap.cpp:2861:24: error: gdalwarper.h: No such > file or directory extensions/gdal_wrap.cpp:4625:22: error: gdalgrid.h: No > such file or directory extensions/gdal_wrap.cpp:2878: error: > ‘CPLErrorHandler’ does not name a type extensions/gdal_wrap.cpp:2881: error: > expected initializer before ‘PythonBindingErrorHandler’ > extensions/gdal_wrap.cpp:2753: warning: ‘swig_module’ defined but not used > error: command 'gcc' failed with exit status 1 Complete output from command > /home/projects/sprawl/pythonSprawl/bin/python2.7 -c "import setuptools; > **file** ='/hild/GDAL/setup.py';exec(compile(open( **file** > ).read().replace('\r\n', '\n'), **file** , 'exec'))" install --record /t.txt > --single-version-externally-managed --install-headers > /home/projects/sprawl/pythonSprawl/include/site/python2.7 running install > > running build > > running build_py > > running build_ext > > building 'osgeo._gdal' extension > > gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 > -fexceptions -fstack-protector --param=ic -D_GNU_SOURCE -fPIC -fwrapv > -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack- > protector --=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I../../port > -I../../gcore -I../../alg -I../../ogr/ > -I/usr/include/pythonprawl/lib/python2.7/site-packages/numpy/core/include > -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux- > extensions/gdal_wrap.cpp:2853:22: error: cpl_port.h: No such file or > directory > > extensions/gdal_wrap.cpp:2854:24: error: cpl_string.h: No such file or > directory > > extensions/gdal_wrap.cpp:2855:27: error: cpl_multiproc.h: No such file or > directory > > extensions/gdal_wrap.cpp:2856:22: error: cpl_http.h: No such file or > directory > > extensions/gdal_wrap.cpp:2858:18: error: gdal.h: No such file or directory > > extensions/gdal_wrap.cpp:2859:23: error: gdal_priv.h: No such file or > directory > > extensions/gdal_wrap.cpp:2860:22: error: gdal_alg.h: No such file or > directory > > extensions/gdal_wrap.cpp:2861:24: error: gdalwarper.h: No such file or > directory > > extensions/gdal_wrap.cpp:4625:22: error: gdalgrid.h: No such file or > directory > > extensions/gdal_wrap.cpp:2878: error: ‘CPLErrorHandler’ does not name a type > > extensions/gdal_wrap.cpp:2881: error: expected initializer before > ‘PythonBindingErrorHandler’ > > extensions/gdal_wrap.cpp:2753: warning: ‘swig_module’ defined but not used > > error: command 'gcc' failed with exit status 1 > > ---------------------------------------- Command > /home/projects/sprawl/pythonSprawl/bin/python2.7 -c "import setuptools; > **file** ='/home/projects/sprawl/pythoompile(open( **file** > ).read().replace('\r\n', '\n'), **file** , 'exec'))" install --record > /tmp/pip-MFmW2k-record/insternally-managed --install-headers > /home/projects/sprawl/pythonSprawl/include/site/python2.7 failed with error > code 1awl/build/GDAL Edit: btw, I think I got my sysadmin to instal gdal-devel successfully:               yum info gdal-devel     Loaded plugins: priorities, refresh-packagekit, rhnplugin, security     This system is receiving updates from RHN Classic or RHN Satellite.     1803 packages excluded due to repository priority protections     Installed Packages     Name        : gdal-devel     Arch        : x86_64     Version     : 1.7.2     Release     : 2.puias6     Size        : 16 M     Repo        : installed     From repo   : PUIAS_6_computational     Summary     : Development Libraries for the GDAL file format library     URL         : http://www.gdal.org/     License     : MIT     Description : The GDAL library provides support to handle multiple GIS file formats.      Can anyone give me advice on how to install the python GDAL package(s) into my virtualenv on RHEL? Edits: explicit outcomes of more things I've tried:               python setup.py build_ext --gdal-config=/usr/bin/gdal-config --include-dirs=/usr/include/gdal --library-dirs=/usr/lib64          building 'osgeo._gdal' extension     gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=gener     ic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune     =generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/gdal -I/usr/include/python2.7 -I/home/projects/sprawl/pythonSprawl/lib/python2.7/site-package     s/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o     extensions/gdal_wrap.cpp:3000: error: ‘VSILFILE’ has not been declared     extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFReadL(void**, int, int, int*)’:     extensions/gdal_wrap.cpp:3035: error: cannot convert ‘int*’ to ‘FILE*’ for argument ‘4’ to ‘size_t VSIFReadL(void*, size_t, size_t, FILE*)’     extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, const char*, void*)’:     extensions/gdal_wrap.cpp:3237: warning: the address of ‘_Py_NoneStruct’ will never be NULL     extensions/gdal_wrap.cpp: In function ‘void PyCPLErrorHandler(CPLErr, int, const char*)’:     extensions/gdal_wrap.cpp:3373: error: ‘CPLGetErrorHandlerUserData’ was not declared in this scope          etc etc (many errors)


title: Alternatives to IPersistVariant in ArcMap add-in's?

text: I have migrated an classic COM ArcMap Extension of mine to an add-in. I have tried the new persistence approach of add-in's but I cannot serialize my custom objects through the XMLSerializer. I get all sorts of COM errors. The custom objects all implement IPersistVariant. And I suspect this interface needs COM registration to work. What would be the most efficient way to get my objects to persist? Or is there a way that I can still use the IPersistVariant interface on my custom objects to persist them in the mxd-document? This is the class of the custom object I am trying to persist:               Imports ESRI.ArcGIS.esriSystem     Imports ESRI.ArcGIS.Geometry          <ComClass(RigPolyline.ClassId, RigPolyline.InterfaceId, RigPolyline.EventsId)> _     Public Class RigPolyline          Implements IPersistVariant          #Region "COM GUIDs"         Public Const ClassId As String = "1572F48A-63B5-4720-AF6A-0B898B549764"         Public Const InterfaceId As String = "13AA4CE9-95A0-43A1-8A92-9BF66B45E226"         Public Const EventsId As String = "2EE2B76B-DC06-4563-8441-9FA0BC584C20"     #End Region               Public m_Name As String = ""     Public m_Polyline As IPolyline     Public m_IsVisible As Boolean     Public m_PolylineID As Integer          Public Sub New()          End Sub          Public Property Name() As String         Get             Return m_Name         End Get         Set(ByVal Value As String)             m_Name = Value         End Set     End Property          Public Property Polyline() As IPolyline         Get             Polyline = m_Polyline         End Get         Set(ByVal Value As IPolyline)             m_Polyline = Value         End Set     End Property          Public Property Visible() As Boolean         Get             Return m_IsVisible         End Get         Set(ByVal Value As Boolean)             m_IsVisible = Value         End Set     End Property          Public Property PolylineID() As Integer         Get             Return m_PolylineID         End Get         Set(ByVal Value As Integer)             m_PolylineID = Value         End Set     End Property          Public Function CreateCopy() As RigPolyline         Dim pPolylineCopy As RigPolyline = New RigPolyline         Dim pPolyline As IPolyline = New Polyline         Dim pClone As IClone              pPolylineCopy.Name = m_Name         pPolylineCopy.Visible = m_IsVisible         pPolylineCopy.PolylineID = m_PolylineID              pClone = m_Polyline         pPolyline = pClone.Clone         pPolylineCopy.Polyline = pPolyline              Return pPolylineCopy          End Function               Public ReadOnly Property ID As ESRI.ArcGIS.esriSystem.UID Implements ESRI.ArcGIS.esriSystem.IPersistVariant.ID         Get             Try                 Dim extUID As New UIDClass()                 extUID.Value = Me.GetType().GUID.ToString("B")                 Return extUID                  Catch ex As Exception                 Dim pErr As New ShowError(ex)                 Return Nothing             End Try         End Get     End Property          Public Sub Load(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Load         Try             m_Name = Stream.Read             m_Polyline = Stream.Read             m_IsVisible = Stream.Read             m_PolylineID = Stream.Read         Catch ex As Exception             Dim pErr As New ShowError(ex)         End Try     End Sub          Public Sub Save(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Save         Try             Stream.Write(m_Name)             Stream.Write(m_Polyline)             Stream.Write(m_IsVisible)             Stream.Write(m_PolylineID)              Catch ex As Exception             Dim pErr As New ShowError(ex)         End Try     End Sub     End Class      The class that inherits from Extension holds the Load en Save methods:               Imports ESRI.ArcGIS.esriSystem     Imports ESRI.ArcGIS.ADF.Serialization     Imports ESRI.ArcGIS.Geometry          Public Class APPExtension     Inherits ESRI.ArcGIS.Desktop.AddIns.Extension          Private Const PersistdataVersion As String = "4.0"     Private mData As MyPersistentData          <Serializable()> _     Private Structure MyPersistentData              Public persistanceVersion As String         Public RigPolyline As Byte()          End Structure          Public Sub New()     End Sub               Protected Overrides Sub OnLoad(ByVal inStrm As System.IO.Stream)              mData.persistanceVersion = ""         mData.RigPolyline = Nothing         PersistenceHelper.Load(Of MyPersistentData)(inStrm, mData)              If mData.persistanceVersion = PersistdataVersion Then             Dim mbs As IMemoryBlobStream = New MemoryBlobStream             Dim mbsv As IMemoryBlobStreamVariant = mbs             mbsv.ImportFromVariant(mData.RigPolyline)                  Dim pStream As IPersistStream = New PropertySet             pStream.Load(mbs)                  Dim pPropSet As IPropertySet = pStream             Dim line As RigPolyline = pPropSet.GetProperty("RigPolyline")         End If          End Sub          Protected Overrides Sub OnSave(ByVal outStrm As System.IO.Stream)              mData = New MyPersistentData         mData.persistanceVersion = "4.0"              Dim line As RigPolyline = New RigPolyline         line.Name = "My line"         line.Polyline = New Polyline         Dim propSet As IPropertySet = New PropertySet         propSet.SetProperty("RigPolyline", line)              Dim ps As IPersistStream = propSet         Dim mbs As IMemoryBlobStream = New MemoryBlobStream         ps.Save(mbs, 0)         Dim bytes As Byte()         Dim mbsv As IMemoryBlobStreamVariant = mbs         mbsv.ExportToVariant(bytes)         mData.RigPolyline = bytes              PersistenceHelper.Save(Of MyPersistentData)(outStrm, mData)          End Sub               End Class


title: How do people celebrate GIS Day?

text: Was looking to hear about interesting or creative ways people are celebrating GIS day. http://www.gisday.com/ There is a map of where some event are happening, but the infowindows are not particularly descriptive: http://www.gisday.com/gis-day-events-map.html I'm considering doing a shot every time arcmap crashes, and/or a 10 kilometer run to honor the shapefile field name character limit. btw...Happy GIS Day!


title: Good Java-Based Raster Libraries

text: Can anyone suggest a good, Java-based raster library? By good, I mean a library that can read common raster formats (ex. tif, img...etc) and save them to other image formats (ex. png). I say Java-based because I am investigating a simple GIS app for Android. I am aware that GDAL would seem like the obvious choice, but it seems like it will difficult to deploy GDAL with an Android application. If anyone knows otherwise, please enlighten me.


title: What is a good taxonomy or naming convention for files and folders containing GIS data?

text: My company has collected about 30 TBs of GIS data over the past 8 years, and I always find myself asking the following questions:   1. What type of data do we have for a given geographic area?   2. What are the details about that data (e.g., resolution in meters per pixel)?   3. Where does the data exist on the hard drive so I can actually use it?   4. Have we processed the data already, or is it in an unaltered form from the source? Up to and including now, I have attempted to address these questions by devising an appropriate folder and file taxonomy/hierarchy. Does anyone have any ideas/suggestions on some understandable, perhaps even standard ways of organizing GIS data using files and folders? I am also open to learning more about how using a database might benefit my company; we are software developers, not GIS experts, so I suspect we're quite a bit behind the curve on how best to approach the problem of storing/organizing GIS data for ease of use. I did see the question Best practices for managing geospatial data but was only able to draw marginal use out of the answers because I am so unfamiliar with geodatabases. **UPDATE:** This last week I spent a fair bit of time reading about GIS databases, and got started familiarizing myself with PostGIS. Long-term, I think we will end up moving towards employment of a database plus metadata server as recommended by JasonBirch in Best practices for managing geospatial data.


title: How to select parcels in ArcPy situated in a different county than is written in the attribute table?

text: I have two polygon feature classes: one with parcels, the other one with counties (40 counties) I have to identify the parcels that in the attribute table belong to county 'X', but spatially they are situated in another county. Manually, it works with Data Reviewer extension in ArcMap: I create a BatchJob with a Geometry on Geometry Check where I write 40 expressions (because I have 40 counties!!!) like this: Feature Class1 = [PARCELS] where COUNTYID = 'X'; Feature Class2 = [COUNTIES] where COUNTYID = 'X'; SPATIAL RELATION: INTERSECT (checking the option 'Find features not in this relationship') --> and the output are the parcels that have COUNTYID = 'X', but spatially ARE NOT in the county 'X'. Is there a way to do this automatically? I thought about creating a list with the values of the COUNTYID field for both feature classes and then iterate through each value and select by location. The problem is that I cannot figure it out automatically the option 'Find features not in this relationship' that DataReviewer has and SelectByLocation does not :( Thanx a lot!


title: Given a Lat and Lon, identify if the point is over land or ocean?

text: In R, what is the quickest way to identify if a point is over land or ocean? e.g. for:               set.seed(0)     lat <- runif(10, -80, 80)     lon <- runif(10, -180, 180)     points <- expand.grid(lat, lon)        * How can I create a column called "Land" of type "logical"


title: Data refusing to line up with basemap after re-setting source for data

text: I've only been using GIS for a couple of months so this is probably just a really n00b problem but I cannot for the life of me fix it. The other day I managed, with a lot of finagling, to create a map out of an Excel spreadsheet I had made with lat/long in DD and a generic basemap. For some reason the data was not lining up with the basemap and I can't remember how I got it to work in the end - mostly a lot of trial and error. Unfortunately I moved the Excel source so when I reopened it later it had the whole red exclamation mark deal next to the data. I re-set the source but now it's refusing to line up and I CANNOT fix it. I've tried everything I can think of, including starting completely over. The dataframe and Excel sheet layer have the same coordinate system and I added the basemap after defining the coordinate system for the dataframe. The data is showing up directly in the center of the Atlantic Ocean (it should spread from the west coast of US through Europe.) Is there something obvious I'm missing? This map isn't that important but it looked so good before and I'm super frustrated. Thanks!!


title: Can GeoWebCache serve tiles from blobstore?

text: Currently I use MapProxy to serve custom sqlite tile stores with a certain schema. I would like to enable GeoWebCache to do the same, but I don't know if GWC work the same way that mapproxy does. MapProxy will serve out all the data in my cache if it exists. Since I have no source for this cache, if there is a missing tile, there is no server to retrieve it and nothing is shown for that tile. I see that GeoWebCache has no native sqlite blobstore and the one github fork that added sqlite as a blob store is no longer available. Since GWC works by pointing it to a map service which it will then tile, will it serve requests for data from the cache even if that source is down? I eventually want to get to the point where GWC is serving out sqlite tiles as it's own service and not reliant on another map service source. Thanks


title: How do i convert STDS file to ASCII DEM?

text: I've downloaded several 7.5 minute DEM files from USGS and they have file names like: 1661629.DEM.SDTS.TAR On MAC these decompress into a folder with serval files having the extension '.DDF'. Is there a shareware program that allows me to convert them to a basic ASCII text DEM file under the Mac OS X operating system?


title: Enabling Geodatabase from ArcMap 10.1

text: I have created a sde schema in my postgresql database , I check all the priviliedges and everything. I also put the st_geometry.so in lib path of postgresql 9.1.3 installed on the server. I have ArcGIS 10.1 When I am trying to "enable geodatabase" from the database in ArcMap 10.1 I am getting theses errors:               relation "sde.sde_layers" does not exist at character 22     STATEMENT:  select count(*) from work.sde.sde_layers          ERROR:  relation "sde.gdb_items" does not exist at character 15     STATEMENT:  select 1 FROM sde.GDB_ITEMS          ERROR:  function st_geometry_version() does not exist at character 8     HINT:  No function matches the given name and argument types. You might need to add explicit type casts.          STATEMENT:  SELECT ST_GEOMETRY_VERSION()::varchar     ERROR:  could not load library "/usr/local/pgsql/lib/st_geometry.so": /usr/local/pgsql/lib/st_geometry.so: undefined symbol: DirectFunctionCall1          STATEMENT:  Create OR Replace FUNCTION public.ST_Geometry_Version() RETURNS text AS 'st_geometry', 'ST_Geometry_Version' LANGUAGE 'C' WITH (ISCACHABLE, ISSTRICT)      I appreciate any help.


title: How to delete multiple fields in an attribute table?

text: Is there a way to select multiple fields in an attribute table and delete them together in Arcmap without writing the script?


title: QGIS, how to change the centre point of a global map?

text: I have two global maps I want to show on one map in Qgis, however they each have different centre points, i.e. in one the atlantic is in the centre, and in the other the pacific is. How do I get them both to show the pacific ocean as the centre point?? They are both on the same coordinate system.


title: Can MaxRecordCount be set for layers within a service in ArcGISServer 10.1?

text: I see a MaxRecordCount property in the REST api for ArcGIS Server map services. But i also see a MaxRecordCount for individual layers within a service at the REST endpoint. I know from experience that these numbers can vary. So the child layers don't seem to be inheriting the value from the parent service. I know there is one place within the AGS manager web application to set the "Maximum Number of Records Returned by Server" value for each map service. and I know there is a setting within ArcMap when publishing the service itself to set the "Maximum Number of Records Returned by Server" value. So my question is how do i set the maximum number of records returned for a layer within a service so that it is different than the max number of records value for other layers within the service?


title: How to find out which Geoserver version is running?

text: Is there a way to find out which version of GeoServer is running from any standard document such as `GetCapabilities`?


title: How to add a road to a network dataset

text: I have a street network file, and I want to add a section of road to it. I start editing on the road network dataset, snapping on, create a new feature line road segment from the edge of the old road to where I want it, click save edits, then stop editing. I then calculate geometry to determine the cost of the road in km, which works fine. When I create a network dataset from this it adds in the junctions in the correct places, however, when I try to solve a route to the end of it there is no connectivity. How do I fix this? Thanks.


title: Getting city GIS data

text: I need some help on how to go about it. I do not have much knowledge about GIS. For a project we need a complete set of city data to perform calculations on. In terms of generating a map of the city, is there a way that I can get the details of the city - i.e. all streets, landmarks, lanes etc. etc. in any format? Once I have these data, then I can insert them into the database and proceed.


title: Script for Editing TIN in Arcgis: modelbuilder works, when exported as script gives an error

text: Arcgis can give such a headache! I want to automate loads of small tasks, and so I need to edit empty TIN with python in order to create a full TIN. My srcript is giving errors, so I tried by hand to make it work with ModelBuilder AND EditTIN IT WORKS FINE!!!! Exported the same Model (that just worked) as python script gives errors!               # Local variables...     raster = "F:\\...\\mClip_1"     raster_InterpolateShape = "F:\\...\\mClip_1_InterpolateShape"     # Process: Edit TIN...     gp.EditTin_3d(raster, "raster_InterpolateShape Shape <None> softline true")      and the error message:                   Traceback (most recent call last):       File "F:\....\test_editTin.py", line 26, in <module>         gp.EditTin_3d(raster, "raster_InterpolateShape Shape <None> softline true")     ExecuteError: Failed to execute. Parameters are not valid.     ERROR 000800: The value is not a member of <None>.     ERROR 000800: The value is not a member of %s.     ERROR 000800: The value is not a member of %s.     ERROR 000800: The value is not a member of %s.     Failed to execute (EditTin).      All extensions and everything is checked since it is exported from model builder. I suppose something wrong is just with first shp input In ArcgisHelp ex for the input 3d shp name it shows the name with extension               ..."masspntz.shp Shape <None> masspoints true"      And so I tried both, with extension and without, but the same errors come. Any ideas, how can I get that TIN from feature automatically.. ???


title: How to read csv with WKT geometry in Arcmap?

text: I have found several parcels I need on a county map viewer. However, the only option to download any of the data is found on a click context menu to "Copy selection as csv" which gives me this:               HGID,ShapeWKT,parcelnumber,locationstreet,owner2,totalassd,parcelid,sec,ownerzip1,ownermailing1,rge,ownerstate,owner1,ownercity,formattedparcel,twp     "13514","POLYGON((825759.0653999997 326186.8526000008,825590.3153999997 326176.4357999992,825572.2887000003 326356.2666999996,825741.2658000002 326367.40330000035,825759.0653999997 326186.8526000008))","1406130003000009000","1470  HIGHWAY M","","9810","10682","13","63902","P O BOX 1021"," 5","MO","RHODES FREDERICK & PATRICIA","POPLAR BLUFF","14-06-13.0-003-000-009.000","24"     "13512","POLYGON((825759.0653999997 326186.8526000008,825770.4408999998 326065.06709999964,825776.7737999997 325997.26920000085,825727.1403000002 325988.53079999983,825720.1957999999 325559.36419999966,825716.0288000003 325041.31090000086,825380.9403999997 325018.1026000008,825384.6557 325291.9681000002,825387.7232999997 325518.09530000016,825390.7329000003 325739.9436000008,825393.6021999997 325951.46199999936,825395.5236999998 326093.1026000008,825399.5045999996 326344.8791000005,825572.2887000003 326356.2666999996,825590.3153999997 326176.4357999992,825759.0653999997 326186.8526000008))","1406130003000010000","M HWY","","10530","10683","13","63901","1563 M HWY"," 5","MO","MORGAN SHERMAN F & MARY I","POPLAR BLUFF","14-06-13.0-003-000-010.000","24"      I pasted this into a text editor, but I am unfamilliar with the file format. It is not a point based csv that could be added to ArcMap using Display XY data. It looks like it may be some type of OGR file like this (http://www.gdal.org/ogr/drv_csv.html). Is there a way to convert the csv file to a format readable in ArcMap rather than using GDAL? It looks like I may be able to creat an associated .vrt file, but I am not sure where I could go from here as far as getting the data into ArcMap. VRT might look something like this something like this:                <OGRVRTDataSource>         <OGRVRTLayer name="test">             <SrcDataSource>parcels.csv</SrcDataSource>             <GeometryType>wkbPoint</GeometryType>             <LayerSRS>WGS84</LayerSRS>             <GeometryField encoding="PointFromColumns" x="Longitude" y="Latitude"/>         </OGRVRTLayer>     </OGRVRTDataSource>


title: What's the strongest refresh method available to ArcEngine?

text: I have five layers: polygon, line, and point with a single IRasterLayer file. I am programmatically setting the ILayer.Visible attribute for the Raster but the layer is not refreshing. If I zoom in, or zoom out, then it refreshes properly. I tried these two methods:               mapControl.Refresh();     mapControl.Refresh(esriViewDrawPhase.esriViewAll, null, null);       But they didn't refresh my map. What method is stronger that this for refreshing the entire map?


title: Split a line having different Angles

text: I want to split a line haveing zigzag(different angles) but bthere are many vertics. I have an option in Arc GIS 10 to split from vertics but i need to split only where the angle or dimension is changed


title: CutFill Analysis in Arcgis10

text: I have point feature with elevation data and area in polygon feature. now what will be next i don't know. pl. can anyone give me process step by step. Thanks


title: How to programmatically identify and rename duplicate records?

text: I'm trying to identify duplicate records from a field and then change these records so they become unique (eg A,B,C, or 1,2,3) and assign this to the end of the text (eg F3241 A56_A or F3241 A56_1). I've tried the scripts that are in this forum but can't get these to work or not sure if they will give me the result I'm after. Any input into to this would be greatly appreciated.


title: How to find a point half way between two other points?

text: I'm working on implementing the OSM Mobile Binary format for map data, and because it uses a 16 bit delta for each point along a way, it cannot represent a way if there is a large distance between two points. The documented solution is to inject new points into the way, to keep the gap smaller. Here's the relevant section of my code:               // calculate the distance between this point and the previous point,     // multiplied by 1,000,000 so it can be represented as an integer.     int32_t realNodeLatDelta = ((point.latitude - lastPoint.latitude) * 1000000);     int32_t realNodeLonDelta = ((point.longitude - lastPoint.longitude) * 1000000);          // cast as a 16 bit int (reduces filesize by about half)     int16_t nodeLatDelta = realNodeLatDiff;     int16_t nodeLonDelta = realNodeLonDiff;          // check if the cast caused corruption     if (realNodeLatDelta != nodeLatDelta || realNodeLatDelta != nodeLatDelta) {       // if this point is reached, we need to add new points in the way,       // which can be represented in a 16 bit delta     }      I'm not sure how to calculate the position of new points along the way? I assume it needs to be a great circle? Points far enough apart to cause this issue are rare, but when they do happen it's usually a political boundary or similar, which tend to be quite long, and need to be accurately represented.


title: Determine the Degree of Data Lossiness when Converting Data

text: I'm working through some of the ESRI tutorials on Data Interoperability and it briefly mentions the issue of data conversion being a lossy process. Some questions that come to mind are:   1. What is being lost?   2. Does the degree of lossiness depend on data type and format?   3. Which conversion combinations are most affected?   4. Is there situations where conversion should be avoided at all costs?   5. What techniques are used to determine the degree of lossiness?  Feel free to add to the list or express any other concerns.


title: ArcGIS 10 sr.lock "LOCK file" how to delete?

text: http://forums.arcgis.com/threads/312-Beta-10-Lock-Files ArcGIS 10: Lock Files According to the above post the only way to delete these sr.lock files is to completely exit all ArcGIS programs. When attempting copy & paste of a recently used shape file (with corresponding mxd closed) this error pops up ![sr lock error](http://i.stack.imgur.com/NX9Go.png) It will paste a portion of the shape files, but not all of them. I have both service packs 1 and 2 installed. Anyone think Esri will have this problem fixed in 10.1?


title: How to read binary rainfall data (*.trm) in ArcGIS for Desktop?

text: I have some *.trm binary data that is merged Tropical Rainfall Measuring Mission (TRMM) rainfall data. I have to read it through ArcGIS for Desktop to extract rainfall data from this.


title: QGIS - Is it possible to Animate Polygons based on column values?

text: If you have an number of polygons with numeric data across 4 attributes/columns, you can display the data for one column but can you automatically cycle through the values for other selected columns? This doesn't necessarily have to be time based animation so the Time Manager doesn't work. It could be spend across different areas of business or profit by Quarter. EG Column names of Quarter 1, Quarter 2, Quarter 3 & Quarter 4 with associated values for each.


title: Line features into polygon features

text: Can any one tell me how to convert line features into polygon features in ArcGIS. I am using ArcGIS 10. I searched the arc toolbox for any tools for this conversion, but I couldn't find any. Please help me regarding this.


title: Split lines at polygon intersection with attributes saving

text: This relates to this question but what about keeping the attributes. ![enter image description here](http://i.stack.imgur.com/ksl9B.png) Having   * line_layer (id, geom, attribute1, attribute2)   * poly_layer (id, geom, attribute3, attribute4) How do I split the lines after polygons and preserve the attributes for each segment? I would also like to take attribute3 from the overlapping polygons but this is only optional. Thank you! My current code is:               SELECT row_number() OVER () AS id, *        FROM ( WITH lines_in_polygons AS (                      SELECT st_intersection(ln.geom, a.geom) AS inter                    FROM line_layer ln,                     polygon_layer a                 ), diff AS (                  SELECT st_difference(ln.geom, st_union(pl.geom)) AS geom                    FROM line_layer ln               JOIN polygon_layer pl ON st_intersects(ln.geom, pl.geom)              GROUP BY ln.geom                 )                  SELECT st_geometryn(d.geom, n.n) AS geom                    FROM diff d              CROSS JOIN ( SELECT generate_series(1, st_numgeometries(diff.geom)) AS n                            FROM diff) n         UNION                  SELECT lines_in_polygons.inter                    FROM lines_in_polygons) coco       WHERE geometrytype(coco.geom) = 'LINESTRING';


title: Creating planes, eg roof surfaces, from LiDAR/DSM data

text: Bit stuck here, Im capturing the area of roof tops of buildings from a DSM (derived from LiDAR data) which has not been much of a problem. I can then also derive angle, hillshade and aspect but it is only per-pixel. What I need to do is create the actual roof planes (either as raster or polygons) and I just don't know how to do it. I've read a lot about cluster analysis, using nearest neighbour etc. I've also read creating a TIN from the raw points, would this work? and if so, would this need to be created instead/before a raster of the DSM? Creating planar surfaces of roofs, just not sure. Thanks


title: Missing a Geom field in PostGis

text: I am working in a Database preaparation for that I exported a shapefile from Qgis to PostGis.The Problem is this: In Qgis I can see a Polygon feature but when the same polygon feature is exported to postgis the particular fields is missing its Geom what is the problem behind it?


title: Migrate from ArcGIS 10.2 GDB to 10.0

text: I need to export data from an ArcGIS 10.2 File Geodatabase (GDB) to an older version, so that users running an older version can access the data. Similarly, I would like to save a .mxd file to an older version, ideally 10 or 10.1. It seems that most people want to go the other direction. Has anyone found a way to do this with access to only a 10.2 license?


title: overlap two GeoTiffs to fill missing information (transparency)

text: I have several hundered geotiff files. Some of them (almost all of them) have black areas (irregular) on the edges. However, these black areas are covered by some other file in the file set. I read this post but it looks that the black in my file is not marked as NODATA (only 3 bands in the VRT file). Is there away to join/overlap two geotiff files (into one) and make the black color as transparent so missing areas are filled from the other file? Thanks.


title: How To Calculate Height of Point B?

text: I have a survey point data which has coordinates X,Y, Height, Angle(Dip),Azimuth, and Depth(Distance). for Example, point A: Easting: 290694 Northing: 715927 Elevation: 1060 Angle: 65° Azimuth:45° Distance:150 Can you please let me know hoe I can calculate the end point(End of trace) Height? Thanks for your time and comments


title: Can QGIS save layer direct to PostGIS?

text: I see that there is no option in the layer->save as menu for saving to a postgis database. There are for both SpatiaLite and SQLite. I am guessing that the interface to PostGIS is significantly more complex than either of the "Lite" options and it has simply never made it to the top of anyone's todo list seeing as there are reasonably straight forward workarounds that can (presumably ?) be automated by scripting. I ask because I am looking for something relatively straight forward to work on as a programming project involving QGIS. I am assuming that I can use the other two as a sort of template along with the shape to Postgres plugin. I am an experienced programmer but a relative novice at GIS stuff.


title: Creating a Simple Join Script in Python

text: I'm trying to create a simple join script in python from an arcgis model, where the only steps are joining a map to a table to produce a map with the table's properties. The attributes joined together are "CNTYFPID" from the shapefile map and "fips" from the textfile. I have tried editing the script produced by arcgis, but it's not working. Where am I going wrong?               # Import arcpy module     import arcpy     arcpy.env.workspace = "C:/Users/Documents/ArcGIS/Testing123.mdb"     arcpy.env.overwriteOutput = True          # Script arguments     Map = arcpy.GetParameterAsText(0)     if Map == 'tl_2009_us_county_albers_USGS.shp' or not Map:         Map = "C:/Users/Documents/ArcGIS/Python/tl_2009_us_county_albers_USGS.shp" #provide a default value if unspecified          Crosswalk = arcpy.GetParameterAsText(1)     if Crosswalk == '#' or not Crosswalk:         Crosswalk = "C:\\Users\\Documents\\ArcGIS\\Testing123.mdb\\cao_fips_crosswalk_for_gis" # provide a default value if unspecified)          # Local variables:     Map = "C:\\Users\\Documents\\ArcGIS\\geography\\tl_2009_us_county\\tl_2009_us_county_albers_USGS.shp"     Final = Map          arcpy.MakeTableView_management(Crosswalk, "fips")          #Process: Join Field     arcpy.AddMessage("Performing Join Field")     arcpy.JoinField_management(Map, "CNTYIDFP", Crosswalk, "fips", "")      The python version I am using is 2.7 and the arcgis version is 10.2. This is what it looks like in modelbuilder > Error message: "Traceback (most recent call last): File > "C:/Users/Documents/ArcGIS/Yo2.py", line 28, in > arcpy.MakeTableView_management(Crosswalk, "fips") File "C:\Program Files > (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 6306, in > MakeTableView raise e ExecuteError: Failed to execute. Parameters are not > valid. ERROR 000732: Input Table: Dataset > C:\Users\Documents\ArcGIS\Testing123.mdb\cao_fips_crosswalk_for_gis does not > exist or is not supported Failed to execute (MakeTableView)."


title: How to add custom widget into Mapguide Maestro 4.0.1?

text: I am developing a Web-Mapping application using **Mapguide Maestro 4.0.1** , in that I need to add a custom widget. Any suggestions for, How and Where to add the custom tools in the Mapguide Maestro. **Is there any documentation for how to add the custom tools?** I am using MapGuide OpenSource 2.2, MapGide Maestro 4.0.1. Thanks in advance..


title: publishing arcgis map services to a different server

text: Is it possible to publish a map service to a server different to the one where ArcGIS Server was installed? If so, how can this be done? Thanks!


title: How can I create random points along a polyline in QGIS?

text: I am trying to create random points along a polyline shapefile in QGIS. Basically, like the 'random points' tool in 'research tools' but for polylines instead of polygons. I have tried converting the line file to a polygon shapefile, but it fills in some areas with polygons, whereas other areas remain long line-type polygons. I am pretty new to QGIS, and am not really familiar with Python code. Thanks


title: How to efficiently find points within an elliptical area?

text: Using PostGIS 2.0.0 I need to filter the results of a function, which returns many POINTs, to find the ones that lie within an elliptical area defined by two points and a distance (all parameters passed into the query). A filter using ST_Distance does the trick, but I wonder if there's any way to speed it up? Simplified query:               SELECT candidate_point     FROM my_function(some, params)     WHERE         ST_Distance(candidate_point, 'SRID=4326;POINT(1 2)'::geography) +         ST_Distance(candidate_point, 'SRID=4326;POINT(3 4)'::geography) <= 60000      I tried using ST_DWithin as an additional filter, but that slows it down tenfold! Because candidate_point comes from a function, not a table, there is no index to use. Perhaps there is still something that can make it faster?


title: How to identify a selected graphic element(s) in python

text: I have a situation where I am inserting items from Excel into maps a lot. When I insert the items it always makes them a fixed width and then adjusts height to maintain aspect ratio. What I would like to do is paste the object, then click my tool. THis would prompt me for a number of units the item should be, and the tool would then resize it appropriately. I am able to get to a list of graphic elements ( narrowed down to photo elements even) using               arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT")      But, I'm not sure how to identify which one/ones are selected in order to start manipulating it/them.


title: Edit multiple tables with the same structure at the same time?

text: does anyone know how to edit multiple tables at the same time? I have multiple .tab files and I want to change the order of the fields. Is there any way to do this for all of them at once. They all have identical table structures. I have both MapInfo and QGIS available to use. Thanks, Alan


title: Color depending on attribute

text: I'm trying to set the color of a vectorlayer feature depending on the feature attributes with PyQGIS. How do you acces the attributes of a vectorlayer feature?


title: How do I control rendering order of items in composer?

text: Alternative formulation of the question is: Is there any other way apart from the order of adding items to the canvas of setting the rendering order> The problem is that I want to change the map which was added first and the legend overlays the map so when I delete and replace the map the legend is underneath it.


title: Unable to show tiff "parameters"

text: Why this raster (tiff) does not have any values? Why I am unable to perform:               doubleclick -> onechannel pseudocolor -> clafify      Both rasters are downloaded from the same site: www.globalforestwatch.org from their "data page" respectively. **Working** (from picture below) http://commondatastorage.googleapis.com/earthenginepartners- hansen/GFC2013/Hansen_GFC2013_lossyear_50N_130W.tif **Not-working** (from picture below) http://commondatastorage.googleapis.com/earthenginepartners- hansen/GFC2013/Hansen_GFC2013_lossyear_60N_140W.tif What is the _difference_ in these tiff's? **I am using Qgis 2.2 on Ubuntu.** ![enter image description here](http://i.stack.imgur.com/wqKRD.png)


title: Connecting uDig with Sql server 2008

text: I tried to connect uDig with Sql server 2008 but could not do it the following error poped that it missed imageio ext and jdbc driver for sql server. I added it to jre/ext/lib (both of them). Now the error is not present but when I click next and click finish there is no change.What is the Error in here? ![enter image description here](http://i.stack.imgur.com/xmFjt.png)


title: How to sort a column in attribute table programmatically

text: Is there any way to sort ( alphabetically ) a column in the attribute table programmatically (without clicking on the column header) in QGIS ?


title: How to Calculate the Maximum Distance Between Features?

text: I'd like to calculate the _maximum_ distance between polyline features. I have a base polyline with many other polylines either touching or near the base polyline as shown in the picture. The distance I would like to calculate is from the base feature (red) to the other features (blue). Because I'm looking for maximum distance, it would be the perpendicular distance from the "peaks" of the blue polylines to the red polyline. ![Calculate Max Distance](http://i.stack.imgur.com/vIoR6.jpg) I'm using FME for this process and I can't seem to find anything that calculates _maximum_ distances. I thought about chopping the blue lines to points using the "Chopper" transformer and calculating the distance to the base feature and then grouping by some ID and finding the maximum within that grouping. Then, possibly, put that value back into an attribute of the unchopped line. However, I'm not really sure how to do all that. Am I on the right track? Can anyone advise of another method? Or how I can implement my method? Thanks.


title: Problem with Mapnik and custom XML-File

text: I'm right now working with navteq data and building 'the XML-File' to generate the tiles! I started with an all original osm.xml, and set all the status' to "off". First I checked the dataset in my database with SRID(the_geom) and got a return "SRID:4326". So I set up the layer to SRID4326 instead of SRID900913.               <Layer name="myLayer" status="on" srs="+init=epsg:4326">      My pgSQL query was written according to the OSM query:               (select the_geom, 'true' as "water", polygon_nm as "name"           from waterseg ) as myLayer      The next step was to setup the stylesheet. I did that - set the max and min zoom level to the maxima. So the zoomlevels should influence the rendering. But it's not working. I can't see a single stroke on the image. I just get an empty picture. I tried to look through the file and see if there is any problem with a potential z-level - don't think so. Next was to check the bounds - no matter if I set bounds as 900913 or 4326 the image is still the same. I assume strongly, that I have somewhere a problem with the projections. Can anyone help me? Has anyone ever tried to render a full map from scratch, without the predefined stylesheet! Thanks


title: create convex hull polygons / cluster for sets of N points in a point dataset

text: I have 50k points in a feature class which I need to build convex hull or polygon for each set of 50 points that are nearby each other. I guess the question is very similar to create census areas for each 200 households. I've tried all tools in ArcGIS Desktop 10.1 but none of them does what I'm after. I also tried some other third-party tools which allows me to create convex hull based on K-means algorithm - means I can specify the number of convex hulls to be generated but still can't see how to create convex hulls for a specified number of points. I'm open to any solutions not just limited to ArcGIS, but the final result need to be imported back to ArcGIS. Any advise would be appreciated! Thanks.


title: How to prevent running part of a model when iterator is used?

text: My process is to run Buffer on two feature layers, intersect the buffers and then Clip intersected buffers with polygon object from Iterate Feature Selection iterator. Here's my model: ![Model with iterator](http://i.stack.imgur.com/0c9TQ.png)   The model runs Buffers and Intersect firstly, then iterate and create Single Object, and lastly Clip features. But in the next iteration it again runs Buffers and Intersect, what is not needed.   Is it possible to prevent running Buffers and Intersect in each iteration?   In other words, how to create Intersected buffers only once and then reuse it in each iteration?   * * * EDIT:   Following blah's suggestion I managed to create desirable model. I enclose it, because it's slightly different than web-help example: ![enter image description here](http://i.stack.imgur.com/pTbTG.png)


title: OpenLayers 2.12 + KML from String + Change markers'icons

text: Reading this post How to add KML data but from variable - not from url? I changed the way of reading KML files (from HTTP to a string loaded using jQuery)               /**      * The OpenLayers object      * @type {OpenLayers.Projection}      * @var      */     var geographic = new OpenLayers.Projection('EPSG:4326');          /**      * The OpenLayers object      * @type {OpenLayers.Projection}      * @var      */     var mercator = new OpenLayers.Projection('EPSG:900913');          ****     success: function(data) {         if (data != '') {             var format = new OpenLayers.Format.KML({                 'internalProjection': mercator, //EPSG:3785/900913                 'externalProjection': geographic, //EPSG:4326                 extractStyles: true,                 extractAttributes: true             });             sFeatures = format.read(data);         }     }      I would like to use the icons that come from the KML string, but when I click on a feature I would like to increase the size of the icon or even change it. My Layer definition:               var hydrographsLayerVector = new OpenLayers.Layer.Vector('hydrographs', {         //renderers: renderer,         styleMap: new OpenLayers.StyleMap({             "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({                 externalGraphic: "http://openlayers.org/dev/img/marker-green.png",                 graphicOpacity: 1,                 rotation: -45,                 pointRadius: 10             }, OpenLayers.Feature.Vector.style["default"])),             "select": new OpenLayers.Style({                 externalGraphic: "http://openlayers.org/dev/img/marker-blue.png"             })         })     });      If I remove the lines extractStyles and extractAttributes = true I see the effect using the styleMap defined in the new OpenLayers.Layer.Vector('hydrographs'*. How can I use the styleMap:"select": if I use extractStyles and extractAttributes = true? Ideally, I would like to increase the size of the feature onmouseover and if the user clicks on it I want to keep the bigger size until the "unFeatureUnSelected". Thanks!


title: Change printer for a specific map document from Arcpy

text: Is it possible to change the printer for a particular map document from ArcPy? The mxd is saved with the default printer settings, and I know with the PrintMap() function one can specify the printer to use. In my case, I do not want to print the map, just change the printer.


title: QGIS python - identify and highlight features programatically

text: In QGIS there is an option to select features of a selected layer using a "identify feature" tool. Then the feature get highlighted in a different color and attribute dialog is poping up. like that i want to highlight the multiple features programatically. Ex: scenario i have a set of vector layers which consists of number of roads as features. I need to select few roads by looking at its attributes and highlight. is there any way of achieving this using python code? appreciate your help


title: How to uninstall standalone QGIS & reinstall in OSgeo4w on Win7?

text: I need to apply a patch to QGis but installed as standalone instead of OSGeo4w: foolish. I'd like to uninstall then reinstall via OSGeo4w so as to have linux-like updating support, but before I do so, can anyone advise me whether my maps & WMS info will be saved, or if there's anything one specifically needs to do to avoid extra headaches/work during this process? Many thanks in advance.


title: How to generalize SpatialPolygons and conserving topology in R?

text: I would like to generalize a `SpatialPolygonsDataFrame` in R to make plotting more efficient. The polygons I have result in huge pdf plots that are slow to load and hard to integrate into a document. I tried to use the `gSimplify` function from the `rgeos` package, but unfortunately it does not conserve the topology of the polygons. Is there an alternative that I can use? thanks


title: How to stop writeOGR from abbreviating Field Names when using "ESRI Shapefile" driver

text: I'm currently using the following script to add some attribute data from a table to lots of individual shapefiles:               library(rgdal)     specieslist <- read.csv("SpeciesList1.txt", header=F)     attdata <- read.table("TestAtt.csv", sep = ",", header=T)     for (n in 1:dim(specieslist)[1])      {     speciesname <- specieslist[n,1]     shp <- readOGR("Mesoamerica_modified_polygons", speciesname)     shp$ENGL_NAME<-attdata[n,2]     writeOGR(shp, "PolygonsV2", speciesname, driver="ESRI Shapefile")     }      I get the following warning(s) at the end:               1: In writeOGR(shp, "PolygonsV2", speciesname, driver = "ESRI Shapefile") :     Field names abbreviated for ESRI Shapefile driver      When viewing the attribute table of the shapefiles after this process, the Field name has been shortened to 'ENGL_', but I want it to stay as 'ENGL_NAME'. Is there a way to turn this abbreviating off? Any help much appreciated.


title: How to find isolated geometry/attributes in road network?

text: I have a road network with paved/unpaved status in attribute table. This road network don't must contain isolated paved geometry. There are any solutions find isolated geometry in GIS software (ArcGIS/QGIS or other)? ![enter image description here](http://i.stack.imgur.com/jsPY2.jpg)


title: Flash more than one feature in arcmap using C#

text: How to flash many features at same time in ArcMap using C# coding? Currently I call this function in a loop,               private void FlashFeature(IActiveView _activeView, IFeature _feature)     {         IActiveView activeView = _activeView;         IFeatureIdentifyObj featIdentify = new FeatureIdentifyObject();         featIdentify.Feature = _feature;         IIdentifyObj identify = featIdentify as IIdentifyObj;         identify.Flash(activeView.ScreenDisplay);     }      but unfortunately it flashes one feature at a time, and while flashing is happening it holds the process. As a result of that it flashes around 2 features in a second, instead of them all at once. I also want to flash thous features without changing my curent feature selection in map, if posable. The default ArcMap Find tool(form or whatever it is) can do it, and i'm trying to find a way to implement that in my tool.


title: How to customize ArcGIS Silverlight API 2.4 legend?

text: I am using Esri's ArcGIS Silverlight API 2.4 and below is my legend. My map has one feature layer and one dynamic service layer with nested layers like below               Feature Layer A     Group Layer     Group A     Layer A1     Layer A2     Layer A3     Group B     Group B1     Layer B1     Layer B2     Group B2     Layer B2     .....      'Feature Layer A' is the same as 'Layer A1' and I want to bring this 'Feature Layer A' to position of Layer A1. But this layer should be remain as feature layer only. How can I do this? i.e feature layer inside the dynamic service layer group?


title: Define "geospatial data" for a non-GIS professional

text: I realize this is a sort of a subjective question, but I've seen other subjective questions on the site, so I thought it I'd put it out there. A colleague recently had a request for "geospatial data" with a grant that they were submitting, and were confused by exactly what was being asked for. My explanation was that they were asking for any GIS data related to the project area. My explanation seemed to work, but I wanted to put it to the community at large for a more defined definition. How would you define "geospatial data" to a non-GIS professional?


title: Can't Select and Export from Python Script

text: I am a novice in python programming but I am trying to learn by doing. I got stuck with this function a while back and can't seem to find a solution or a workaround. I am writing a script that is trying to select all data in an MXD within a 70m distance from a layer and then export that data to a newly created file geodatabase. I can´t seem to get this to work, all I get is the error:               FDO error: -2147024894 [GDB_Items]          The table was not found. [Output name]      And I somehow manage to get some kind of output, in the form of empty geodatabase tables in the output file geodatabase with the “correct” output names. I have a suspicion that the problem lies in the feature layers origins. They reside deep in our file tree (for exampel G:\KONSULTUPPDRAG VMN\SAMRÅD\2012\Uppsala\C 55 Örsundsbro - Kvarnbo\Kartor\Grundkartor\Fastighetskartan.gdb\vo) there is nothing I can do about it unfortunately. Here is my code:               import arcpy, os, re     from unicodedata import normalize          Skapa_mapp = (unicode ("C:\\Users\dabr\\Desktop\KMZtest\\", 'UTF-8'))     Mxd_Natur = arcpy.mapping.MapDocument((unicode ("C:\\Users\\dabr\\Desktop\\KMZ test\\YAYYY_Test1.mxd", 'UTF-8')))     Vag = "c 801"          def Select_and_Export (Mxd_Natur, Skapa_mapp, Vag):         Db = Skapa_mapp +"KMZ\\KMZ_Databas.gdb\\"                        #Define the output DB          for df in arcpy.mapping.ListDataFrames(Mxd_Natur):                  #Find the road from whitch the selection is made with.          for lyr in arcpy.mapping.ListLayers(Mxd_Natur, "", df):             if lyr.name.lower() == unicode (Vag, 'UTF-8'):                 Utgangslager = lyr          for df in arcpy.mapping.ListDataFrames(Mxd_Natur):                           for lyr in arcpy.mapping.ListLayers(Mxd_Natur, "", df):         #Loop trough all the layers in the MXD to make                                                                          #a selection and exprt if annything got selected             Sokvag = lyr.workspacePath                                  #Get the path to the specific layer             SokvagNamn = lyr.datasetName                                #Get the name of the specific layer             File_path = Sokvag + "\\" + SokvagNamn                      #Combine to create full path             print File_path                  if not Sokvag.endswith(".gdb"):                             #layers in mxd can be both from GDB and .shp                 File_path = File_path + ".shp"                  Namn = lyr.name.lower()                                     #                 Namn = re.sub('[ ]', '_', Namn)                             #create a output name bades on the layer name              Namn = normalize('NFKD', Namn).encode('ascii', 'ignore')    #in the mxd                       if arcpy.Exists("TEMP"):                                    #if temporary file exis´ts from previous run, remove it                 arcpy.Delete_management("TEMP")                 print "temp removed"                       arcpy.management.MakeFeatureLayer(File_path,"TEMP")         #Recreata a empty templayer             arcpy.SelectLayerByLocation_management("TEMP", "WITHIN_A_DISTANCE", Utgangslager, "70 Meters", "NEW_SELECTION") #populate the templayer whit selected objekts?             out = os.path.join(Db, Namn)                                #Create a path to the output location                  print str(arcpy.GetCount_management("TEMP").getOutput(0))+" Selected from " + Namn      #Show number of selected objekts.                  if int(arcpy.GetCount_management("TEMP").getOutput(0)) > 0: #check if anny objects were selected. if not dont export                 try:                          if "TEMP".endswith(".shp"):                         #test if the temporary layer is based on a shp file?                         print Namn + " skall shp kopieras"                         arcpy.CopyFeatures_management("TEMP", out.rstrip(".shp"))        #Coppy selected objekts to FDB                         print Namn + " shp kopierad"                     else:                         print Namn + " skall koppiers"                         arcpy.CopyFeatures_management("TEMP", out)      #Coppy selected objekts to FDB                         print Namn + " är kopierad"                      except:                    print arcpy.GetMessages()                       else:                 print lyr.name.lower() + " no objekts were selected"      Does anyone see a solution to my problem or perhaps a workaround? Edit: After some tweaking I stumbled upon the problem and solution. I was using a File GDB as an output in the CopyFeatures_management function. I don’t know why but if I changed it to a personal GDB everything went fine. Can anyone explain why?


title: Has anyone discovered any compatibility issues between ArcGIS 10 clients editing older ArcSDE geodatabases (e.g 9.3.x)?

text: I’ve read the ESRI documentation here: http://goo.gl/UUSM (link to ESRI) and http://goo.gl/TsmV (link to ESRI) , so I know the documentation states that you can. And I’ve actually edited data (a very small amount) in a 9.3 ArcSDE with no problems. For those who are actually producing & maintaining on their versioned 9.3 geodatabases with ArcGIS 10 clients, have you experienced any issues? Or has it been a relatively smooth experience (i.e works as advertised)?


title: How do I make lines look "continues" (images inside)?

text: > **Possible Duplicate:**   >  How can I merge segmented roads into one line? A TAB file in MapInfo looks like this : ![enter image description here](http://i.stack.imgur.com/kCKoP.png) but when I import it to QGIS (and convert to shp) it looks like this : ![enter image description here](http://i.stack.imgur.com/pHFPo.png) How can I make the QGIS layer look like the MapInfo layer (I don't know the term of this functionality)


title: How to perform a spatial join of point and polygon layers in PostGIS?

text: I have a point dataset representing households that I want to associate with a parcel layer (i.e. assign its parcel_id). With ArcMap, I could spatially join the polygons to the points and specify that the join have a certain search radius and use the nearest polygon. I wish to perform this with postgres and was wondering what the most prudent way of doing this was. I can't use ST_contains because points fall on streets and not on actual parcels. In stead of ST_contains, is there another function allowing for proximity checks?               update households h set parcel_id = p.parcel_id      from parcels p where ST_contains(p.the_geom, h.xy);


title: How to choose pixel values according to each land cover class?

text: I would like to do following steps using two types of images (precpitation and Land cover image):   1. select pixel values of precipitation image within each land cover classes   2. calculate total amount of precipitation of each land cover classes Could you please tell me the tools I use and the steps I need to follow in ArcGIS, ENVI, or ERDAS.


title: How to get the two nearest points between two polygons

text: I'm trying to draw the nearest line between the nearest polygons in a Polygon dataset (ESRI Shapefile). I know that for this purpose there is the Near Tool (ArcGIS), but it just return the point TO which to connect but not the point FROM the first polygon and I don't want the centroid. So I tried to do my own implementation and surprisingly it is running faster than Near Tool (at least for my huge data), and it is performing this way:   1. Get a cursor and loop through all polygons   2. For each polygon in cursor get another cursor2 from polygons which are in certain range from the extents   3. Then it just calculate distances using built-in functions and get the closest one   4. I can get the two closest points looping through all point in the polygons and use distance functions Am I doing it the best way? I tried using QgsSpatialIndex but it is returning the wrong pairs for some reason. Is there any built-in function to return the two closest points directly? FWY I'm using arcpy, but previously I was using pyqgis.


title: Imagery on March 6, 2014 @ Lat 42dd55'22" N, Long 079dd37'36" W

text: I am looking for any advice where to find imagery on March 6, 2014 (or a few days following) for: ![location](http://i.stack.imgur.com/wjqT4.jpg) I have searched the USGS, ImageHunter, and Digital Globe with no luck. Does anyone have a resource where I can find imagery for Dunnville Ontario on March 6, 2014? * * * There was a fire on this day and I am looking for before/after imagery. See this article by the hamilton spectator about the fire. Dunnville ‘in shock’ over Rosa Flora fire


title: query CartoDB private tables with the api-key show error 503

text: I'm doing a test map with two tables, one with polygons and the other with points. I create a layer with two sublayers (polygons and points). The user selects a state and the query is updated showing the selected state and the points contained therein. I have a code that works with public tables, but when I try to use the api-key (as seem on here) I get an **Error 503 backend read error** when the query updates This is my code for createLayer:                  cartodb.createLayer(map, {         user_name:user,         type: 'cartodb',         sublayers:[subLayer0Options, subLayer1Options],         options: {           table_name: point_table,           user_name: user,           extra_params: {             map_key: key           }         }       })       .done(function(layer) {         layer.options.extra_params.map_key = key;         layer.addTo(map);         layer.setInteraction(true);         updateMap(layer);       })      The updateMap() function:                function updateMap(layer){         layer.setInteraction(true)              // change the query for the sublayer(0) == polygons         var myquery0= "SELECT b.* FROM usa_states b, point_table s WHERE b.state = '"+state+"' AND st_intersects(b.the_geom_webmercator, s.the_geom_webmercator)"         var subLayer0Options = {           sql: myquery0,           cartocss: "#usa_states {polygon-fill: #0f3b82;}"         }         var states = layer.getSubLayer(0)         states.set(subLayer0Options);         //states.setInteraction(false);                    // change query of the sublayer(1) == points         var myquery1= "SELECT s.* FROM usa_states b, points_table s WHERE b.state = '"+state +"' AND st_intersects(b.the_geom_webmercator, s.the_geom_webmercator)"              var subLayer1Options = {           sql: myquery1,           cartocss: "#point_table{marker-fill: #FFCC00;}",           interactivity: 'cartodb_id, column1, column2, column3',           infowindow: true          }         var points = layer.getSubLayer(1)         points.set(subLayer1Options);         points.setInteraction(true)         points.infowindow.set('template', $('#infowindow_template').html());         //cdb.vis.Vis.addInfowindow(map, points, ['cartodb_id, column1, column2, column3'])              var sql = new cartodb.SQL({ user: user, api_key: key});         sql.getBounds(myquery1).done(function(bounds) {             map.fitBounds(bounds)         });       })     };      Use the apikey on the client is only for local testing, I read something about how the maps with private tables now **must** use "template maps". Edit: I'm trying to do a template.json file but I don't know how to put two sublayers in the layergroup:               "layergroup": {        // see https://github.com/CartoDB/Windshaft/wiki/MapConfig-specification        "version": "1.0.1",        // Array of layers defined in render order        "layers": [{           "type": "cartodb",          "options": {            "cartocss_version": "2.1.1",             "cartocss": "#layer { polygon-fill: <%= color %>; }",            "sql": "SELECT s.* FROM usa_states b, points_table s WHERE b.state = <%= state %> AND st_intersects(b.the_geom_webmercator, s.the_geom_webmercator)",            "affected_tables": [ "usa_states", "points_table" ],            "interactivity": [ "cartodb_id", "field1", "field2", "field3", "field4"]          }        }]      }


title: How to select more than one feature using values?

text: What should I do if I want to select more than one feature using values ? For selecting a single feature, I enter an expression like this which works:               "LINK" = 28      Assume `LINK` as a field in the above example. Now what if I want to select more fields like that. I expect something like this:               "LINK" = [28, 56]      The above expression doesn't work (obviously). Is there a way to achieve this in Quantum GIS ?


title: Is there a way to constrain an FME.exe to certain amount of RAM?

text: If I have FME Desktop running on a workstation with a large amount of RAM (e.g. 128 GB), is there a way to constrain an FME.exe process to a certain amount of RAM (e.g. 48GB)? This question is inspired by my closely related question:   Is there an optimum RAM configuration to use for FME Desktop?


title: Why can't I edit attribute table imported through 'text as layer'

text: I imported the coordinates from an Excel table. They show as single points as intended. Now I want to add columns to the attribute table, but I'm not able to edit it. I wanted to import the following columns from Excel as well, but that doesn't seem to work either. Sorry for the noob-question, but I couldn't find anything relating the theme through google and such. Ok, with pictures then: I want to use that to add columns with information to these ![enter image description here](http://i.stack.imgur.com/hGuri.jpg) ![enter image description here](http://i.stack.imgur.com/NMvJx.jpg) You see, the small pensil thingy is greyed out, so I can't edit anything in this layer and I can't add any information to my points. If I try Ale suggestion I get this error: ![enter image description here](http://i.stack.imgur.com/R1PoM.jpg)


title: How to add points to LAS copy using liblas?

text: I am trying to make a copy of a LAS file while inserting new points using python liblas module. The code below creates the copy and adds the points, but for some reason the added points are not in the correct location. Also, it seems that x, y, z values are being stored int instead of float values. Can anyone explain why I am having this problem? Thanks in advance for your help.               import liblas     from liblas import file as lasfile          las_file = r"path here"     out_las = r"path here"          # Read las file     f = lasfile.File(las_file, mode='r')     h = f.header          # Open file to write to, using original header     fout = lasfile.File(out_las, mode='w', header=h)          counter = 0     for p in f:         if counter != 0:             # Code to Interpolate             # x, y, z for new point             # from existing points             vD = (new_x, new_y, new_z)             # vD is tuple of floats             new_pt = liblas.point.Point()          # Create Point object             new_pt.x = vD[0]                       # Set x property             new_pt.y = vD[1]                       # Set y property             new_pt.z = vD[2]                       # Set z property             fout.write(new_pt)                     # Write new_pt to fout         # Write p to fout, retaining original properties         fout.write(p)         counter += 1     fout.close()


title: Is there an optimum RAM configuration to use for FME Desktop?

text: I have a couple of workstations with 32GB RAM where fme.exe processes often exceed 25GB, if its available. And I'm looking to possibly add a 3rd workstation. I noticed in an FME2014 beta build some performance degredation for fme.exe processes using large amounts of memory. Log file had tons of `ResourceManager: Optimizing Memory Usage. Please wait...` statements, so I think it was spending more time **optimizing** memory than it was using it. But I'm not in a position where I can test a newer betas and different releases at the moment. Do production releases of FME Desktop work best on a certain RAM configuration (or is there an optimum range). Would FME benefit from 128GB of RAM? Or would there be issues? I'm intentionally leaving versions out of this question because I'm interested in any experience with FME Desktop with a RAM configuration higher than mine. _FWIW, it's really cool that I get to ask a question about a software that can use 25GB._


title: False easting/westing with MGI/Austria M28

text: After extracting the XY coordinates from geometry data via "save as csv" I get coordinates which are about 150 km more in the west than they should be. North/south seems right. I set the CRS to MGI/Austria M28. Any suggestions?


title: Help interpreting open text file

text: I have an existing Arcpy script written by others that I need help interpreting. The script reads records from a feature class and loops through and writes them to a log file. Here is the section I need help with: Hope this conforms.               if r_count <= 0:             print str(r_count) + " No IDs Found"                  # Open a log text file for reading             ef = open(ERRORFILEname2, 'rb')             # Create a text/plain message             msg_body = MIMEText(ef.read())             ef.close()      Question: what does the 'rb' represent in the open statement? Thanks for the support!


title: Creating Buffer from field in Attribute table

text: I have a shapefile in ArcMap with about 30 polygons and want create an inside buffer, using a different value for the distance of each buffer on each polygon. I was wondering if there was a way to use a field in the attribute table of that shapefile to created an inside buffer, and if there is a way, how would I specify the units for that field in the attribute table. Thanks!


title: Exporting classnames using Monteverdi

text: i managed to get my rgb-Image classified with Monteverdi. I discribed 8 classes with different classnames. For my work i dont need the rgb-values, i just need the classnames. Is there any way to export my classification result as vector file? Or can i save the information about the classname? I was just able to export my classification result as tif-file. So my input file contains 3-Band rgb values and my exported file has the same as well, just different values. Iam open for all suggestions. Thanks. Update: I am still not able to export my resulting classes. All i get is a 3-band rgb images regardless whether i choose *.img or *.tif. How can i do that?


title: Leaflet WMTS layer

text: I would like to start using Leaflet instead of OpenLayers, but I can't find a way to load WMTS layer into the map. Is that possible with Leaflet, or do I have to stick with OL? I haven't found anything related to this topic.


title: What are duck egg patterns in weighted moving average spatial interpolation method?

text: I'm dealing with spatial interpolation methods, in particular with the weighted moving average. I come across really oft with a term "duck egg patterns" which are caused by isolated data points. Does any one has an idea what do they mean. What do duck eggs look alike? (not different as any other egg.....).


title: Where can I find a Unesco World Heritage List as boundaries?

text: I was wondering if anyone knows where to find the UNESCO world heritage list with boundaries? I can extract point data from the json feed for the map on the website http://whc.unesco.org/en/list via http://whc.unesco.org/?cid=31&l=en&mode=json but polygon or polyline data would be much more preferable. Edit: I was particularly interested in Australia, but it would be good to know where to go to find this sort of info worldwide, so if you have other countries, feel free to post them up as well.


title: Breaklines in QGIS interpolation plugin

text: How can I prepare data to generate a DTM using points and breaklines, but where every breakline has nodes at different heights. For example, a river valley, which regularly falls, or a dorsal line, where each vertex is a different height. Thanks for the answer. Tom


title: Spatial distance analysis in QGIS

text: I'm quite new to QGIS and trying to figure out how to analyze the following problem. I have three layers:   1. settlements _point_ layer with 253 entries    2. waste treatment facilities _point_ layer with 24 entries   3. roads _polyline_ layer My problem is to find the distance between each settlement from layer (1) to each treatment facility in layer (2), however it has to be subjected to roads (layer 3), namely instead of getting aerial distance matrix I am looking for to the matrix that describes the actual driving distance. I'm kindly asking your help with suggestion of how to perform this analysis with QGIS 1.7 (note that I don't know how to use PostGIS layers, if relevant)   * what plugin can or should I use?   * Should the polylines be connected to the points in both layers?


title: Why does Transverse Mercator projection have scale factor?

text: Why does the Transverse Mercator projection have a scale factor in ArcGIS and the standard Mercator projection not? In other words what is the difference between these two projections beside being a horizontal respectively vertical cylinder?


title: How to draw 3d objects from .kml file on gwt-openlayers map?

text: I tried to run gwt-openlayers KML example on my PC but failed to see KML layer. I set `protocolOptions.setUrl("http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/kml/lines.kml");` instead of `protocolOptions.setUrl("lines.kml");` without any success. I also tried               Vector kmlLayer = new Vector("KML");     VectorFeature[] kmlFeatures = kml.read("lines.kml");     kmlLayer.addFeatures(kmlFeatures);      but I'm in doubt does `read()` method take file name as argument. Probably I have to provide KML string to `read()`am I right? Is there any working example with ready KML file with 3d objects inside? How modify showcase example in order to use local files? I guess `HTTPProtocolOptions.setUrl()` method in the example relevant only for remote, non-local .kml files.


title: How to get only one biggest point in polygon?

text: I have polygon and point feature classes. Every polygon have 2 points inside them. For output I need only one point with highest value. I need incorporate this step in ModelBuilder. I had idea about iterator, but I'm not sure about this since it might have problems with bigger feature classes and older hardware. So I'm looking a way around it. ![enter image description here](http://i.stack.imgur.com/YsV8Y.png)


title: avoid using the same road twice

text: I am currently developing an application to create tours for motorbikes. At the current stage of development there is a start/endpoint and several points which outline the tour. Between these points the pgr_dijkstra function is used (with a customized cost function). The problem is best described by the picture attached. ![Problem](http://i.stack.imgur.com/OlEKX.png) Is there a way to avoid an edge getting traveled twice? I have tried to use the reverse cost column with a high cost but as the graph is not directed I get odd results. At least the pgrouting documentation states that the graph has to be directed to use the reverse cost if I understood that correctly. Any help would be much appreciated and thanks in advance.               <-- language: lang-sql -->     sql := 'SELECT DISTINCT ON (seq)              seq, id, the_geom, id1 AS node, id2 AS edge, cost, km                  FROM pgr_dijkstra(''                      SELECT id,                      source::integer,                      target::integer,                      my_cost::double precision AS cost,                          FROM network                           WHERE network.the_geom && bbox                 '',' || source || ',' || target || ', false, false),                  network WHERE id2 = network.id';      Sorry I forgot about the code. This is the statement to create a part of the route. It is nested inside a loop which passes new source and target in every iteration as long as there are some. This code is executed and returned record-wise.


title: Styling/Selecting based on a hstore column in TileMill?

text: I have added an OpenStreetMap dump file to PostGIS using osm2pgsql --hstore (and the default osm2pgsql style file). I have added and opened up this to TileMill. Is there anyway to style the map based on the values in the hstore column (`tags`) in TileMill using only CartoCSS? Or do I have to change the subquery on the layer to 'extract' the hstore column to make it look like a real column? e.g. pretend I want style based on the OSM `wifi` tag, which is a key in the hstore `tags` column. In SQL I could select it with: `select * from planet_osm_point where tags->'wifi' = 'yes';`. If `wifi` was a real column, then I could style it in CartoCSS with:               #mylayerid[wifi='yes'] { … }      What would I put in to select based on the `tags` column?               #mylayerid[?????] { … }      I would like to use TileMill as a server to demo using OSM, and allow people to style based on esoteric/edge cases. These are not very technical people, so I'd like to have it as easy as possible.


title: What does coordinate system WG 21° mean?

text: I have a land survey document for a piece of land, it contains absolute coordinates that I would like to locate on google maps, but I don't know how to correctly interpret the data. ![Coords](http://i.stack.imgur.com/qci76.png) What does the "System: WG 21°" mean and how do I convert these coordinates to decimal notation for google maps? The land is located in South Africa. My Attempt: I considered that the constants were somehow the baseline values, and tried adding the constants to each coordinate value, but the result doesn't match decimal notation. In any case, in South Africa, the latitude is negative and the longitude is positive. Both latitude and longitude are positive in this case, which makes me think that they're not latitudes or longitudes at all, but rather the result of a more complicated transform. The transform is probably indicated by the WG21 (hence the question), which is where I am currently stuck.


title: Data Driven Pages - Page Number with Count

text: I hope this isn't a duplicate question, I have had a look but couldn't find an answer. I have a set of 100 data driven pages showing different roads. I would like to export the map book by road. E.g. one road will be one pdf, another road will be exported to another pdf. The issue I have is with the page numbering. I have set each page to have a dynamic page number with count. At the moment, when I export _Road A_ , the page numbers show 'Page 1 of 100', 'Page 2 of 100' etc. I want _Road A_ to have 'Page 1 of 5', 'Page 2 of 5', etc. then _Road B_ will have 'Page 1 of 2', 'Page 2 of 2'. I hope that makes sense! I can't seem to work out how to do this, I'm sure I have done it before, but my terrible memory has failed me! If anyone can offer any advice I would greatly appreciate it.


title: How to convert lat long to meters using Mercator projection in C#

text: I have set of lat long values and I want their equivalent in meters using Mercator projection in C#. Can you please post some sample code or api example of some library that does exactly this?


title: Converting point sets to polygon boundaries

text: I'm trying to convert sets of points to their respective polygon boundaries. I think this is something like a Voronoi diagram or Convex Hull, but not quite. I'm sure there's a technical term for it, but I'm a beginner to GIS. It's probably best illustrated with the following image: ![enter image description here](http://i.stack.imgur.com/lXx7K.jpg) So, given 4 sets of points (each set in its own colour), what are the four polygons surrounding each respective set of points such that the spacing between polygons maximizes the margins and all the polygons meet together? Here's a simplified example with 3 points:   * A,43.656943,-79.393928,blue   * B,43.66663,-79.402682,green   * C,43.656447,-79.408004,green You'll have to view the following graphic for it to make sense: ![enter image description here](http://i.imgur.com/SCFED.jpg) Essentially, each point has a colour and you expand a buffer of a certain distance out from it to start. The hard part is when there's a collision with other points (their boundaries) and where to compute that boundary. The result is a set of polygons (one for each colour/set). Thanks!


title: Do Data Driven Pages enable PDF merging without losing layers?

text: I'm setting up a mapbook with layered PDFs, what I have is the first map showing the extent of the grid (an overview map) with the rest of the maps showing each grid. It has been annoying to set up an overview map on the same data driven mxd, it would be much easier to export it as a seperate pdf and then merge it with the rest of the mapbook, but this loses layered pdf. Anyway, so I have the extent and the rest of the mapbook set up - however I have a couple of issues still. I don't know how to set the symbology between the extent map and the grid maps (i.e road label with a font of 200 is huge on my grid maps). Another issue is the scale bar is tiny for the extent map and huge for the grid maps - I need it to fit both scale types. Another issue is if I put in annotations for the extent map to get around labelling - I won't be able to hide it in the grid maps. Also I am unable to hide grids for the extent map (they are too small and I don't want to show them). So ultimately it is an issue of having the same labelling for two map types with different scales on the same mxd - if I could somehow merge the PDFs without losing the layered pdf function I could do this much easier.