texts:
I cobbled together a code where I can print the features as a popup and wanted to make the objects on and off

var baseMaps = {
  "Wikimedia-Map": Wikimedia,
  "GrayCanvas-Map": Esri_WorldGrayCanvas,
  "Neighbourhood": Thunderforest_Neighbourhood,
  "WaterColor-Map": Stamen_Watercolor
};

var controlLayers = L.control.layers(baseMaps).addTo(map);

for (var i = 0; i < markers.length; i++) {
   var geojsonLayer = L.marker( [markers[i].lat, markers[i].lng] )
      .bindPopup('' + markers[i].name + ''+
                    '
Adresse: ' + markers[i].adresse +
                        '
Ort: ' + markers[i].ort +
                            '
Telefon: ' + markers[i].telefonnum +
                                '
E-Mail: ' + markers[i].email +
                                    '
Kategorie: ' + markers[i].kategorie +
                                        '
Art: ' + markers[i].art +
                                            '
Bemerkung: ' + markers[i].bemerkung)

     .addTo(map);

    controlLayers.addOverlay(geojsonLayer, 'all');
}

With this code, I found that this code outputs every single object as a clickable field (see screenshot)

Does anyone have any idea what code would be necessary to bring the objects together to a selectable group?


texts: Get dynamically value of a column using plpgsql

texts:
I create a function that returns the value of a field when the id is given :

CREATE OR REPLACE FUNCTION get_dcteam(id int) RETURNS text
AS $$
#print_strict_params on
DECLARE
dc_team text;
BEGIN
    SELECT monitoring_table.dc_team INTO STRICT dc_team
        FROM monitoring_table WHERE monitoring_table.id = get_dcteam.id;
    RETURN dc_team;
END
$$ LANGUAGE plpgsql;

I call it this way :

select * from get_dcteam((select id from monitoring_table where id=30))

What I want to do is call the function  dynamically. I don't want to precise a known id.
How can I do this?


texts: Trying to update the temporal extent description field with Python

texts:
I am able to call out and update the temporal extent begin and end dates, but the Description field is also required in ArcCatalog for metadata creation. In my script, I am trying to define it as:

temporal_extent_description = metadata.temporal_extent_description
metadata.temporal_extent_description = "2012-2016"

When I run my script, I do not get any error, and from the Python module in ArcMap, I can call out the field that I inputted by:

print (metadata.temporal_extent_description)

But, if I open the metadata page in ArcCatalog, the box is blank and red indicating that I have not satisfied the required element.

Code that is being submitted in ArcMap:

import arcpy_metadata as md
metadata = md.MetadataEditor(path to fc)

title = metadata.title
metadata.title = "There are many variations of passages"

purpose = metadata.purpose
metadata.purpose = "There are many variations of passages..."

abstract = metadata.abstract
metadata.abstract = "There are many variations of passages..."

#TEMPORAL EXTENT DESCRIPTION
temporal_extent_description = metadata.temporal_extent_description
metadata.temporal_extent_description = "2012-2016"

temporal_extent_start = metadata.temporal_extent_start
metadata.temporal_extent_start = "20100101"

temporal_extent_end = metadata.temporal_extent_end
metadata.temporal_extent_end = "20140101"

metadata.rm_gp_history()
metadata.finish(True)

Code that's being called upon in the arcpy_metadata library:

"temporal_extent_description": {
        "path": "dataIdInfo/dataExt/tempDesc",
        "type": "string"},


texts: How are housenumbers and streets linked in a OSM based PostGIS DB?

texts:
I'm trying to understand how OSM is linking housenumbers and streets with each other. I downloaded an osm file for germany and imported it into a PostGIS DB.
To understand how the linking is working I just took a street with a housenumber and exported it as xml from osm.org.
I opened the xml file and saw the entry for the housenumber and the street and it looked like this:

<way id="141827749" user="MichaH" uid="8464" visible="true" version="1" changeset="10149457" timestamp="2011-12-18T18:41:33Z">
 <nd ref="1005720791"/>
 <nd ref="1552517039"/>
 <nd ref="1552517025"/>
 <nd ref="1005720152"/>
 <nd ref="1005720791"/>
 <tag k="addr:city" v="Frankfurt"/>
 <tag k="addr:housenumber" v="16"/>
 <tag k="addr:postcode" v="60326"/>
 <tag k="addr:street" v="Wörsdorfer Straße"/>
 <tag k="building" v="yes"/>
</way>

Obviously I took the id=141827749 and found one entry in planet_osm_ways.
Result:

id        | nodes                                                    | tags
141827749 | {1005720791,1552517039,1552517025,1005720152,1005720791} | {building,yes,addr:housenumber,16}

So I got the housenumber. But where is the street name? When I search the tags for the street name i get 3 entries pointing to other nodes. The correct entry for it is as I know (because its a residential area):

id      | nodes                                                                                | tags
6235469 | {52082395,1552517028,1552516972,1552516886,1552516856,1552516836,1552516769,1552516705,1552516652,1552516571,52082405} | {oneway,yes,name,"Wörsdorfer Straße",highway,residential}

But where is the link between all this? Does anybody know? I didnt find any info on the OSM wiki pages.

Thanks in advance.


texts: How to get elevation from dted only USGEO format using gdal apps

texts: I need to get hieght by lat long position using gdal utilities


texts: Plot shapefile with islands with matplotlib

texts:
I am trying to plot a city shapefile with matplotlib's plt.plot()-function. However, within the closed areas I occasionally have small "islands" which lie within the city but not part of it. Therefore I have a solid line connecting one part to "island" as can be seen in the red area:

Any idea how I can prevent this from happening?

Update:

The points for the coloured area looks like this: https://textuploader.com/1kv27
(full shape-data can be downloaded here: https://www.suche-postleitzahl.org/download_files/public/plz-gebiete.shp.zip)

and is plotted with

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.gca()
x = [i[0] for i in points][:]
y = [i[1] for i in points][:]
ax.plot(x, y, 'k')

I do face the same problem when I want to plot a state which has islands, the islands will be connected to the mainland with a line.


texts:
I have small portion of data from that I have to create ArcGISTiledMapServiceLayer and I want to cache only that portion of the map where data is present rather than caching for the entire earth surface of blank tiles.

There are some basemaps that show data is not present in area on the tile map.

What is the technique behind that?

I am using ArcGIS 10.1 for Server.


texts:
Using the same data, I ran ZTV's in ArcMap 9.2 desktop & QGGIS (using the viewshed plugin & r.viewshed) to compare them.

The ArcMap viewshed is different (more detailed/nuanced) to the QGIS/GRASS ones which were pretty similar.

Any ideas why, & which is more correct/better modelled?


texts: Creating a Layer Group in GeoServer with Python

texts:
I am trying to create a Layer Group in Python using the Request module, but I am getting an HTTP 406 (Not Acceptable) error.

Can someone tell me what's wrong with my code?

import requests

layerGroupURL = 'http://localhost:8080/geoserver/rest/workspaces/OS_OpenData/layergroups'

auth = ('admin', '******')

layerGroupXML = '''
                <layerGroup>
                    <name>Road_Group</name>
                    <mode>SINGLE</mode>
                    <title>Road_Group</title>
                    <workspace>
                        <name>OS_OpenData</name>
                    </workspace>
                    <publishables>
                        <published type="layer">
                        <name>OS_OpenData:oro_roadlink_201910</name>
                        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/OS_OpenData/layers/oro_roadlink_201910.xml" type="application/xml"/>
                    </published>
                        <published type="layer">
                        <name>OS_OpenData:oro_roadnode_201910</name>
                        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/OS_OpenData/layers/oro_roadnode_201910.xml" type="application/xml"/>
                        </published>
                    </publishables>
                    <styles>
                        <style>
                            <name>oro_RoadLink-1</name>
                            <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/oro_RoadLink-1.xml" type="application/xml"/>
                            </style>
                        <style>
                            <name>oro_RoadNode</name>
                            <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/oro_RoadNode.xml" type="application/xml"/>
                        </style>
                    </styles>
                    <bounds>
                        <minx>-118397.00155160861</minx>
                        <maxx>751441.7791101651</maxx>
                        <miny>-15982.135610342928</miny>
                        <maxy>1272149.3463547546</maxy>
                        <crs class="projected">EPSG:27700</crs>
                    </bounds>
                    <attribution>
                        <logoWidth>0</logoWidth>
                        <logoHeight>0</logoHeight>
                    </attribution>
                </layerGroup>
            '''
headers = {'Content-type': 'text/xml', 'Accept': 'text/xml'}

layerGroupRequestPost = requests.post(url=layerGroupURL, auth=auth, data=layerGroupXML, headers=headers)

print(layerGroupRequestPost.status_code)


texts: Refreshing QGIS layers panel after update in python

texts:
How can I refresh the Layers Panel in QGIS through python?

In my code I have loop and within line to update visibility of some layer in the legend:

self.iface.legendInterface().setLayerVisible( layer, True )

At the beginning I thought it should do that that automatically. But it doesn't. Very interesting thing for me is that if I have open Python Console and print something after that line the Layers Panel gets updated. If the Python Console is closed nothing happens.

My intention is to build plugin witch loop through layers in selected group and for every layer turns it on (the rest in group turn off) and export composer. The whole problem is that after switching visibility of layers the Layers Panel won't update automatically and so also the composer is not updated and gets exported without any change in the layers visibility. Just accidentally I have found out that if I open Python Console and with every loop print out something not only Python Console gets updated but for some reason also Layers Panel and so Composer and so the export works as needed. But I feel it would be stupid to say if you want my plugin to work correctly you need to open python console... There must be some trigger or something to force Layers Panel to update. What is it? :)


texts:
I received a dataset containing some "XY" coordinates that are supposed to correspond to some locations in natural reserves/national parks in Costa Rica. I'm trying to use the proj4 package in R to try to convert these coordinates to lat/long (using the project(..., inverse = TRUE) command), but I cannot figure out which projection was used to get the XY coordinates, so I cannot invert the projection to get the lat/long.
How can I guess which projection/coordinate system was used?
A few points:
  X,       Y
193087, 1056379
193587, 1056917
211524, 1032512
213201, 1032612


texts: Conditional calculation using raster calculator in QGIS

texts:
I have two rasters with the same extent, resolution, and projection, let's say raster A & B.
What I want to do is something like this:

IF A = 3 OR A = 11 THEN A+B
ELSE B

How can I do such a thing with a raster calculator?


texts: Protecting QField layer from feature deletions

texts:
I have a polygon layer that will be shared with other users. I do not want anyone to be able to delete or modify the polygon shape. I do need them to be able to edit other feature attributes.

Is it possible to do this in QGIS?

The layer will be used in the QField app.


texts: Calculate distance between X/Y coordinates by individual in R

texts:
In R, I'd like to calculate the straight-line distance between each capture of an animal in my dataset - no need to take into account the curvature of the earth.  I have a dataset that looks like this:

record.nbr<- c(1:8)
individual<-  c(1,2,1,2,1,3,1,2)
x<-c(167685,167945,167685,153985,167685,158675,167645,167667)
y<-c(9876548,9879248,9876838,9596548,9926548,9878578,9876548,9166548)
julian.date<-c(125,126,127,127,128,129,130,130)
captures<-data.frame(cbind(record.nbr, individual, x, y, julian.date))

Here each "individual" represents a unique animal, and x/y points represent locations where the animals were captured.  x/y points are UTM coordinates. Some individuals are caught many times, while other individuals are only captured once.

I'd like to calculate the distance (and the mean date) between recaptures by individual.  In the output table, each row would summarize the distance between consecutive recaptures of an individual, plus the mean date between recaptures, like so:

individual first.rec  second.rec  distance  mean.date
1          1             3        V         126
1          3             5        W         127.5
1          5             7        X         129
2          2             4        Y         126.5
3          4             6        Z         128


texts:
My solution for backing up geoserver is to copy all directories in Tomcat to another disk.

Does a better solution exist for backing up geoserver configuration?

My data is stored in PostGres, if that is relevant.

Backup will be used for recovery settings geoserver.


texts: How to deliver an additional Python Library with own Plugin?

texts:
For my own plugin I need a special library (pyexiv2) to write a comment into a jpg file (PIL does not do that).
When I want to share my plugin in one of the repositories in the future, what would be a clever or right way to deliver this additional python library, so that my own plugin will work for other people?

Thanks, Micha


texts: Bathymetry dataset of Italy with 3 arc-seconds resolution or better

texts:
I am looking for a dataset of bathymetry data of Italy. I shall use it in an application for collision avoidance of vessels coming into the port.

I need to know how deep the sea bottom is at each point, and that's why data should be as precise and graded as possible. So I am considering only data with greater resolution than 3 arc-seconds.

Can someone help me to find open source or not too expensive data within these constraints?


texts: Changing unknown coordinate system of raster data to known coordinate system?

texts: I have a set of raster datasets and have created a raster catalog out of them. These datasets should cover specific vector data. I have just realised that the raster as tif data have a coordinate system based on the efw file but it is not clear for me what is the coordinate system. I have to cover a vector data which has the coordinate of 4647 (EPSG) . I have tried to change it arc catalog based on the guidance from ESRI ( http://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/defining-or-modifying-a-raster-coordinate-system.htm) but it still place in a same position and practically there is no change. How it is possible to do it ?


texts: Creating distance isochrones along road network in QGIS?

texts: I am trying to create isochrones which illustrate all routes along the road network within defined distances of a location i.e. 500m, 1km and 1.5km. I would  like to avoid using radii because it isn't a true reflection of where a person could actually walk / cycle as it includes gardens and shows an as-the-crow-flies distance.


texts: HDPI / Retina vector layers in OpenLayers 3

texts:
I'm rendering some vector features on top of HDPI tiles. The tiles are crystal clear on my HDPI monitor but the vector features are blurry:

Is there a way to make the vector layer "retina" as well?


texts: How to build buffers for each polygon, which requires the buffer area approximately equal the polygon area in Google Earth Engine?

texts: I want to build buffers for each irregular polygon in featurecollections in Google Earth Engine. The buffer area is required to approximately equal the polygon area. I am very new to GEE.


texts: import grass.script as grass under windows 7

texts:
OS: Windows 7 64bit

GIS: QGIS 1.8  (qgis.org/downloads/QGIS-OSGeo4W-1.8.0-2-Setup.exe)

I have created a plugin for QGIS, with the QGIS plugin builder.
Now i would like to import grass.script into this script

# Import the PyQt and QGIS libraries
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *

# Initialize Qt resources from file resources.py
import resources_rc

# Import the code for the dialog
from testdialog import testDialog

# Import grass.script
import os, sys
import grass.script as grass

If i run this Script then i get the following error:
ImportError: No module named grass.script

The whole Error massage is:
    Couldn't load plugin test due an error when calling its classFactory() method

Traceback (most recent call last):
  File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 164, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/admin/.qgis//python/plugins\test\__init__.py", line 52, in classFactory
    from test import test
  File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 309, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/admin/.qgis//python/plugins\test\test.py", line 31, in
    import grass.script as grass
  File "C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 309, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named grass.script

Python version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.8.0-Lisboa Lisboa, f440b60

Python path: ['C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/admin/.qgis//python', 'C:/Users/admin/.qgis//python/plugins', 'C:/PROGRA~2/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\bin\\python27.zip', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\DLLs', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\qgis\\bin', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~2\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']

How could i fix this problem? How could i "import grass.script as grass" into my script ?

regards Marcus

---------------------  update ---------------------

Now, i have add the following path variable:

GISBASE=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2
LD_LIBRARY_PATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\lib

PATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc;
C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc\python;
C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\bin;
C:\Program Files (x86)\Quantum GIS Lisboa\apps\msys\bin;
C:\Program Files (x86)\Quantum GIS Lisboa\apps\Python27;

PYTHONLIB=C:\Program Files (x86)\Quantum GIS Lisboa\apps\Python27
PYTHONPATH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\grass\grass-6.4.3RC2\etc\python
GRASS_SH=C:\Program Files (x86)\Quantum GIS Lisboa\apps\msys\bin\sh.exe

Now i have an other error. But i create a new question for this.

Thx for helping


texts: QGIS 2.0.1 Runtime error and crash at Add Delimited Text Layer plugin

texts:
I just installed Dufour on my Windows 7 Lenovo ThinkCentre desktop. When I open 2.0.1 I get this error window:

And when I try to add the 'Add Delimited Text Layer' plugin I get this message:

When I click 'OK' the program closes.

Any help is greatly appreciated - thanks.


texts: Single WMS pgRouting Layer from Array of Lat Longs

texts:
I am using the following loop for displaying the a bus route. 'stopLonLat' is a JavaScript object with all the latitude and longitude values of various bus stops. Since I am not looking for shortest path between origin and destination, I consider each bus stops, find route between them and draw the route in the loop.

     var startLon,startLat,destLon,destLat,viewparams,params;

        for(var i=0;i<stopLonLat.length-1;i=i+1) {

                 startLon= 'x1:' + stopLonLat[i].Longitude;
                 startLat= 'y1:' + stopLonLat[i].Latitude;

                 destLon='x2:' + stopLonLat[i+1].Longitude;
                 destLat='y2:' + stopLonLat[i+1].Latitude;
                 viewparams = [
                  startLon,startLat,
                  destLon,destLat
                ];
                params = {
                      LAYERS: 'pgrouting:pgrouting2',
                      FORMAT: 'image/png',
                      viewparams:viewparams.join(';')
                };
                //params.viewparams = viewparams.join(';');
                routeLayer = new ol.layer.Tile({
                  source: new ol.source.TileWMS({
                    url: 'http://localhost:8080/geoserver/pgrouting/wms',
                    params: params
                  })
                });

                me.getOMap().addLayer(routeLayer);
        }

Now there are two problems I am facing.

Since there will be a lot of number of bus stops in a route of 200km to 700 km, there will be that much 'routeLayer' will be created. Which makes map rendering extensively slow.
I cannot remove the layer 'routeLayer'

I don't know whether the procedure I'm following is correct.


texts: ImportError: DLL load failed when running a script tool in ArcGIS Pro

texts:
I created a multiprocessing script that runs perfectly when running in an IDE (Spyder) but is giving me errors when running through the script tool in ArcGIS Pro.

Here is the traceback:

Running script Script...
Failed script Script...
Traceback (most recent call last):
  File "C:\<user>\ArcGIS\Projects\K_L1\K_L1.tbx#ScriptTool_KL1.py", line 6, in <module>
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\__init__.py", line 21, in <module>
    import numpy
  File "C:\<user>\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone13\Lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\<user>\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone13\Lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.
Failed to execute (ScriptTool).

The IDE was downloaded directly from Pro, and works fine. I have searched on google, but nothing popped up that was related to using ArcGIS Pro, only running in IDEs.


texts: How do I import the qgis module installed by QGIS into other Python Environments?

texts:
I have a QGIS install and a Miniconda install. I want to use the qgis module installed by QGIS in my other python installation, but I get this error:

>>> import qgis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\QGIS 2.18\apps\qgis\python\qgis\__init__.py", line 26, in <module>
from qgis.PyQt import QtCore
  File "C:\Program Files\QGIS 2.18\apps\qgis\python\qgis\PyQt\QtCore.py", line 30, in <module>
    from PyQt4.QtCore import *
ImportError: DLL load failed: The specified module could not be found.

I have a Python 2.7.5 (same version as QGIS) environment set up, and I am using a bat file in the activate.d directory to set PYTHONPATH and PATH variables on environment activation as per this doc: https://conda.io/docs/using/envs.html#windows

I'm setting PYTHONPATH based on the results of sys.path when run through the python console within QGIS, and doing set PATH=C:\Program Files\QGIS 2.18\apps\qgis\bin;%PATH% which is the path to the qgis_core.dll.

This is the python path:

>>> for i in sys.path:
...     print i
...

C:\Users\me
C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing
C:\Program Files\QGIS 2.18\apps\qgis\python
C:\Users\me\.qgis2\python
C:\Users\me\.qgis2\python\plugins
C:\Program Files\QGIS 2.18\apps\qgis\python\plugins
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
C:\Program Files\QGIS 2.18\bin\python27.zip
C:\Program Files\QGIS 2.18\apps\Python27\DLLs
C:\Program Files\QGIS 2.18\apps\Python27\lib
C:\Program Files\QGIS 2.18\apps\Python27\lib\plat-win
C:\Program Files\QGIS 2.18\apps\Python27\lib\lib-tk
C:\Program Files\QGIS 2.18\bin
C:\Program Files\QGIS 2.18\apps\Python27
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\PIL
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\win32
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\win32\lib
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\Pythonwin
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\Program Files\QGIS 2.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:\ProgramData\Miniconda3\envs\qgis2\python27.zip
C:\ProgramData\Miniconda3\envs\qgis2\DLLs
C:\ProgramData\Miniconda3\envs\qgis2\lib
C:\ProgramData\Miniconda3\envs\qgis2\lib\plat-win
C:\ProgramData\Miniconda3\envs\qgis2\lib\lib-tk
C:\ProgramData\Miniconda3\envs\qgis2
C:\ProgramData\Miniconda3\envs\qgis2\lib\site-packages
C:\ProgramData\Miniconda3\envs\qgis2\lib\site-packages\setuptools-27.2.0-py2.7.egg

My PyQt4 directory only has a directory called uic in it and no other files. Is my install somehow incomplete and is that what is causing this problem?


texts: What are the options for generating images from OSM data without importing it to PostgreSQL

texts:
While I'm waiting for my first try of an osm2pgsql import to succeed I am wondering if what I'm doing is really necessary.

The goal is to periodically produce some .png maps from a slightly filtered version of the OSM data provided by Geofabrik. After filtering the full planet file is around 20G.

I don't need these maps to be generated in real-time and wouldn't mind if the maps take 30 minutes or 1 hour to generate.

Is it reasonable to try to generate these maps directly from the
osm.pbf file?
I was thinking of using openstreetmap-carto
with some small changes to style the maps. Is there any similar project that doesn't require PostgreSQL? Would I need to fork the project and change it to support file data?


texts: Increase logging level in qwc-services (QGIS)

texts:
I am testing QGIS's qwc-services docker container stack deployment.
I have cloned the 'qwc-docker' github repo, modified the docker-compose.yml to create only the fundamental services needed to implement a basic WMS server.
'Docker-compose up' goes successful and the deployment works OK with the available qwc-demo QGIS project.
Next step is to serve a QGIS project of my own, created with QGIS desktop 3.16.
This step is giving me some issues, therefore I would like to trace the code to understand what is going on.
Therefore  I need to increase the logging level for any  (or all) qwc services running in the containers, but I haven't found how this is done.
Looking in code, I think all services use a Flask logger, but I haven't found how it is configured.
Is there a env variable, or config file, or anything to set the log level of qwc-services?


texts:
For a project I'm working with QGIS, I have multiple raster layers with interesting points and features.

My final goal for the project is to give a person who is not familiar with GIS but who would like to see those interesting points and features easy access to this data. My idea was to use bookmarks, so people can select a point they would like to see and the program selects automatically the right zoom and place. It works kind of what I expected but when I select a bookmark with the wrong layer it just zooms to the right place but it doesn't change the layer.

Is there a option or plugin that I could use for this problem or do I have to make this by myself.


texts: Is setting the env.workspace var necessary for python add-in buttons in ArcMap?

texts:
I made a custom add-in for ArcMap (10.2 in my case) and was reviewing my code with a colleague. We're not sure if the setting the workspace is required in the code since the button's script is only going to be run in ArcMap where all the connections and features exist. It certainly works with the workspace set, but is it required to include it? What would be the best practice?

Code sample:

   ...
   def onClick(self):
    # set workspace to SDE connection
    workspace = r"Database Connections\facilities@5160_93.sde"

    # set the fields to the ones being flipped
    fields = (["FROMLEFTP", "TORIGHTP", "TOLEFTP", "FROMRIGHTP",
               "FROMLEFTA", "TORIGHTA", "TOLEFTA", "FROMRIGHTA",])
   ...


texts: select two markers & draw line between them in leaflet

texts:
I am very much new to leaflet.

I have multiple markers plotted on my map in leaflet.

now I have to draw line between two markers when I select them.

Can any one help in doing this.


texts: client-side geometry in Esri Web AppBuilder

texts: I have two csv files one contains lon/lat for a set of points, and the other one contains the links between those points (each row represents a link by the Object ID of the origin and destination of the link). Using ArcGIS JavaScript API 4.2 and D3 (used d3 to read csv) I was able to create two FeatureLayers and add them to the map. Now I want implement the same concept in ArcGIS Web AppBuilder, but I couldn't figure which of the files I should modify to include client-side geometry.


texts:
I have a .jpg map of a set of U.S. counties that were affected by a tornado.  The map shades where the tornado passed through, resulting in some counties only partially experiencing the tornado.

I would like to calculate the share of each county's boundary that was exposed to the tornado.  Naturally, this is straight forward for the counties that were either entirely exposed or not at all exposed.  However, I am not sure what to do for those that were partially exposed.

I came across this thread: How to convert image of map into vector format?

I cannot understand it, however.  For starters, does Paint count as an image editor.  Second, what's the deal with GRASS?  Is that the best way to go?  Is that in lieu of ArcGIS 10.1?

In any event, I do have access to ArcMap in ArcGIS 10.1.  I am trying to follow the link: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t000000mq000000
However, I am very lost starting around step 6.  I do not know if I'm adding the .jpg correctly or assigning the points correctly.

I am just extremely lost.  In the end, I would like an excel spreadsheet of the share of each county exposed to the tornado.  Thank you for any help!!

To put the calculation that I'd like to do into context, here's an exmaple state-level map:
http://www.marc.org/emergency/images/tornado_risk_map.jpg
In this example, suppose I'd like to estimate the share of each county (or state) within the red.


texts: MMQGIS Plugin not working with QGIS 2.6.1? (Resolved)

texts:
QGIS 2.6.1 on Windows
Have done a bit of research on this and I think it may be caused by the recent update in version to QGIS 2.6 (it worked in 2.4).
I am trying to perform an attribute join from csv using the mmqgis plugin but I get the following error.

  Traceback (most recent call last):
    File "C:/Users/ben.glover/.qgis2/python/plugins\mmqgis\mmqgis_dialogs.py", line 278, in run
      joinattribute, outfilename, notfoundname, 1)
    File "C:/Users/ben.glover/.qgis2/python/plugins\mmqgis\mmqgis_library.py", line 900, in mmqgis_attribute_join
      if row[join_index].strip().lower() == key:
  IndexError: list index out of range

Can anyone confirm that this is caused by the update in version- maybe someone can give it a try?


texts: How to edit the layers defined when initializing a Editor?

texts:
I am having some problems with editing the Editor object. We have multiple layers that are editable by the user, and the user can enable and disable layers. When a layer is disable/enabled the Editor object should be modified or removed+created to make sure the layers are visible in the toolbar.

We have this method for creating the editor, but how could I modify the layers inside the editor (or templatepicker), when the object is allready initialized..

            this.addToolbar = function(map, id, layers, featureLayers) {
                if (dijit.byId(id)) {
                    //TODO Update existing editor if layers changed
                } else {
                    var settings = {
                        map: map,
                        layerInfos: featureLayers,
                        createOptions: {

                            polylineDrawTools: [Editor.CREATE_TOOL_FREEHAND_POLYLINE],
                            polygonDrawTools: [Editor.CREATE_TOOL_FREEHAND_POLYGON,
                                Editor.CREATE_TOOL_CIRCLE,
                                Editor.CREATE_TOOL_TRIANGLE,
                                Editor.CREATE_TOOL_RECTANGLE
                            ]
                        },

                        toolbarVisible: false,
                        toolbarOptions: {
                            reshapeVisible: true
                        }
                    };
                    var params = {
                        settings: settings
                    };
                    var myEditor = new Editor(params, id);
                    myEditor.startup();
                }
            }

So i could store the value of myEditor, but what variable do I change, and how do I make sure it updates the html?
Any ideas?

Update:
This is not the way to go, when i destroy a editor, the elements that are already drawn with it are not editable anymore. I will just show and hide the editors with some plain js.


texts: Leaflet markers at same geo location (ClusterGroup)

texts:
I have a map created with leaflet with different markers. Sometimes the markers have the same (1:1) geo position.

I have already tested the great addon clustergroup, but I need the function to be able to spiderfy/open multiple groups. Unfortunately it is apparently not possible to open multiple clustergroups with the addon at the same time so my question is whether there is another way to display markers if they are on exactly the same position.


texts: CRS problem: not recognizing the CRS of shapefiles to be the same for all

texts:
I'm attempting to aggregate (average) the attributes a point layer to polygon attributes (i.e. block groups and counties) via a spatial join. Both the points and polygons are in the same projection - I've tried both NAD 83 and WGS84. After filling out the "join attributes by location" pop up, I get one saying:

  CRS Warning! Warning: Input layers have non-matching CRS. This may cause unexpected results.

But they DON'T have non-matching CRS'. It gets to 15% processed, and every time I get a "Crash dumped: minidump written to C:..." etc.

My steps to remedy have included: rebooting my computer, resaving each shapefile with the correct CRS, and uninstalling then reinstalling QGIS. I can send screen shots/shapefiles/any more info.


texts: Selecting elements of specific geometry type in PostGIS

texts:
I was reading a postgis tutorial and noticed that unlike working with shapefiles, one can actually store different types of geometry in postgres. In a table created with multiple geometry types, the tutorial used:

SELECT ST_X(geom), ST_Y(geom)
  FROM geometries
  WHERE name = 'Point';

to show X, Y coordinates of a point. I was wondering in general, whether we can use the geometry type in the WHERE clause to do the same. I tried:

SELECT ST_X(geom), ST_Y(geom), name
  FROM geometries
  WHERE ST_geometrytype(geom) = ST_Point;

and got:

ERROR:  column "st_point" does not exist
LINE 3:   WHERE ST_geometrytype(geom) = ST_Point;
                                        ^
********** Error **********

ERROR: column "st_point" does not exist
SQL state: 42703
Character: 87

How can I fix this?


texts: Creating virtual layers using Python and export them without using QGIS UI

texts:
I am trying to create a flow map and have 5000 nodes and millions of edges. I've used
SELECT StartID, DestID, Weight,
       make_line(a.geometry, b.geometry)
FROM edges
JOIN nodes a ON edges.StartID = a.ID
JOIN nodes b ON edges.DestID = b.ID
WHERE a.ID != b.ID

which I found on https://anitagraser.com/2019/05/04/flow-maps-in-qgis-no-plugins-needed/.
Not surprisingly with known performance issues with virtual layers in QGIS, QGIS keeps crashing as it can't handle the large dataset.
I'm looking for ways I can create and export this using just python.
How can I do this?


texts: Making development patterns more efficient with ZSH

texts:
A common pattern I find myself encountering is converting a CSV to a projected GeoJSON as described here.

That entails 3 steps, and I'd like to get it down to the following:

GEOIFY {file} {originalProjection} {newProjection} =
    csv2geojon {file.csv} > {file.geojson} &&
    ogr2ogr
        -F geojson
        -s_srs epsg:{originalProjection}
        -t_srs epsg:{newProjection}
        {reprojectedFile.geojson} {file.geojson}

If anyone has any good resources on how to create functions and use variables with ZSH (which is what I think I need to do this) that would be beautiful. I must be using the wrong vocabulary, because my googling hasn't yielded anything so far.

As always, thanks!


texts: Keeping SDE for data maintenance, but use postgis for display

texts: We build and maintain GIS data in a production environment with SDE on SQL 2008.  We also have a need to open up WMS and WFS that will make a complete ESRI solution really expensive.  With an ArcGIS Server Enterprise Advanced license, is it possible to replicate the data into a non-SDE postgis database and push deltas from the production environment?


texts: Programmatically switching to edittemplate using ArcObjects?

texts:
How can I programmatically switch to a edittemplate in:

ArcMap 9.3:

IEditLayers pEditLayers;
IFeatureLayer pFeatLayer;
IMap pMap = ((IMxDocument)Application.Document).FocusMap;
pEditLayers = (IEditLayers)Editor;
pMap = Editor.Map;
for (int i = 0; i < pMap.LayerCount; i++)
{
    if (pMap.get_Layer(i).Name == "roads")
    {
        pFeatLayer = (IFeatureLayer)pMap.get_Layer(i);
        pEditLayers.SetCurrentLayer(pFeatLayer, SubType);
    }
...

ArcMap 10: first idea, but it does not work:

IEditTemplate currentTemplate = m_editor.CurrentTemplate;
for (int i = 0; i < m_editor.TemplateCount -1; i++)
      {
        IEditTemplate editTemplate = m_editor.get_Template(i);
        if (editTemplate.Layer.Name == "roads")
        {
          currentTemplate = editTemplate;
        }
...


texts:
I am trying to teach myself Python scripting for ArcMap, however I'm stuck with possibly a very simple issue.

All the tutorials in my books start with "Open the file with ArcMap" without mentioning how to do this through the console.

But what I want is to build my scripts by having an implicit presence of file within the Python environment.

However, the best I found so far is:

os.startfile(PATH-TO-THE-FILE)

which opens the ArcMap window and loads the file.

This is not bad, however:

I'm getting A WINDOW when scripting outside ArcMAP
I'm getting ANOTHER WINDOW when scripting inside ArcMAP

So to sum up - I am particularly interested in answering two questions:

Can I do the whole processing just from Python IDLE? Open the file, merge it with another files, do the geoprocessing, save/print results...?
If the answer to previous is TRUE, then how can one easily switch between loading the files to ArcMAP (when running the script in its console) and doing the whole job externally? I'd prefer to see what the script does at first (work inside ArcMAP's Py console) and when the script is done then move it out and run it on periodical basis within Python IDLE.


texts: Executing CostDistance Function in ArcPy gives Error 999999?

texts:
I am attempting to create a least cost path using ArcPy for automation. I have the starting/end points and cost surface raster already assembled, so I am just using ArcPy to automate through my dataset. Upon running the script, though, I receive an error at line 24: "CostDist = arcpy.sa.CostDistance(...".

Here is the code block:

import os
import arcpy
from arcpy.sa import *
arcpy.env.overwriteOutput= True
arcpy.env.extent = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3\\Tide_Extent3.shp')
arcpy.CheckOutExtension("spatial")

arcpy.env.workspace = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3')
TargetWorkspace = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3')

SourcePoints =  ("H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3\\Tide_Extent3_Source_Points.shp")
DestinationPoints = ("H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3\\Tide_Extent3_Destination_Points.shp")
CostSurface = ("H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3\\Tide_Extent_3_CostSurface.tif")

CostDist = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3')
Backlink = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3')
CostPath = ('H:\\IAS GIS Information\\Geodatabase\\Island_Isolation\\Tidal_Stream\\Tide_LCP\\Extent_3')

for i in range (int(arcpy.GetCount_management(DestinationPoints).getOutput(0))): #Use the "getOutput() to start the FID count"
    if os.path.exists(Backlink + str(i)):
       os.remove(Backlink + str(i))
    arcpy.MakeFeatureLayer_management(DestinationPoints, "endpointA" + str(i), ' "IN_FID_A" = ' + str(i))
    arcpy.MakeFeatureLayer_management(SourcePoints, "sourcepointA" + str(i), ' "IN_FID_A" = ' + str(i))
    CostDist = arcpy.sa.CostDistance("endpointA" + str(i), CostSurface, out_backlink_raster = "BackLinkA"+str(i))
    CostDist.save("CostDistA" + str(i))
    CostPath = arcpy.sa.CostPath("sourcepointA" + str(i), "CostDistA" + str(i), "BackLinkA" + str(i))
    CostPath.save("CostPathA" + str(i))

The execution error reads: "ExecuteError: ERROR 999999: Error executing function. Failed to create raster dataset Failed to execute (CostDistance)."

I have used this code previously with no issues so I am not sure about what is making the script fail.


texts:
I need to convert modis MOD021km data to reflectance and Brightness temperature.

I know that some plugins for Envi is doing this with modis data but I want to run an atmospheric correction on my data first and for this purpose I am using FLAASH in Envi,

It works fine but The results that I get are a bit strange.For example here is a DN of a pixel

before Run flash:129.676651
afrer FLAASH:3144
The Reflactance that is calculated using MCTK plugin(without FLAASH):0.261504

If I want to convert the result of FLASH to reflectance and brightness temperature what algorithms should I use?

I know the algorithms for converting DN's to BT and .. but I think the result of FLASH should not used directly in those algorithms ..

Do you know how to use FLAASH results in case of calculating reflectance and brightness temperature?


texts: Writing program to get datatypes of certain fields and then do some work on that but SearchCursor makes everything tuples

texts:
I am trying to write a program to get the datatypes of certain fields and then do some work on that but SearchCursor makes everything tuples.
How do I bypass this situation and get the actual datatype of the field in question?
Code added in below:
ingdb1 = parameters[0].valueAsText
field1 = parameters[1].valueAsText
ingdb2 = parameters[2].valueAsText
field2 = parameters[3].valueAsText
outField = parameters[4].valueAsText

arcpy.env.workspace=r'C:\Users\JKart\Desktop\GDB Files\d43w3.gdb'
f1type=''
f2type=''
f1=arcpy.da.SearchCursor(ingdb1,[field1])
f2=arcpy.da.SearchCursor(ingdb2,[field2])
for a in f1:
    for b in f2:
        f1type=type(a)
        f2type=type(b)
        # f1type=arcpy.Describe(f1).type
        # f2type=arcpy.Describe(f2).type
        break
    break
arcpy.AddMessage('field1 type: '+str(f1type))


texts: How can I trigger a QGIS plugin Event from map refresh?

texts:
I have a combobox in my plugin (python Qt dockable widget) that needs to contain the currently open rasters.

How do I trigger an update of the plugin when something new gets added to the map?


texts: Adding rasters to pgsql with rpostgis - why are raster constraints so slow?

texts:
I am adding rasters to a postgresql DB using the function pgWriteRast from the package rpostgis. I am noticing that the additions to the DB are slowing down as more and more rasters are added to the DB (currently about 2000 rasters in the DB each about 500KB). The portion of the processing that is slowing is during the adding of raster constrains. See the following output:
Appending to existing table. Dropping any existing raster constraints...
NOTICE:  Dropping SRID constraint
NOTICE:  Dropping scale-X constraint
NOTICE:  Dropping scale-Y constraint
NOTICE:  Dropping blocksize-X constraint
NOTICE:  Dropping blocksize-Y constraint
NOTICE:  Dropping alignment constraint
NOTICE:  The constraint "enforce_regular_blocking_rast" does not exist.  Skipping
NOTICE:  Dropping coverage tile constraint required for regular blocking
NOTICE:  The constraint "enforce_coverage_tile_rast" does not exist.  Skipping
NOTICE:  Dropping spatially unique constraint required for regular blocking
NOTICE:  Dropping number of bands constraint
NOTICE:  Dropping pixel type constraint
NOTICE:  Dropping nodata value constraint
NOTICE:  Dropping out-of-database constraint
NOTICE:  Dropping maximum extent constraint
Splitting 29 band(s) into 1 x 1 blocks...
NOTICE:  Adding SRID constraint
NOTICE:  Adding scale-X constraint
NOTICE:  Adding scale-Y constraint
NOTICE:  Adding blocksize-X constraint
NOTICE:  Adding blocksize-Y constraint
NOTICE:  Adding alignment constraint
NOTICE:  Adding number of bands constraint
NOTICE:  Adding pixel type constraint
NOTICE:  Adding nodata value constraint
NOTICE:  Adding out-of-database constraint
NOTICE:  Adding maximum extent constraint

I'm wondering, is postgresql removing and rewriting constraints for every raster in the DB with each new raster addition? Or is it just modifying constraints for the raster that is being added?


texts: How to get and create featureclasses in Python toolboxes?

texts:
I'm writing my first python toolbox. I know there's a way to do this in batch processing, but for proof of concept I want to write this pyt tool to call the Clip tool and add the resulting featureclasses to the map.

According to the documentation, here is how you're supposed to call the Clip tool:

arcpy.Clip_analysis('input_feature', 'clip_feature', 'output_feature')

The parameters I have defined for my tool are two "Feature Layer"s for the user to select, and then a Derived parameter that is a Feature Layer and an Output.

After parameters are defined, the only part of the code that does anything is the execute function. I just want to call Clip_analysis with the names of the feature layers that the user defined, and then output to the derived output feature layer.

It seems that calling Clip_analysis with these parameters will output to the gdb I am working in, but it will not show up in the current layer in arcmap. How do I solve this?


texts:
I have C# code for an Add-in button in ArcMap (10.8). An ArcGIS add-in would be built if no errors found in the C# code when building solutions. In the beginning, I resolved some errors by installing ArcObjects SDK (10.8) installation file. Then, a solution was built, with an add-in being rebuilt and added as a button to ArcMap. The issue is that when I click the button, there should be a user interface popping up in ArcMap since it was a part of the C# code. However, the user interface did not show up.
How I attempted to address it:
Then, I started debugging. I set a few breakpoints in the C# code. It turns out the C# code were never run to the point prior to the breakpoints that I set, which explains why the user interface did not show. Do you have a similar experience that can share with me?
Where it might go wrong:
I was wondering if the issue comes from the ArcObjects SDK file that I installed since I found that the ArcObjects SDK was installed in C:\Program Files(x86).
Should the ArcObjects SDK be installed in "Program Files" instead of "Program Files(x86)"?
Another concern that I have is that should the ArcObjects SDK be in 64-bit because the computer system is also 64-bit? I assume the version of the ArcObjects SDK that I received is 64-bit, but not 100% sure.


texts:
in QGIS 3.4.14, I am trying to draw a line from Los Angeles to Tokyo. With an XYZ Tile base map turned on, the line goes east from Los Angeles (over Africa) to Tokyo. I would like the line to appear going west from Los Angeles (similar to the direction a plane would fly).

Is there a way to redefine the center of my base map and force the line to go the opposite direction?


texts:
as a cartographer I work with TileMill to visualize geodata. I installed a local PostgreSQL server with PostGIS and osm2pgsql. Everything works fine.

Anyhow, I am new to working with servers and the command line approach.
So, in learning the basics of database management, some GUI tool would be of great help.
Could I for example safely run the PgAdmin app next to the PostgrSQL installation (http://postgresapp.com/) on my Mac OS X Mavericks?

Any suggestions most welcome.


texts: Importing OSM data into PostGIS and display into QGIS

texts:
I am new to all things GIS! However, I need to set up a full GIS infrastructure for a project.

I have installed a Postgres server with PostGIS. That is on ancient hardware for now, 32bits processor with 1GB of RAM, Ubuntu 12.04.

I have imported OSM data from geofabrik.de into my server using osm2pgsql.

The first issue I had was a problem with the osm.pbf files ("Document is empty").
I was more lucky with bz2.
I "just" have an error message at the end but as it is at clean up time, I thought it was OK.

My command looks like this :

/usr/bin/osm2pgsql -d osm -s -K -S /usr/share/osm2pgsql/default.style languedoc-roussillon-latest.osm.bz2

The import log looks like this :

Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_line
Committing transaction for planet_osm_roads
Sorting data and creating indexes for planet_osm_polygon
Sorting data and creating indexes for planet_osm_roads
Sorting data and creating indexes for planet_osm_line
Committing transaction for planet_osm_point
Sorting data and creating indexes for planet_osm_point
Completed planet_osm_point
Completed planet_osm_roads
Completed planet_osm_line
Completed planet_osm_polygon
Stopping table: planet_osm_nodes
Stopping table: planet_osm_ways
Stopping table: planet_osm_rels
COPY_END for COPY planet_osm_nodes FROM STDIN;
 failed: ERROR:  duplicate key value violates unique constraint "planet_osm_nodes_pkey"
DETAIL:  Key (id)=(2147483647) already exists.
CONTEXT:  COPY planet_osm_nodes, line 12179900

Error occurred, cleaning up
Stopped table: planet_osm_rels
Stopped table: planet_os_ways

Unfortunately, the data does not look good when I connect QGIS to my PosGIS DB.

It is very strange, but it seems that all polygons include one point at the center of the map.

I am not sure what is wrong or if it is related to the error that occurs at the end of the import.


texts: GeoJSON in MapBox GL JS: Can I set layout and paint properties individually for each feature?

texts:
For example I have some GeoJSON here that represents airspace regions and they have in their properties "HIGHALT" in feet, so it would be very natural for me to map this to the fill-extrusion-height paint property (which takes meters), however these values are on an individual feature basis rather than across the entire set of features.

I tried just adding it into the properties, but it didn't work.


texts: Removing dynamic time text for time enabled map in ArcGIS

texts:
I recently created a map with time enabled and would like to format the displayed date time in order to show only the date portion of the text.  Currently I'm using the default formatting shown below and getting a complete date/time representation.

Using the above formatting I get the following result.

How could I go about editing the formatting to remove the time portion all together and leave only the date?

I have tried changing "time" to "date". which just broke the dynamic expression altogether.


texts:
I have 4 separate ASCII grids which all contain the same data:

1 2 3 4
3 4 5 6
4 5 6 8
7 9 5 4

The metadata, however, is different:

ncols 4
nrows 4
xllcorner x
yllcorner y
cellsize 1
nodata_value -9999

Where x  and y take on the values (0,0), (4,0), (4,4) and (0,4) repectively. I then Try to run a merge operation as follows using rasterio:

from rasterio.merge import merge
import rasterio
import glob

def merge_datasets(out_filename, dataset_list, driver):
    print('running merge command and outputting mosaic')
    mosaic, out_trans = merge(dataset_list)

    print('updating metadata')
    out_meta = dataset_list[0].meta.copy()
    out_meta.update({"driver": driver, "height": mosaic.shape[1], "width": mosaic.shape[2], "transform": out_trans})

    print('writing file')
    with rasterio.open(out_filename, 'w', **out_meta) as dest: # YES, NO, IF_NEEDED, IF_SAFER
    dest.write(mosaic)

    out_dataset = rasterio.open(out_filename)
    return out_dataset

if __name__=='__main__':
    tiles_filename_list = glob.glob(r'test_data/*.asc')
    tiles_dataset_list = open_dataset_list(tiles_filename_list)

    merged_dataset = merge_datasets(r'test_data/out.asc', tiles_dataset_list, driver='AAIGrid')

This creates the following incorrect grid:

ncols        8
nrows        8
xllcorner    0.000000000000
yllcorner    0.000000000000
cellsize     1.000000000000
NODATA_value -9999
 1 2 3 4 1 2 2 3
 3 4 5 6 3 4 4 5
 3 4 5 6 3 4 4 5
 4 5 6 8 4 5 5 6
 1 2 3 4 1 2 2 3
 3 4 5 6 3 4 4 5
 4 5 6 8 4 5 5 6
 7 9 5 4 7 9 9 5

Does anyone know why this occurs. I would have expected:

ncols        8
nrows        8
xllcorner    0.000000000000
yllcorner    0.000000000000
cellsize     1.000000000000
NODATA_value -9999
 1 2 3 4 1 2 3 4
 3 4 5 6 3 4 5 6
 3 4 5 6 3 4 5 6
 4 5 6 8 4 5 6 8
 1 2 3 4 1 2 3 4
 3 4 5 6 3 4 5 6
 4 5 6 8 4 5 6 8
 7 9 5 4 7 9 5 4

I tried looking into the different options in the merge method in rasterio but found nothing useful.


texts: Pull JSON array (from Overpass API) to PostGIS?

texts:
I would like to integrate OSM data into my Postgresql/PostGIS database automatically (trigger-like operation) using Overpass API.

For my tests I have selected the following query:

https://www.overpass-api.de/api/interpreter?data=[out:json];node[amenity=bicycle_rental](46.1138,-1.1630,46.1925,-1.1511);out meta;

Is there any documentation associated with this type of use? I haven't found anything so far except the following Postgresql documentation: https://www.postgresql.org/docs/9.6/functions-json.html

And this Q&A simply redirects the discussion to the use of QuickOSM: https://help.openstreetmap.org/questions/46360/overpass-api-to-postgresql

I asked about the possibilities offered by foreign data wrappers: https://github.com/nkhorman/json_fdw

But how it works and the automation of a recovery script doesn't seem very clear to me.


texts: Can I use Kalman or any other filter on my trajectory data

texts:
I have a number of vehicle trajectories(telematic data) stored in a relational database, (Long, Lat, speed) in each second, the points are already map-matched as I have also the road ID from OSM.
I want to clean them from any outliers, what I've seen is that the most error in my data is when a vehicle have a speed of 0 (car is stopped), the Long and Lat have different values (GPS error).
What I understood is that Kalman filter is used for real time tracking, I don't know if I can use it here? Knowing that I have a big database of trajectories, what are the best options out there?


texts: What's wrong with my ArcGIS - PostGIS setup?

texts:
I have installed ArcGIS and PostGIS, and I'm having a hard time connecting them.

I've imported some shapefiles into PostGIS and I can see them and manipulate them in pgAdmin.

The trouble is that I can't see the geo data in ArcMap. I successfully created a database connection to my local Postgres server, and I can see a list of tables including the shapefile I added, but clicking "Add Data..." in ArcMap fails silently. If I try "Add Query Layer" and click the table, I get an error "The SQL statement was not a select statement."

What's wrong with my setup?

(I'm using ArcGIS 10.4, Postgres 9.4, PostGIS 2.1)


texts: Arcpy "MemoryError"; Get Classification Breaks on a TIF Raster; Jenks Breaks; Python

texts:
I have a large .tif raster with integer values. I wish to generate Jenks classification breaks using code and then use those breaks to reclassify my .tif file.

I came across a block of code that I am using to define my Jenks function. Its source is: https://gist.github.com/drewda/1299198

So far I have imported my raster, converted it to a (233,679) 2D array and then converts to a (158207,) 1D array.

Then I attempt to run the function on the array but get the error:

Traceback (most recent call last):
  File "C:\Users\agates44\Desktop\FinalProject\script1.py", line 80, in <module>
    new = getJenksBreaks(oneDarr,9)
  File "C:\Users\agates44\Desktop\FinalProject\script1.py", line 40, in getJenksBreaks
    mat2.append(temp)
MemoryError

My code is below

# Define the folder path
folderPath = r'C:\Users\agates44\Desktop\FinalProject'

# Import modules
import arcpy
import numpy as np

# Set workspace
from arcpy import env
env.workspace = folderPath
# Allow overwrite
env.overwriteOutput = True

# Get Input Raster properties
inRas = arcpy.Raster('smallorange.tif')
lowerLeft = arcpy.Point(inRas.extent.XMin,inRas.extent.YMin)
cellSize = inRas.meanCellWidth

# Convert Raster to numpy array
arr = arcpy.RasterToNumPyArray(inRas,nodata_to_value=0)
print arr.shape
print arr.dtype
oneDarr = arr.ravel()
print oneDarr.shape
print oneDarr.dtype

def getJenksBreaks(dataList, numClass):
  dataList.sort()
  mat1 = []
  for i in range(0,len(dataList)+1):
    temp = []
    for j in range(0,numClass+1):
      temp.append(0)
    mat1.append(temp)
  mat2 = []
  for i in range(0,len(dataList)+1):
    temp = []
    for j in range(0,numClass+1):
      temp.append(0)
    mat2.append(temp)
  for i in range(1,numClass+1):
    mat1[1][i] = 1
    mat2[1][i] = 0
    for j in range(2,len(dataList)+1):
      mat2[j][i] = float('inf')
  v = 0.0
  for l in range(2,len(dataList)+1):
    s1 = 0.0
    s2 = 0.0
    w = 0.0
    for m in range(1,l+1):
      i3 = l - m + 1
      val = float(dataList[i3-1])
      s2 += val * val
      s1 += val
      w += 1
      v = s2 - (s1 * s1) / w
      i4 = i3 - 1
      if i4 != 0:
        for j in range(2,numClass+1):
          if mat2[l][j] >= (v + mat2[i4][j - 1]):
            mat1[l][j] = i3
            mat2[l][j] = v + mat2[i4][j - 1]
    mat1[l][1] = 1
    mat2[l][1] = v
  k = len(dataList)
  kclass = []
  for i in range(0,numClass+1):
    kclass.append(0)
  kclass[numClass] = float(dataList[len(dataList) - 1])
  countNum = numClass
  while countNum >= 2:#print "rank = " + str(mat1[k][countNum])
    id = int((mat1[k][countNum]) - 2)
    #print "val = " + str(dataList[id])
    kclass[countNum - 1] = dataList[id]
    k = int((mat1[k][countNum] - 1))
    countNum -= 1
  return kclass

new = getJenksBreaks(oneDarr,9)
print new

### used after running getJenksBreaks()
##def classify(value, breaks):
##  for i in range(1, len(breaks)):
##    if value < breaks[i]:
##      return i
##  return len(breaks) - 1

How can I figure out which line of my code is using all the memory and what is a workaround I can use?

****** EDIT
The function ran (although it took forever) on the raster size listed above. But that was only a subset of my much larger dataset.

(2400, 2337) 2D array
(5608800,) 1D array

This is when I get the memory error.


texts: Display longitude latitude points on xy raster file in meters and with projection of Albers Conical Equal Area

texts:
I'm new to Python and I have a data set which contains longitude and latitude coordinates(WGS84) points, and a .img raster file of CONUS in meters and with the projection of Albers Conical Equal Area.

What I'm trying to do is to display the points on the image and get the raster value of those points. The metadata of the image contains the projection information, including projection parameters and bounding coordinates(longitude and latitude). But I don't really understand the projection, and how can I connect the lat_lon points with the image in meters with projection? Is there any pkg which can be useful in python?

I've searched related questions, here is an example which would like to convert lat_lon to xy on Mercator projection in Java, I'm not sure if this can be used in Python, too.


texts:
I'm working with QGIS2threejs for quite a while and it is a great tool!
Changing font for the 3D presentation is easy, just change it in the css file.
But here is my question:
Is it possible to change the font for each layer separatly?
Do I have to add a certain attribute in the js file, which contains all the data and adapt the css.

Any experiences here?

Help would be really great!


texts: Is the SAGA tool Basic terrain analysis included in Processing?

texts: I can't find the saga tool Basic terrain analysis in the Sextante/processing toolbox. Is this not included or is there a chance to install it?


texts: Counting points in each polygon so that points do not repeat QGIS

texts:
I have a points layer and a polygon layer.
I need to count points in each polygon/buffer so that points do not repeat. For instance, here is an example with 4 polygons and 8 points inside in total.
What I get from ArcGIS Summarize Within, as well as from QGIS Count Points in Polygon is that:

polygon consist of 2 points;
polygon - 4 points;
polygon - 2 points;
polygon - 2 points.

However, the count of 1. and 2. polygon is incorrect because results show 6 points in total even though there are only 4, as you can see in the picture.
The result should look something like this:

polygon consist of 2 points;
polygon - 2 points;
polygon - 2 points;
polygon - 2 points, so that points do not overlap in several polygons.

If I had only a few polygons, this would be quite easy, but as I have several polygons and points, manual work is not a real solution.
I'm pretty sure that this could be done very easily with some expression, however, I could not figure it out.


texts: Cutting (Exporting) TIF images from WMS in ArcGIS 10 to use in AutoCad

texts:
The "ArcGIS for AutoCad" tool with WMS keeps giving FDO errors and is unreliable so we have procedure for putting cropped raster (TIF images) from ArcGIS into AutoCAD that has been used for years.
We do not use ArcGIS's export world file function since ArcGIS doesn't allow for precise specific rectangle exports in Data View. We do all exporting from ArcGIS in Layout View.

Basically will build a world file through several complex manual tasks in ArcGIS and AutoCAD. (i.e. shape ArcGIS's data frame to what is needed, write down coordinates from 2 corners of data frame in ArcGIS, draw a rectangle in AutoCAD based on these coordinates, insert the tif image, scale, etc.)

Just wondering if anyone knows of a better way to accomplish this?


texts:
I have a problem with importing data to ArcMap. I want to import high-resolution temperature and precipitation data, stored in GeoTIFF files. Information about the project and the data can be found here: https://climatedataguide.ucar.edu/climate-data/chelsa-high-resolution-land-surface-temperature-and-precipitation

The files itself can be found downloaded here: http://chelsa-climate.org/downloads/

These are my settings for downloading the data. But I think my problem is with any GeoTIFF files. I think I don’t know exactly how to import them or use them.

When I download a file, I simply import it through “Add Data” and then select the file. I read ArcMap will automatically handle GeoTIFF correctly. After importing however, all I see is a blank map. The whole layer seems to be just white. I don’t know what to do with this layer and how I can access the information stored in it.

Maybe it’s not supposed to be imported as a layer in the first place? How can I make the data from the project visible in ArcMap?


texts: Watershed delineation by using QGIS with ifsar dtm 5m resolution of grid

texts:
I had some problems during running the channel and drainage basin with an IFSAR DTM, 5m resolution. I followed these steps, according to the guidance from website of QGIS:

I reprojected the DTM to my CRS.
I ran the fill sink(wang & liu).
I generated the strahler order and used raster calculator to find the stream line.

However, when I finished the process, I found that the stream line was not continuous. Under this situation, I continued to run extension of channel and drainage basin. For the result the channel and the drainage basin that I generated were blank.

May I know whether the QGIS software is sufficient to run the watershed delineation with ifsar dtm 5m resolution of grid or not?


texts: Beside ESRI's LIDAR online training, I'd like to work on some hands-on training that I can learn about LIDAR. Are there any good LiDAR out there that I can get some training with the datasets?


texts:
I have loaded a shapefile into QGIS that has been generated in a third party piece of software. When I view the attributes table, all items are there (20 survey lines), when I view the map only 19 appear.
I have also tried adding an extra feature in the Attribute table and giving it the same field information as the missing item but this is also not drawn.
Any ideas?


texts: How to get the coordinates of the x-axis from a profile graph in Arcmap?

texts:
I have done already a profile graph in ArcMap drawing a diagonal line over a DEM image. Now I would like to add some point locations as it is showed in the attached figure. I set these blue points in an approximated location. However, I would like to know the UTM coordinates of the x-axis of this profile. It is to know where exactly can I match my location points in the x-axis of this graph (points which already I know their coordinates). When I export the data from this Profile Graph, the x-axis give me distance values from 0 to ~190,000 m. And what I need is the real coordinates and no distances from A to B.

Is there some method to know these x-coordinates of this profile graph?


texts: Problem with public key, when i use mapquest directions service?

texts:
I recently registered in mapquest service and get api key, then i tried to use make request to directions service, but get following response:

Ext.data.JsonP.callback12({
    "route": {
        "routeError": {
            "message": "",
            "errorCode": 3
        }
    },
    "info": {
        "copyright": {
            "text": "© 2013 MapQuest, Inc.",
            "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
            "imageAltText": "© 2013 MapQuest, Inc."
        },
        "statuscode": 403,
        "messages": ["This is not a valid key. Please check that you have entered this correctly. If you do not have a key, you can obtain a free key by registering at http://developer.mapquest.com."]
    }
});


texts: NOAA vDatum which WGS84(*) reference for data created using ESRI WGS 84

texts:
I have an ESRI shapefile that use the WGS84 using latitude and longitude.  The ESRI text for this coordinate reference system refers to EPSG 4326.  The Z values reference the NAVD88 vertical datum and I want to use NOAA vDatum to convert the vertical datum from NAVD88 to EGM96.  vDatum requires the in-data horizontal reference system and for WGS84 there are the following choices; WS84(G1674)-use ITRF2008, WGS84(G1150)-use ITRF2000, WGS84(G873)-use ITRF96, WGS84(G730)-use ITRF91, WGS84(G1762-use IGS08).  I have tried using WGS84(G873)-use ITRF96, and WS84(G1674)-use ITRF2008 and the difference is a few centimeters for the resulting Z values.

I am assuming that the best choice would be WGS84(G873)-use ITRF96 since the dates match but I would like to clarification that this is the best choice.


texts: Geoserver WMS error with large Bounding box crossing the international dateline.

texts:
<ServiceExceptionReport version="1.1.1">
<ServiceException code="internalError">
Rendering process failed Angle 13,168,124,524.119 is too high.
</ServiceException>
</ServiceExceptionReport>

the request looks like this:

http://mydomain.com:8083/geoserver/GeoNorth/wms?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.1.1&LAYERS=GeoNorth:Northern_Clip_PHR_20140730_Pyramid,GeoNorth:Southern_Clip_PHR_20140727_Pyramid,GeoNorth:Southern_Clip_PHR_20150624_Pyramid&WIDTH=1573&HEIGHT=923&SRS=EPSG:3857&BBOX=-23369219.7435007,4845493.601471966,-7979082.720454264,13876069.87119343

This request which is smaller but still way larger than the image bounding boxes works:

http://mydomain.com:8083/geoserver/GeoNorth/wms?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.1.1&LAYERS=GeoNorth:Northern_Clip_PHR_20140730_Pyramid,GeoNorth:Southern_Clip_PHR_20140727_Pyramid,GeoNorth:Southern_Clip_PHR_20150624_Pyramid&WIDTH=1484&HEIGHT=877&SRS=EPSG:3857&BBOX=-18247804.17811192,8610145.67081433,-14617962.578906432,10755274.432608945

I have two geoserver instances an older 2.7.2 version and a 2.8.2 server. The 2.8.2 returns the above error when the bounding box crosses the international datelne. The 2.7.2 server worked until I restarted it. Now it's returning the same error.

Any suggestions?


texts: Change cache location when publishing a service

texts:
When publishing a service on arcmap how do you change the cache location? Since when a service is cached there is no way to change the option available from the default option.
I went to Customize, Arcmap Options and Display Cache and I changed the path there however this did not change the path that shows the cache location when I come to publish the service.


texts: QGIS running on Windows XP says ...\saga_cmd.exe is not valid Win32 application?

texts:
I installed the 32-bit version of the latest QGIS (2.18.16) and get this error message when loading restored plugins:

  C:PROGRA~1\QGIS2~1.18\apps\saga-ltr\saga_cmd.exe is not a valid Win32 application.

Where do I remove the reference to this executable?


texts: Geochemical maps with QGIS: Case of multiple analyses in a point

texts:
I am a newbie, using QGIS 3.4. My goal is to create geochemical maps of species distribution in water samples. I mine data from a database, regarding specific points, which are boreholes or springs. Those points are sampled periodically. I turn them to a csv file and finally I get a point layer with multiple analyses corresponding to each point.

I try to create water species distribution maps for an area using Inverse Distance Weighted (IDW), but I get bad results. Can I know which of the analyses the software uses to produce results? Is there a way to choose the most reliable (in my opinion) analysis? Or would you rather propose a statistical processing instead, before interpolating?


texts: How to visualize values distributed on the line on its parallel (curves problem)

texts:
I assign some value for each of points distributed equally on origin line, then I want to move this values to its paralllel line, by splitting those parallel line into equal pieces (which amount will be equal to amount of points)

Problem number 1 is that using v.parallel grass algorithm in places when turns are sharp, gives strange results (see green circle on picture). I know that this is probably good according to definition of paralller curve, but it is definetely not nice for visualization.

It could be ommited with doing buffer around this line and then cutting its ends. But then comes another problem. Inside sharp turns segments should be smaller and outside larger. In case when they are equal lenght then place of this segments on left and right parallel (which are generally different lenght) is different (see arrows on picture).

Imagine garden hose. If you bend it, then inside curve you will have material compressed, while outside material will be extended. I have to do the same in my case. Make more segments inside curve, and less outside. But how?


texts: Adding Stamen global terrain maps to geonode

texts:
Until recently Mapquest provided the de-facto standard for open tile access for OpenStreetMap data. In June they announced they are renewing their services. As a consequence current Mapquest basemaps in Geonode 2.4 were not functional as of 11th of July 2016.

Although we might consider using Mapquest again later, we are now looking at using Stamen maps based on their recent announcement.

To do this we will have to add their tile-reference information in our geonode settings-file. After removing Mapquest the relevant part in geonode settings.py looks like this:

MAP_BASELAYERS = [{
    "source": {"ptype": "gxp_olsource"},
    "type": "OpenLayers.Layer",
    "args": ["No background"],
    "visibility": False,
    "fixed": True,
    "group":"background"
}, {
    "source": {"ptype": "gxp_osmsource"},
    "type": "OpenLayers.Layer.OSM",
    "name": "mapnik",
    "visibility": True,
    "fixed": True,
    "group": "background"
}]

Some background information about the Stamen tile services is available.

How do we append the above settings to add Stamen maps (primarily the terrain maps) as one of our our default background basemaps?


texts: Assigning values of points inside buffer to origin of buffer using QGIS

texts:
I have created a map with several bike routes. At each bike ride we have collected meteorological data and now I want to analyze and compare the collected data. My problem is that the GPS tracker wasn't that accurate and now the different rides wont have the same coordinates.

I created a standard route (red), and I had the idea I could "just" assign the values of the (green) points near by...., but I couldn't.
Is there an easy way to do that?
I tried it with buffer, but it wont work.


texts: Understanding NOAA/GFS0P25 dataset of Google Earth Engine scale change

texts:
I have noticed that there are a big differences between the forecasting values of the years 2018-2019 against 2020 for  'total_precipitation_surface'.

var dataset = ee.ImageCollection('NOAA/GFS0P25')
                  .filter(ee.Filter.date('2019-01-03', '2019-01-04')) // mean 4~ 8 kg/m^2

                  .filter(ee.Filter.date('2020-01-03', '2020-01-04')) // mean 0.0004 kg/m^2!!!

var Pre_TPS= dataset.select('total_precipitation_surface');

Are there some factor that we need apply?


texts: ArcPy symbolize layer if a value is correct

texts:
I want to symbolize a layer in an active session and add to display if some kind of value is right.

I found a way to symbolize in an active session here

So i tried to extend it, but unfortunately it doesn't work that way

myMXD = arcpy.mapping.MapDocument("Current")
lstDataFrames = arcpy.mapping.ListDataFrames(myMXD)
dlrLayer = arcpy.mapping.ListLayers(myMXD,"layer_name")
allFrames = arcpy.mapping.ListDataFrames(myMXD)
dlr_rows = arcpy.SearchCursor(path)

for dlr_row in dlr_rows:
    if dlr_row.getValue("field_name") == "Value":
        for dataFrame in allFrames:
            myMXD.activeView = dataFrame
        for mapLayer in dlrLayer:
            arcpy.ApplySymbologyFromLayer_management(mapLayer, path)
    else:
        arcpy.AddMessage("Error")

How could i do that?


texts:
ArcMap, ArcScene and everything else works fine and opens without a problem. However, ArcCatalog cannot open. Instead a window pops up and says:

  Microsoft Visual C++ Runtime Library.  Runtime Error!  Program:
  C:\Program Files (x86)\ArcGIS\Bin\ArcCatalog.  This application has
  requested the runtime to terminate it in an unusual way. Please
  contact the application's support team for more information.


texts: Changing Carto basemap according to timestamp?

texts:
I'm making an animated "time-map" of the avaibility of renting bikes during a day (on Carto).

Can I change the basemap so when it's day time the basemap is light and when it's night time the basemap is dark?


texts: How to get dictionary value from reduceRegion in GEE Python

texts:
The result printed in Python is empty dictionary.
How to get the value of regionReduce(mean)?
#%%
# Load input imagery: Landsat 7 5-year composite.
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/2008_2012');

# Load an input region: Sierra Nevada.
region = ee.Feature(ee.FeatureCollection('EPA/Ecoregions/2013/L3')
  .filter(ee.Filter.eq('us_l3name', 'Sierra Nevada'))
  .first());

# Reduce the region. The region parameter is the Feature geometry.
meanDictionary = image.reduceRegion(
  reducer= ee.Reducer.mean(),
  geometry= region.geometry(),
  scale= 30,
  maxPixels= 1e9);

# The result is a Dictionary.  Print it.
print(meanDictionary);


texts: Automatically generate useful scales for data driven pages in ArcGIS desktop and store it in attribute table of shapefile

texts:
I have followed the advice on the post How to automatically generate useful scales for data driven pages in ArcGIS desktop. I followed the advice, but when the process executes it was only the last value that is stored in all the fields in my column "scale". However, I want each value saved in the ID of the appropriate polygon.

Here is the Code:

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\workspace\MyMXD.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for i in range(0, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = i
   if df.scale < 50:
     df.scale = 50
   elif df.scale < 100:
     df.scale = 100
   elif df.scale < 200:
     df.scale = 200
   elif df.scale < 500:
     df.scale = 500
   elif df.scale < 1000:
     df.scale = 1000
   elif df.scale < 2000:
     df.scale = 2000
   elif df.scale < 5000:
     df.scale = 5000
   elif df.scale < 10000:
     df.scale = 10000

  InTable = "C:\workspace\MyShapeFile.shp"
  with arcpy.da.UpdateCursor(InTable,["scale"]) as UpCur:
  for row in UpCur:
     row[0] = df.scale
   UpCur.updateRow(row)


texts: Sort attribute table and perform sequential calculation using Field Calculator

texts:
I have an attribute table with a Time attribute (UTCtime) which I want to use to create markers which I will later use to split the features. Example of table below. I will do this by taking the difference between UTCtime at row 2 and subtracting the UTCtime from row 1. When I have a value >1 I want it to put a character like $ in a column so I can split the features at this point and/or group them.
How can I create the Diff column in QGIS and avoid getting the inevitable weird value at the end of the table (-1305510005.40)?
UTCtime   Group  Diff
1305509644  1   0.10
1305509644  1   0.00
1305509644  1   0.10
1305509644  1   0.00
1305509644  1   0.10
1305509645  1   0.00
1305509645  1   0.10
1305509645  1   0.00
1305509645  1   360.40
1305510005  2   0.00
1305510005  2   0.10
1305510005  2   0.00
1305510005  2   0.10
1305510005  2   0.00
1305510005  2   0.10
1305510005  2   0.00
1305510005  2   0.10
1305510005  2   -1305510005.40


texts: GADM Phillipines data won't align to WGS84

texts:
I'm currently working with several datasets in QGIS that lay 100% perfect when I match it on Google Earth using its inter-app plugin.

However, when I load administrative regions from GADM, the entire data is off towards the left. I've tried several CRS projects, but it won't align.

What is the fix around this? I used this some time ago, and everything was okay. I'm not sure what the problem is now.

The discrepancy is 300-m going west. The GADM layer is the green layer, while OSM data are the lines.


texts: Finding difference in gaps between polygon

texts:
I am using ArcGIS Desktop.

I have a feature class of polygons. At first I run topology with rule "must not have gap" error. I find 250 errors (these all are exceptions). After shifting all the features and on few places modification, I again run the topology with same rule, but now I find more errors (e.g 300). As this is very huge data so I want to find only those error (gaps) which are new and not in the old data.

How I can find these errors?


texts: Feature layer is in WGS 84 and Esri map is Web Mercator

texts:
I have published a shapefile on ArcGIS Server, now want to add it to map. I used feature layer to add it to map but it does not display. Here is my code:

<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>FeatureLayer</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">

But the problem is my shapefile is in WGS 1984 and the Esri map projection is Web Mercator. Is this the problem? I have tried to display with dynamic layer but same result. My shapefile is not showing in any case.


texts: openlayers display Control.MousePosition on div.olMap

texts:
I have a map displayed in a div.
I have a small div named coordexterne displaying mouse position.
I try to put the small div on the map so to speak above the map. Until now, the small div is always under the map so it is unvisible, whatever i do in the css.

Any help ?

html :

css :

div.olMap {
border: 2px solid black;
box-shadow: 10px 10px 5px #888888;
position: relative;
 }

#coordexterne {
font-family: Verdana ;
font-size: 10px;
text-align: right ;
width: 250px;
height: 15px ;
line-height: 10px;
position: absolute ;
box-shadow: 10px 10px 5px #888888;
background-color: #6190FB ;
float: right;

}


texts: Why does size of circle object drawn in Google Maps increase when moving it away from Equator

texts:
I'm building a web app that allows the user to search the database based on his Google Maps location and a customizable search area around the location. I've noticed that when I keep the radius of the circle constant (500 miles) the circle is a lot smaller when I place it near the equator then when I place its center in Finland. At first I thought this was caused by a coding error but upon inspection I could find none. Now my second guess is that this sudden change is perhaps caused by the curvature of the Earth. The more the latitude value moves away from 0 (the equator) the larger the circle becomes.

What causes my circle to enlarge when I move my position to one of the poles and how can I prevent the circle from increasing?

With what constant do I need to correct the radius input after each Google Maps position change?

500 mile blue circle near the Equator

500 mile blue circle in Finland which is rendered a lot larger


texts: Seeking ModelBuilder tool for changing Feature Class source?

texts:
I'm trying to add a tool that will give me the opportunity to change the source of a feature within my model.  So this is what I figured out until this point.

I have a feature called: Pipelines
-   I make a selection were Type = “Gas Low Pressure” (for example)
-   from this selection there will be add a Feature layer (an otherwise it will not accept the symbology layer tool)
-   And with the given symbology  there will be layers add to the mxd.

But now I have several new features and I want to replace the source of all those features back to the original source (featureclass) “pipeline”.

I cannot find standard tools as a solution within ArcMap.

Does anyone have any ideas?


texts: INSPIRE section not working in Geonetwork

texts:
I followed this tutorial: http://geonetwork-opensource.org/manuals/trunk/eng/users/administrator-guide/configuring-the-catalog/inspire-configuration.html?highlight=inspire

And I enabled INSPIRE in the Settings; added inspire-theme.rdf thesaurus, but inspireTheme and inspireThemeWithAc are empty. If I want to edit metadata, I can see INSPIRE keywords.

I tried installing both the .jar version and running war, but neither work.

Please help me, what to do to have working inspire directive (section is working, but looks like that lucene is returning zero keywords).


texts: Merging different tag filtering with Osmosis?

texts:
I want to extract the different points of interest from OpenStreetMap. Some of them are represented as ways (e.g., a large sport center might be represented as the building, i.e., as a way), others are represented as nodes. I am using Osmosis to export these elements from the Swiss version of OpenStreetMap. I'm trying to filter sport, leisure and amenity keys and then merge them:

  osmosis --read-pbf file=switzerland.pbf --tf accept-nodes sport=* --tf
  accept-ways sport=* --tf reject-relations outPipe.0="sport" --read-pbf
  file=switzerland.pbf --tf accept-nodes amenity=* --tf accept-ways
  amenity=* --tf reject-relations outPipe.0="amenity" --read-pbf
  file=switzerland.pbf --tf accept-nodes leisure=* --tf accept-ways
  leisure=* --tf reject-relations outPipe.0="leisure" --merge
  inPipe.0="sport" inPipe.1="amenity" inPipe.2="leisure" --write-pgsql
  host=128.178.1.1 database=myDB user=myUsn password=myPwd

It is based on the description of tag-filtering on Osmosis detailed usage page.

I have this error message that I don't understand:

  The following named pipes (leisure) and 0 default
  pipes have not been terminated with appropriate output sinks.

I'm new with Osmosis and I cannot find the error.


texts: Search Intersections with ArcGIS Server 10 without using Address Locator

texts:
Is there a way to search for intersections on a centerline layer in ArcGIS Server 10 without using an Address Locator?

I can send direct queries to the centerline layer for individual road segments.  For example, if I add query?text=Main to the layer URL in a browser window, it will return all roads where the display field matches "Main".

Is there a similar query I can do to find intersections?  I know this is possible with an Address Locator, but I am trying to find an alternative.

Thanks,
Seth


texts: Adding a layer switcher using cartodb.js

texts:
I am trying to add the layer control (L.control.layers) to an application using cartodb.js (v. 3.14).

The last line in the following code

 L.control.layers(basemaps).addTo(map);

breaks the entire thing.
If I comment it out the point data will be shown, as expected, on top of the black basemap:

But I would like to have two basemaps and I would like to have my points as an overlay. So I group them into the respective objects and then pass these objects to the layer control.

What happens then is that I can still toggle both my basemaps, and the dataset is briefly displayed when doing so. However, if I click on the overlay button:

I get (first time):

  Uncaught TypeError: a.onAdd is not a function

or (subsequent times):

  Uncaught TypeError: a.onRemove is not a function

Here is the entire code:

var map;

$( document ).ready(function() {

    map = new L.Map('mapDIV', {
        center: [52.51601,13.40538],
        zoom: 12
    })

    var layerUrl = 'https://PATH/viz.json';

    cartoDB_lyr = cartodb.createLayer(map, layerUrl)

    cartoDB_lyr.addTo(map);

    var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
                    {minZoom: 8,
                    maxZoom: 12,
                    attribution: 'Map data © OpenStreetMap contributors'});
    osm.addTo(map);

    var mapBoxBlack = new L.tileLayer('https://dnv9my2eseobd.cloudfront.net/v3/cartodb.map-4xtxp73f/{z}/{x}/{y}.png', {
            attribution: 'Mapbox Terms &amp; Feedback'
    })

    mapBoxBlack.addTo(map);

    var basemaps = {
        'OSM':osm,
        'Mapbox Black': mapBoxBlack
    }

    var overlays = {
        'Berlin Points':cartoDB_lyr
    }

    L.control.layers(basemaps, overlays).addTo(map);
});

UPDATED Code after comments:

var map;

$( document ).ready(function() {

    map = new L.Map('mapDIV', {
        center: [52.51601,13.40538],
        zoom: 12
    })

    var layerUrl = 'https://PATH/viz.json';

    cartoDB_lyr = cartodb.createLayer(map, layerUrl)
        .addTo(map)
        .on("done",function(lyr){
            var layerOne = lyr.getSubLayer(0);

            var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
                    {minZoom: 8,
                    maxZoom: 12,
                    attribution: 'Map data © OpenStreetMap contributors'});
            osm.addTo(map);

            var mapBoxBlack = new L.tileLayer('https://dnv9my2eseobd.cloudfront.net/v3/cartodb.map-4xtxp73f/{z}/{x}/{y}.png', {
                    attribution: 'Mapbox Terms &amp; Feedback'
            })
            mapBoxBlack.addTo(map);

            var basemaps = {
                'OSM':osm,
                'Mapbox Black': mapBoxBlack
            }

            var overlays = {
                'Berlin Points':layerOne
            }

            L.control.layers(basemaps, overlays).addTo(map);
    });
});


texts: Analysing Landsat images using ERDAS IMAGINE and ArcGIS

texts: I am trying to use the Theil-Sen analysis on the Landsat images to compute vegetation indices, help me figure out how to come up with the median from the Theil-Sen equation in ArcGIS, ERDAS IMAGINE or Excel. The equation is as follows:  where:


texts: How do I install gsconfig in windows 7? I tried with gsconfig.tar.gz but the error is ImportError: No module named setuptools


texts: Cartodb-Displaying Mode and Averages in Infowindow

texts: I have some Boolean and string variables that I want to display in the info window on carto db. But it seems to be only showing one individual data point. How do I get it to show modes or averages of the entire data set?


texts:
I am working with Sentinel-1 images. at this time I am focusing on S1-GRD products.

Based on the Sentinel-1 dodumentation  we know that GRE images are the same SLC images which have gone through different preprocessing steps. and unlike SLC products whose pixels are "rectangular" the pixels of GRD after some projections and resampling steps are approximated to "square" ones and we assume that they have 10x10 pixel spacing (and we know that pixel spacing is not the same as pixel resolution).

Now When I use GDAL to access some information from metadata, I see that:

Origin = (5.807367830419758,47.316947720266072)

Pixel Size = (0.000112597613697,-0.000113573780624)

Here I believe that by "pixel size", GDAL actually means "pixel spacing" and I assume that those two long lines of floating values are equal to (10,-10) in meters.

What "units" are these long floats defined in and based on what calculation can I turn them into meter units?


texts: Geoserver MapFish print : wrong scale and scalebar on my printed map

texts:
I've built a web map with Geoserver and Leaflet displaying background tiles from osm and IGN, and some geojson for overlays.
I'm using the MapFish print module with Geoserver and Leaflet.print to print my maps.
On my map and printed map, all these layers are lined up correctly and I have no problem to print my maps.
But the scalebar and numeric scale displayed are wrong.
When I'm measuring some distances on my leaflet map, I have the right distance, but not in my printed map.

Here is a bunch of my config.yaml, where scales are the resolutions of my osm and IGN tiles :

dpis: [75, 96, 150, 300]

scales:
    - 1223
    - 2446
    - 4892
    - 9784
    - 19568
    - 39136

And here I've console.log what I'm sending in my create.json :

{"units":"m","srs":"EPSG:3857","layout":"A4 Landscape","dpi":96,"outputFormat":"pdf","outputFilename":"leaflet-map","layers":[{"baseURL":"http://a.tile.osm.org/","opacity":1,"type":"OSM","extension":"png","tileSize":[256,256],"maxExtent":[-20037508.34,-20037508.34,20037508.34,20037508.34],"resolutions":[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,0.5971642833948135,0.29858214169740677,0.14929107084870338,0.07464553542435169,0.037322767712175846],"singleTile":false}],"pages":[{"center":[175236.00917692634,6280596.13623742],"scale":1223,"mapTitle":"","comment":"","mapCopyright":"copyrightText","rotation":0}]}

I've set srs : 'EPSG:3857' as Leaflet maps default projection are in 'EPSG:3857'.
I've tried to change it by 'EPSG:900913', I've tried setting other DPI values, scales, ... But I still have the problem.

I've also posted my question on Mapfish Print Users google's group


texts: Combining Rotation and Graduated Colors in ArcMap

texts:
Is there a way to rotate the symbols of a point feature layer (with a given rotation out of the attribute table) that is displayed as graduated color layer?

I can see the option in the graduated color menu, but it is greyed out.


texts:
I am having troubles labeling my map. I have fire occurrences in some regions in my map and I only want them to be labeled and the other regions with no fire to stay without a label.

I want all the (CAD_names) to appear if only (cadastral_1 > 0) and to be labeled (check image) I tried using "case when" and other stuff but it did not work. Here is my attribute table:


texts:
I am building a file geodatabase using ArcGIS. The gdb is going to be distributed to dozens of 'stand alone' machines. End users are expected to populate the gdb with data. End users do have ArcGIS but vary widely in thier technical savvy. Depending on their business needs, different users will populate different subsets of the database (a few potential combinations). I would like to expose the minimum number of fields to each user while they are entering their data.

I can think of two general solutions, but I don't have a good handle on the pros/cons of each. I'm hoping for feedback in the form of relative difficulty, relative benefits, or better yet... a better solution.

1) ArcGIS "Add-in" form built with Visual Studio
2) Form built outside of ArcGIS (Access, Python/Tkinter, or Internet based) and imported into the end user's gdb from a script within ArcMap


texts: queue.empty error when using search cursor

texts:
I'm having trouble with an error message and can't seem to figure out the reason which, I'm sure is something simple. I have a bit of code listed below:

insertPts = arcpy.da.InsertCursor(newFC, ( "FieldA", "FieldB"))

with arcpy.da.SearchCursor(FC, ("FieldA", "FieldB"),""" "FieldA" IS NOT NULL """) as search:
    for row in search:
        num = row[0]
        rPtsNumber = randint(1, row[0])
        row[0] = rPtsNumber
        PTSid = int(row[1])
        for x in xrange (num):
            insertPts.insertRow((rPtsNumber, PTSid))

the error occurs in the line 'for row in search:'. I though it may be an issue with the where clause however, I tried creating a new feature class based on the where clause criteria and continue to get the error. Thanks for any help you can provide.


texts: Limiting data in table based on data driven pages

texts:
I have a database connection and a table imported to my ArcMap ToC. I am looking to limit the data that I see in the table based on the current data driven attribute. In the table properties there is no 'Data Driven Pages' option so I am trying to build a 'query builder' string that will remove these records. I have tried:

PERIOD = <dyn type="page" property= period/>

and:

PERIOD  = <dyn type="page" property= "period"/>

But the result is a blank table when I open it. How do I limit the table data according to the value of the data driven page?