texts: Leaflet markers from multiple JSON layer within the radius given after layer selection

texts:
Continuing the issue with the multiple JSON layer selection with leaflet:

Leaflet select markers from multiple JSON files within the radius given

I was trying to put a step forward and make the layers visible only, when the sode layer is switched on.
So I combined the function SelectPoints(lat,lon) with the command .addEventListener('change', function() in order to have highlighted only these values, that already have been switched on.
My code looks like this:

function SelectPoints(lat,lon){
var dist = document.getElementById("miles").value;

xy = [lat,lon];  //center point of circle

var theRadius = parseInt(dist) * 1609.34  //1609.34 meters in a mile
//dist is a string so it's convered to an Interger.

selPts.length =0;  //Reset the array if selecting new points

job.eachLayer(function (layer) {
    // Lat, long of current point as it loops through.
    layer_lat_long = layer.getLatLng();

    // Distance from our circle marker To current point in meters
    distance_from_centerPoint = layer_lat_long.distanceTo(xy);

    // See if meters is within radius, add the to array
    if (distance_from_centerPoint <= theRadius) {
         selPts.push(layer.feature);
    }
document.querySelector("input[name=bball]").addEventListener('change',
function() {
            if(this.checked) map.addLayer(job)
              else map.removeLayer(job)
            })

but map is gone...

As you can see in the picture below, despite all layers are switched off, the marker still highlight values within the radius. On top of that I am not aware to which layer my placemark is referred to, because all of them has been highlighted in green.

Is it possible to have them distinguished as per layers given? For instance keep the marker with clear selection within the radius, when all layers are switched off or keep highlighted only these, that has been switched on by side panel on the right?


texts: QGIS 2.14.3. positioning gap between OpenLayers layer and aerial image

texts:
When I add aerial images from a recent survey (delivered in EPSG:31468, DHDN_3_Degree_Gauss_Zone_4) to an empty project together with an OpenLayers OSM layer I'm facing a strange positioning issue. I carried out the following steps:

Set up a new project with 'on the fly' projection enabled and project SRS set to EPSG:31468
add the aerial image
add OpenLayers plugin OpenStreetMap layer

The layers positions fit somewhere in the left part of the canvas (screenshots below, green) but dragging the map canvas a few hundred meters causes positioning gaps of the same area (screenshots below, red):

Correct position left of the map canvas:

Dragging 300m N:

Dragging 800m E:

According to the comment to ArcGIS for Desktop 10.4 - aerial images not in correct postion I tried to set up a transformation as shown below, but this seems to have no effect. What might be the reason for this behaviour?

Transformatino settings


texts:
I wrote a script in ArcGIS Pro Notebook. It runs there perfectly. Now I try to create a tool with the script. ArcGIS has problems to read my "codeblock" in CalculateField correctly. I think it is bothered by the form of the comment. I already tried "\ (backslash)" as a simple line break in a string with no "#" comments in the codeblock, that didn't work because of the indentation rules. I also try the comment in "([...])" and it didnt work. Does anyone have an idea how I can make the codeblock understandable for the ArcGIS Pro Python Intepreter? Here is my snipplet:
```
spalteAGSName = arcpy.GetParameterAsText(3) #GetParameterAsText(0)-(2) is before
spalteHausnummerVon = arcpy.GetParameterAsText(4)
spalteHausnummerBis = arcpy.GetParameterAsText(5)

inTable = tabelleName
fieldName = "FALL"
expression = f"fallkalk({spalteAGSName}, {spalteHausnummerVon}, {spalteHausnummerBis})"
codeblock = """
def fallkalk(agsn,sthnr,endhnr):
    f = "F" #fehlerhafter Wert
    s1h = "S1H" #Straße hat nur ein Haus
    sges = "SGES" #Straße gesamt
    svon = "SVON" #Hausnummern haben eindeutigen Anfang und uneindeutiges Ende
    svonbis = "SVONBIS" #Hausnummern grenzen einen Bereich ein
    if agsn is None:
        return f
    elif sthnr == endhnr and sthnr is not None:
        return s1h
    elif agsn is not None and sthnr is None:
        return sges
    elif sthnr is not None:
        if endhnr == 9997 or endhnr == 9998 or endhnr == 9999:
            if sthnr == 0 or sthnr == 1 or sthnr == 2:
                return sges
            else:
                return svon
        return svonbis
"""
arcpy.CalculateField_management(inTable, fieldName, expression, "PYTHON3", codeblock)


texts: AttributeError: Error in getting tool information when using TableToTable tool

texts:
I am trying to use the arcpy.TableToTable_conversion tool in my python script, but seem to be getting the following error on the line

arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable)

The full traceback is

  Traceback (most recent call last):
    File "", line 1, in
    File "c:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1463, in TableToTable
      raise e
  AttributeError: Error in getting tool information

The variable "FINAL_NLPG" is a table view of a join which contains approximately 999 records (the full table is 4.5 million records).

Any ideas on what might be causing the exception?

EDIT***

for file in list_files:
    if file.startswith("Type_15"):
        arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t15") #Row created to get a OID in table
        arcpy.MakeTableView_management(r"in_memory\t15","T15_view")
    if file.startswith("Type_21"):
            arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t21")#Row created to get a OID in table
            arcpy.MakeTableView_management(r"in_memory\t21","T21_view")
    if file.startswith("Type_24"):
        arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t24")#Row created to get a OID in table
        arcpy.MakeTableView_management(r"in_memory\t24","T24_view")

    #Join Table 15 with  Table 24 based on USRN
arcpy.AddJoin_management("T24_view", "USRN", "T15_view", "USRN", "KEEP_COMMON")

#Join Table 21 with  Table 24 based on UPRN
arcpy.AddJoin_management("T24_view", "t24.UPRN", "T21_view", "UPRN", "KEEP_COMMON")

arcpy.MakeTableView_management("T24_view","FINAL_NLPG","OBJECTID < 1000","") ## <1000 to see if the code works
arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable) # FAILS HERE
arcpy.TableToTable_conversion("FINAL_NLPG", "in_memory",outputTable) #saving to in_memory --- SAME PROBLEM

My source files are CSV's which is the reason i am having to copyrows in_memory to get OID field, as from what i read i cannot do a join on a table that does not have an OID field.


texts: Create point at every vertices of feature

texts:
I have a layer with polygons and one with points at every vertices of polygon ( so I can label them with a number). I want to create a point at every new or modified vertex with virtual layer.
At the moment I use extract vertices and copy the new ones in point layer but I would like to do this automatically when a new polygon is created or modified.
Also if it is possible to generate only vertices that doesn't have a feature in point layer ( new vertices).
Is is possible to do this in Virtual Layer ?
node_to_points(geometry) works but generates one feature with multiple points.


texts:
I need some advice regarding setting up a web map service/database. I need the database to have certain properties:

It can be displayed as a web map with certain layers that I made in QGIS. So that implies there should be a web link. I was looking at plug-ins like qgiscloud and qgis2web for this. The viewer can click on a polygon and all the information about the polygon should come up in a pop-up. Furthermore, there should also be an option of viewing a graph that shows statistics and changes in the attribute values of the polygons/rasters. And lastly, it would be nice if there is an option to show a simulation of changes in properties of the polygons/rasters.
On another website, I would like to create a form where selected people can input entries. When they submit these entries, the information should be sent onto the existing database and should automatically (with approval of an admin) create a QGIS layer reflecting the information. The new information should also be reflected on the web map service.

I am relatively experienced with programming, but I am not very sure how to set up such a database and display it on the web.

Can you make any recommendations for platforms/softwares that would enable me to perform these 2 functions?


texts: Exporting 16 bit single-band to 8 bit in SAGA

texts: Is there any possibility exporting 16 bit single-bands to 8 bit like in qgis (gdal_translate)? Additionally in SAGA there is no option to save raster with rendering, right?


texts:
I have a QGIS project that uses a table with PostGIS geometry from a PostgreSQL server in the cloud, I have a username and password to connect. In QGIS it is requested to enter username and password to load the project and it works normally, but when taking the same project to QField an error of "Connection to database failed appears. fe_sendauth: no password suplied" and does not ask to enter username and password.
How should the project be configured so that it requests the username and password and allows displaying PostGIS tables from QField?


texts: Reading FeatureLayer Attributes into 2D JavaScript Array in ArcGIS API for JavaScript

texts:
I am wondering if/how attributes of a Hosted Feature Layer can be read into a 2d Javascript Array using ArcGIS API for JavaScript 4.x?

I need a 2D Matrix of all attributes values to run some analysis.


texts: I am trying to load a georeferenced .tiff file into the map canvas in a Qt application. While it is displayed when the application is running on my laptop, the same image does not get loaded into the canvas when the application is running on another laptop. The error message says that the layer is invalid. I have tried to add every dll and lib file that I was using on my laptop but the problem persists. What could I be missing?


texts: Spatial-analyst, detecting bad ones from good positions GPS coordinates with QGIS?

texts:
I'm curious if someone else has been thru this problem and how it was solved.

Many years back people marked the position manually on a map to get waypoints of for example electric wire connection hubs, (I will call them "map-points") before we had smartphones with GPS utilities. This manually positioning inserted lots of really bad errors as people where good and bad to relate maps to real places.

Today I have collected several months of data from smartphones as they scan this positions once a day visiting. I want to use this data to update the positions - coordinates for the "map-points".

The problem is that smartphones are not the best devices for quality accurate positions. It can be from one meter to several kilometres in difference and I guess all depends on many parameters. But many of the positions are pretty darn good enough to use I think, I don't need exact 1 meter precision, if I can get within 10-15 meters all are great or at least within 25-50 meters.

First I want to find and select the bad ones (waypoints) from the good ones and remove them from the calculation to get as good data as possible for finding the best position. What I did was using QGIS running "join by lines" as the map-point and scan data has a related ID. From there I got the length of the line so I could see the distance for all scan data positions to the map-points. I added the distance to the scan data and run "statistic by categories" to get the median value of the distance from each connected map-points and then took this value to calculate the difference for each scan points (distance - median_value). I then divided the difference to the median value to get the percentage and used this to try to "pinpoint" the bad ones from the good ones. Below are some images... The green dot is the (manually done)map-point and red dots are the calculated "bad guys" and blue dots the "good" ones to use.

Next step I used the blue dots to get the median x/y-coordinates and use them to update the map-points coordinates.

Is this a good approach?

Any suggestions to refine this as I can see there could be more improvements but it takes to many steps into my approach. I have not seen this topic before in forums so I thought I'll check here.

This is the last step to pinpoint the bad ones (by trial and error)
"stat_median" = the distance_median value in meters (from map-points)
"diff" = the difference_value/distance_median. As you can see it is not perfect but better than do nothing...

 "stat_median" < 10 AND "diff" >= 2.00
OR
"stat_median" >= 10 AND "stat_median" < 25 AND "diff" >= 1.00
OR
"stat_median" >= 25 AND "stat_median" < 50 AND "diff" >= 0.60
OR
"stat_median" >= 50 AND "stat_median" < 75 AND "diff" >= 0.30
OR
"stat_median" >= 75 AND "stat_median" < 100 AND "diff" >= 0.23
OR
"stat_median" >= 100 AND "stat_median" < 200 AND "diff" >= 0.20
OR
"stat_median" >= 200 AND "stat_median" < 500 AND "diff" >= 0.17
OR
"stat_median" >= 500 AND "stat_median" < 1000 AND "diff" >= 0.15
OR
"stat_median" >= 1000 AND "stat_median" < 2000 AND "diff" >= 0.10
OR
"stat_median" >= 2000 AND "stat_median" < 5000 AND "diff" >= 0.05
OR
"stat_median" >= 5000 AND "diff" >= 0.02


texts: Is there any limitations on using OpenStreetMap with Leaflet or OpenLayers in request count?

texts: I have a project that needs an online map to determine customer current location and store location, so calculate the distance between them and the price of shipping. If this app can be able to navigate shipping vehicle from store to customer location is better. I used to get GoogleMaps API first but it has limitations and must be paid. So I want to change GoogleMaps location service in my project with open source ones and I decided to use Leaflet or OpenLayers those using OpenStreetMap. Now I don't know if there is exist any limitation same the GoogleMaps in request numbers. May I ban for extra requests or something?


texts:
I try to connect Leaflet search plugin to my map with GeoJSON data. But when I enter a search query in browser inspector I get error: layer.getBounds is not a function in leaflet-search.js. You can see it on http://ignn.ru/test/ (try to input "Volgograd" or "Alaska")

var searchControl = new L.Control.Search({
        layer: ggg,
        propertyName: 'name',
        marker: false,
        moveToLocation: function(latlng, title, map) {
            //map.fitBounds( latlng.layer.getBounds() );
            var zoom = map.getBoundsZoom(latlng.layer.getBounds());
            map.setView(latlng, zoom); // access the zoom
        }
    });
map.addControl( searchControl );

I did this on example http://labs.easyblog.it/maps/leaflet-search/examples/geojson-layer.html

ggg: layer with geojson data

I understand because of this error the reason that do not give you any search results.

GeoJSON data - http://ignn.ru/test/test.js

Update:
In data there is a single object of type point. When I remove it, everything works. But I need the elements of type point.


texts: Viewing File Geodatabase table in Excel with link not export?

texts:
I have a situation where I need to create a regular report from information in a file GDB (10.6) attribute table.  I would like to avoid exporting the info to CSV each time I run the report, then importing into Excel, and would prefer to link the two so I just open the excel file, refresh to the current data in the gdb, and then save as PDF.

I know an .mdb can be linked but can excel read a .gdb table?


texts: arcpy DLL load failed in standalone script

texts:
I have python 2.7 x64 bit and I have ARCGIS 10.5 x32 bit on windows 10.

I try to build standalone arcpy scripts but I take all time :

ImportError: DLL load failed: % is not a valid Win32 application.

where I want to import arcpy.

that error is because I have python 64 bit and ARCGIS 32 Bit.

but it possible to install arcpy x64 bit(or ARCGIS 10+ 64 bit with arcpy 64 bit) with the some way ?


texts: openLayers and geoserver: WMSGetFeatureInfo does not return feature beyond wrapdateline

texts:
I built a map made of several layers. I need to display the layers features fields at the place where the user clicks (see the controler code hereafter).
The layers are correctly displayed and go across the dateline. If the user click on a feature, its fields values are written in a div. However, if I click on a feature beyond the dateline, my controler returns nothing.
How can I force it (or force geoserver?) to consider clicks beyond the dateline?

[...]
var options = {minResolution:minResolution, maxResolution:maxResolution,
        controls:[new OpenLayers.Control.PanZoom(), new OpenLayers.Control.NavToolbar(), layersSwitcher, graticule]};
var map = new OpenLayers.Map("map-id", options);
[...]

var map = new OpenLayers.Map("map-id", options);

var infoGnrl = new OpenLayers.Control.WMSGetFeatureInfo({
               url:'http://mysite.org/geoserver/ocean/wms',
               title:'identify feature by clicking',
               output:'features', infoFormat:'application/vnd.ogc.gml',
               format: new OpenLayers.Format.GML,
               eventListeners: {
                getfeatureinfo: function(event) {
                    eezName='';
                    lmeName='';
                    if (typeof(event.features[0])=='undefined'){document.getElementById('infoGeneral').innerHTML='&nbsp;'; return};
                    for (ii=0; ii< event.features.length; ii++){
                        thisEEZNAME=event.features[ii].attributes['eez'];
                        thisLMENAME=event.features[ii].attributes['LME_NAME'];
                        if (typeof(thisEEZNAME)!='undefined') {if (eezName=='') {eezName=thisEEZNAME} else {eezName+=', '+thisEEZNAME}};
                        if (typeof(thisLMENAME)!='undefined') {if (eezName=='') {eezName=thisEEZNAME} else {lmeName+=', '+thisLMENAME}};
                    }
                  document.getElementById('infoGeneral').innerHTML=eezName;
                }
               }
            });


texts: Counting number of points closest to line (Spatial Join) using ArcPy/ModelBuilder?

texts:
I am trying to get a count of the number of points (join feature) that are closest to each line (target feature) through a spatial join. By going to the table of contents and conducting the spatial join through a right click, spatial join, join all points closest to a line (without checking a feature) - I can achieve the desired result. The desired result is a count field indicating the total number of points closest to every line. However, I have to carry out this process far too many times to do it manually through clicking the spatial join in the table of contents. Thus, I need a way to automate this process to join points to lines and have been attempting to do it using ArcPy.
The ArcPy options seem to work like a spatial join conducted using the toolbox. Which provides options for intersect, closest to, distance etc... however, none of the options function the same way when attempting to join points to lines as the table of contents spatial join does. I cannot use a search distance because it is not uniform across all points and lines to accurately count the number of points closest to each line.
Is there anyway to count the number of points closest to lines using a spatial join process that can be automated in ArcPy or ModelBuilder?
I just the need count.


texts: ArcPy importing error after setting path?

texts:
This questions has been asked before too and I did go through most of the suggestions. Things I have tried so far: setting up correct  path variable environment, installing anaconda 32 bits, python 2.7, or even switching to python 2.7 in cmd while initially using Anaconda 3 , adding Desktop 10.4.pth file with
following path.

C:\Program Files (x86)\ArcGIS\Desktop10.4\bin
C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy
C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolBox\Scripts

I also added those paths in environment variable

These suggestions help me to reduce the error. But Now I am getting a different error. Looks like python can find arcpy but missing another package.

Getting this error while trying to import arcpy in python 3.6.

File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\__init__.py", line 22, in <module>
    from arcpy.geoprocessing import gp

  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *

ModuleNotFoundError: No module named '_base'

Any suggestions?


texts: My AddLayer script doesn't work within a model but works well on its own

texts:
I'm trying to write a script in order to add a output to display
(For some reasons I want add the data using a script)
This is my script:

import arcpy.mapping as mapping

mxd = mapping.MapDocument("current")

Input = arcpy.GetParameterAsText(0)
df = mapping.ListDataFrames(mxd)[0]
print df.name
    layer = mapping.Layer(Input)
print layer.name
mapping.AddLayer(df, layer,"TOP")

# Refresh things
arcpy.RefreshActiveView()
arcpy.RefreshTOC()

It adds the data without any problem when I run it individually. (Not as a step of a model)
But when I add it to a model, as a final step, it does not work or either doesn't generate any error. It seems that the model skips or ignores the script and I don't understand why.
Can anyone help me please?

This is the model sample :

This is the script properties:


texts: I am working with ArcMap and C#. In the bottom left hand corner, there is a menu where you can toggle between Data view and Layout View, a Pause button, and a refresh button. I have created an Add-in for ArcMap. I need to run some code when the Refresh button is clicked. Does anyone know the name of the event handler that controls the Refresh button? Or would anyone have some type of example where some code runs every time the Refresh button is clicked?


texts:
I want to use v.kriger from GRASS through sextante QGIS 2.0, but this command is not here. But I find, in C:\OSGeo4W\apps\grass\grass-7.0.svn\scripts, the command as a python script.
How can I use this command in qgis?


texts:
I'm trying to load a raster in .tif format that is in EPSG 42303. I use the following
raster2pgsql -d -C -M -I -s 42303 -t 100x100 filename.tif schemaname.tablename | psql -d dbname -U username

The PostGIS table then has a SRID of 42303, per ST_SRID(rast). However, in the spatial_ref_sys table, SRID 42303 does not exist. Rather, 97965 appears to be the correct SRID for PostGIS (by authority sr-org rather than EPSG), and the values in spatial_ref_sys for 97965 match what I expect.
The raster views correctly in QGIS regardless. But when I try and correct the SRID to 97965 as follows:
UPDATE tablename set rast= ST_SetSRID(rast, 97965) ;
the raster no longer projects correctly in QGIS.
How can I get the projection to register correctly in PostGIS?


texts: Getting current user location automatically every "x" seconds to put on Leaflet map?

texts:
I need to get the current user location automatically every "X" seconds (5 or 10 sec.) and put it on a simple Leaflet map.

I've seen the Leaflet on Mobile sample here http://leafletjs.com/examples/mobile.html ...

<!DOCTYPE html>

    <title>Leaflet mobile example</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />

... and could be useful as starting point for me but I don't know how to refresh the current user location without refresh / reload all the map, that obviously it's not the solution.

Does someone have any sample code that could help me?


texts: Using features of CARTO Builder to dynamically calculate the average of selected columns

texts:
I am trying to find a simple way to calculate the average of selected columns (avg per row) dynamically in CARTO, using only the pre implemented features of CARTO Builder so that it is as user-friendly as possible and does not require manually running SQL code for each calculation.

My underlying dataset contains several columns score1, score2, etc. I would like to compute a new column avg_selected_cols based on the user input (say columns score1, score3 and score4) that contains (score1+score3+score4)/3. Ideally, the columns should be selected through some widget to make it as easy as possible.

So far I am using a sync table from Google Drive that calculates this average with AVERAGEIF clauses based on a row where I just set an "x" for each column I want to include. Synching from Google Drive, however, can be done at most every 15 minutes but I need the map/ data to update almost instantly.


texts: How to listen for the start of a Protocol event?

texts:
I have a service that sometimes takes awhile to provide a response. I'm trying to capture the initial call to the service so that I can put a "Loading...please wait" message until I get the response. I can't seem to find a way to get at the ajax portion of the HTTP Protocol request.  Essentially, I'm looking for something analogous to jquery's ajaxstart. Has anyone done this or know how to do this? I looked into Openlayers event listeners, but couldn't find much there that helped.

var myVectorLayer = new OpenLayers.Layer.Vector("My Vector Layer", {
      projection: "EPSG:4326",
      strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})],
      protocol: new OpenLayers.Protocol.HTTP({
          url: "./resource/getData.php",
          params:{
              zoom: me.map.getZoom(),
              density: 1
          },
          format: new OpenLayers.Format.JSON(),
       // Over-riding handle Response to get at feature attributes
          handleResponse : function(resp, options)
          {
            var request = resp.priv;
            if (options.callback)
            {
              if (request.status >= 200 && request.status < 300)
              {
                // success
                if (resp.requestType != "delete") {
                  resp.features = this.parseFeatures(request);
                }
                console.log('success');
                resp.code = OpenLayers.Protocol.Response.SUCCESS;
              } else
              {
                // failure
                resp.code = OpenLayers.Protocol.Response.FAILURE;
                console.log('failed');
              }
              options.callback.call(options.scope, resp);
            }

            me.updateData(resp.features);

          }
        }),


texts: Python script to import CSV data to a geodatabase

texts:
I am trying to import CSV data into an existing geodatabase in ArcMap. I want to import to the existing geodatabase fields to ensure my CSV data satisfies whatever rules are set up in the geodatabase.
This is my Python script:
import arcpy
from arcpy import env
env.workspace = "C:/GISJobs/workspace"
arcpy.TableToTable_conversion("Trapping.csv", "C:/GISJobs/workspace/GDB_BLANK.gdb", "Trapping")

But I get this error:

Runtime error  Traceback (most recent call last):   File "",
line 5, in    File "c:\program files
(x86)\arcgis\desktop10.6\arcpy\arcpy\conversion.py", line 2276, in
TableToTable     raise e ExecuteError: ERROR 000258: Output
C:/GISJobs/workspace/PWIS_GDB_BLANK_181106.gdb\Trapping already exists
Failed to execute (TableToTable).

I don't have the geodatabase open anywhere. The script works perfectly to create a new table, but not to write into an existing table. Any ideas?


texts: CartoDB QGIS plugin: export/import projection shift?

texts:
Original datasource is a postgis db table "Verkavelingen" using epsg 31370 as is my project file EPSG:31370 OTF

I have used CartoDB QGIS plugin to export that table to a dataset on CartoDB "verkavelingen20151107" and import that dataset back again in QGIS.

As you can see below my data has 'shifted' somehow and is not on its original location...
Same shift happening when viewing data on the CartoDB website.

Using CartoDB SQL command SELECT ST_Srid(the_geom) FROM verkavelingen20151107 I see my data is in 4326.

Using OpenLayers plugin in QGIS my original dataset shows up fine on Google/OSM background layers.

I'm using QGIS 2.12 & postgresql 9.4.5

Can someone help me out ?


texts: Is it possible to set up the Django Admin to be able to upload shapefiles to PostGIS? Right now I have it set up so that you can draw administrative areas but what I would like is to have an 'import shapefile' or 'upload shapefile' option, so that other admins can upload shapefiles instead of having to draw them.


texts: How to use a feature class attribute to look up values in a table and pass them as parameters to a function?

texts:
My problem:

I have a set of points inside a polygon. My goal is to figure out how long it takes (in days) for each point to move outside the polygon, based on a daily movement which affects all the points the same way. Once each point leaves the polygon, it should stop moving. Each point has a starting date. I have a table containing dates and the X and Y values by which to shift points on each day (it varies daily). I'll be using this Shift function to move the points. Looking at the table, I'd expect the points to move in one general direction for a week or so before landing outside the polygon.

My process is something like this. FYI, each point has a Start Date (which won't change) and a Current Date, which will be used to look up the appropriate X and Y shift, and will ultimately be used to determine the days it takes for the point to move outside the polygon.

Select points which are inside the border polygon.
Iterate over the points, shifting each according to the Current Date and then incrementing its Current Date by 1 day.
Return to #1.

I have part of a Python script written (below), but I'm still kind of a beginner to Python. My current stumbling block is figuring out how to look up the appropriate shift values in my table based on the Current Date in the point layer, and pass them on to the Shift function to get the points moved each day. Also, since I want to increment the day by 1 when I do that, it seems like I should be adding that step to the Shift function.

Here's what I have so far:

import arcpy
import csv #My shift values table is a CSV, I also converted it to an FGDB table

def shift_features(in_features, x_shift=None, y_shift=None):
    with arcpy.da.UpdateCursor(in_features, ['SHAPE@XY']) as cursor:
        for row in cursor:
            cursor.updateRow([[row[0][0] + (x_shift or 0),
                               row[0][1] + (y_shift or 0)]])

    return

#Specify input files
startPoints = r"C:\GIS\Data.gdb\Start_Points"
shiftedPoints = r"C:\GIS\Data.gdb\End_Points"
borderPolygon = r"C:\GIS\Data.gdb\BorderPolygon"
shiftValuesTable = r"C:\GIS\Data.gdb\DailyShiftValues"

#Create a copy of the source file so the output can be compared to the input
if arcpy.Exists(shiftedPoints):
    arcpy.Delete_management(shiftedPoints)
arcpy.Copy_management(startPoints,shiftedPoints)

#Import the X and Y values to use for shifting from the source CSV and add them to a dictionary
#I had tried making the CSV into a dict with the date as the key and a list of the X and Y shifts
#as the value

#Create Feature Layers from input features
arcpy.MakeFeatureLayer_management(shiftedPoints, "pointLayer")
arcpy.MakeFeatureLayer_management(borderPolygon, "polygonLayer")

#Select points in the source data which are inside the area to be shifted.
#These are points which have not yet exited the polygon.
arcpy.SelectLayerByLocation_management("pointLayer", "WITHIN", "polygonLayer")

#my current problem:
shift_features("pointLayer",X Value from Table for the date,Y Value from Table for the date)


texts:
I have latitudes and longitudes from a GPS unit which uses WGS84, and would like to project those to some kind of plane.

I'm totally new to this, but after a lot of reading it sounds like UTM is a good projection to use. According to the Wiki page on UTM, I'm in zone 34H (a very nice place to live, by the way).

I found two python modules to help me do this:

(1) Using pyproj, which wraps Proj4:

from pyproj import Proj
p = Proj(proj='utm', ellps='WGS84', zone='34H')
lat, lon = -34.228258, 18.413602
p(lon, lat)

Which results in:

(261762.5589262726, -3790491.0744062006)

(2) Using utm:

import utm
lat, lon = -34.228258, 18.413602
utm.from_latlon(lat, lon)

Which results in:

(261762.55890839838, 6209508.925565818, 34, 'H')

As you can see, the y values differ, but the x values are the same for all practical purposes. It looks like the y values are shifted by about 9999999.999972, but not scaled. So it seems that these modules are using different origins for the xy plane.

Which one is right?
How can I change it using either module?


texts: Converting list of raster to a data frame using R?

texts:
I could read many rasters as one list of ratsers but when I want to convert them to data frames I get an error.

Is there any way to convert them?

library(raster)
Pro <- function(s) {
  df <- stack(s)
}

files <- dir("path", recursive=TRUE, full.names=TRUE, pattern=".tif$")

agg <- sapply(files, Pro)

df <- as.data.frame(agg)


texts: Reducing area of polygons using ArcObjects with C#?

texts:
I want to reduce the size of my selected polygons. In other words, I want to implement the "scale" program which is in the editor section of ArcGIS. For that purpose I have searched a lot and just found the example for point features as following. But my problem is that when I copy this code to visual studio, it doesn't work and also I don't know how to use it for polygons.

        IPoint startingPoint = new PointClass() as IPoint;
        startingPoint.PutCoords(10, 10);
        //Create a point to act as origin
        IPoint origin = new PointClass() as IPoint;
        origin.PutCoords(15, 15);
        //Cast the startingPoint into the correct Interface
        ITransform2D transformScalePoint = startingPoint as ITransform2D;
        //Perform Scale
        transformScalePoint.Scale(origin, .5, .5);
        double x;
        double y;
        startingPoint.QueryCoords(out x, out y);
        Debug.Print(x.ToString());
        Debug.Print(y.ToString());


texts: Check Field Type and After Add a New Field

texts:
I just started to code in Python and have a problem with this code. I am trying to verify a field type, and after that, if the value returns false, add a new field and calculate.

The problem is: every time I run the script a new field is added even if the condition is True.

How can I solve this?

import arcpy

Base = "PATH"

fields = arcpy.ListFields(Base)

for field in fields:

    if field.name == 'TEST' and field.type == "Float":
       print("Ok")
    else:
       Field_Name = "TEST2"
       Field_Type = "FLOAT"
       Field_Name__2_ = "TEST2"
       Expression = "!CODE!"

       Output_Feature_Class = Base

       arcpy.AddField_management(Base, Field_Name, Field_Type, "", "", "", "", "NULLABLE", "NON_REQUIRED", "")

       Output_Feature_Class = Base

       arcpy.CalculateField_management(Output_Feature_Class, Field_Name__2_, Expression, "PYTHON_9.3", "")


texts: Automating alignment sheet band-data on map with ArcMap and ArcPy?

texts:
Anyone have some logic or code samples to automate creating band data for alignment/integrity pipeline sheets showing various point/polyline events along the pipe in configurable way or otherwise ArcMap 10.0 and Arcpy?  Even logic or code in ArcObjects would be helpful.

I've seen some applications use polygons and polylines to build the border and band elements like tick marks and the pipeline representation in the band.  It seems like final printed sheet dimension output would need to be a configurable variable.  What else?


texts: Using 10.1 ArcGIS, how can you SELECT the parcel tract and MOVE IT to another part of the map? I have done that by accident in the past, but when I do need to do that, can't figure it out.


texts: Making working copy of file geodatabase in same folder?

texts:
I am trying to create a working copy of the Lesson 5 geodatabase shown in the screen capture so I can work with the metadata. I can't recall how to do that. Should I simply right click new>

Then name it, then copy and past the two features?  I tried it and paste is not available in the new working file


texts: Is there a way to change symbol size units dependent on scale?

texts:
Is there a way to change a layers symbol size from paper units(mm) to map units(m) once you hit a certain scale without adding duplicates of each layer?
QGIS 12.2


texts: Difference between Garmin eTrex Legend HCx and eTrex 30?

texts:
I have used etrex Legend HCx a lot and been satisfied. Now I've seen etrex 30 just for a while and it seems to me that the Legend is much more user friendly, good old menus with a lot of functionality, the display is great, whereas the display of etrex 30 feels a bit junky and cheap - it's kind of blurred.... I don't really understand why, as 30 is newer model. So why 30 seems to suck?

But I've not tested the eTrex 30 in the field. Can you please tell me what are the differences between these models? Is eTrex 30 more precise? I found no precision specificatin for it. For HCx it should be 15 meters.

I tried to find eTrex legend HCx on Garmin.com but I was not successful.


texts:
I'm trying to create a map which I can place points on within my application I found some mecator jpg images but in order to accurately place points I need to convert  the lat/long to pixels so that the data is accurately displayed on screen. I've been following this tutorial

http://jkfill.com/2011/03/18/placing-geo-coordinates-on-an-image/

When trying to calculate the globe width and centre point of the map I simply took the pixel width and the center point of the pixels. i.e if the image is 100 x 100 then the globe width is 100 and the center point (50,50) although I now think this is incorrect?

How can I calculate these points? Alternatively can anyone recommend map images with this data available?

Thanks


texts: Blank map with a single layer while using MapServer

texts:
I am just tying to render a map with single layer using map server and I get a blank output.
Below is how the map file looks like

MAP
  IMAGETYPE PNG
  SIZE  900 900
  EXTENT    37.078266 6.747135 68.172030 97.403297
  SHAPEPATH "E:/GIS Data/INDIA/2001_State.shp"
  IMAGECOLOR    255 255 255

    LAYER
        NAME    '2001_STATE'
        DATA    '2001_STATE'
        STATUS  OFF
        TYPE    POLYGON

     CLASS
        NAME "2001_STATE"
        STYLE
          COLOR 232 232 232
          OUTLINECOLOR  32 32 32
        END
     END
    END
END

I have saved this map file as prac1.map

The following is the URL I am trying to hit for the above map file

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/prac1.map&mode=map&layer=2001_State&

Any help would be appreciated.


texts: Get all records 60 degree North in SQL with query on Latitude-Longitude Column?

texts:
I have table with latitude & longitude columns in SQL.
how can I select all records with lat-long 60 degree North or greater (Arctic Region)


texts: Dynamically adding WFS layer features with Geoserver

texts: I am investigating using Geoserver to output new WFS layer features dynamically. We have a backend process that will be generating new WFS features periodically that will be placed in a datastore (most likely PostGIS). I plan on creating a WFS layer for the feature data in PostGIS. The idea is to have the backend process dynamically add new features into PostGIS and my expectation is that clients making WFS features requests using Geoserver will get the new feature data I am adding at runtime. Is this the case? I can't seem to find any documentation discussing what happens when the datastore's data is updated.


texts: Getting Reconcile Versions geoprocessing tool published as ArcGIS Server service to work with new version?

texts:
After publishing the Reconcile Versions GP tool to ArcGis server 10.1, it can be successfully invoked via REST but only on versions existing at the time the service was published. If a new version is created the service fails. The error is:

  ERROR 000622: Failed to execute (ReconcileVersions). Parameters are
  not valid.\nERROR 000800: The value is not a member of...(list of version names)

Is there some way to publish this tool so it can reconcile versions that are created dynamically?


texts:
Our problem is that we need to convert a shapefile to raster. Then, we need to generate tiles from zoom 15 to zoom 17 (2millions tiles to 16millions tiles).

Before we were using this methodology:

Step 1 : Import shape in QGIS, then generate a raster
Step 2 : Then we change the color/opacity of the raster using QGIS as well.
Step 3 : we generate a new raster (tif) of 1Tera Byte (~1TB).
Step 4: we use gdal2tiles to generate tiles.

This works fine. But the image is so big in size that it takes a while to tile.

But, now, we use directly GDAL as follows:

Step 1: gdal_rasterize to convert a shape to raster in the right
color/opacity
     with compression. It generates a raster of 1GB.

gdal_rasterize -of GTiff -co BIGTIFF=IFNEEDED -co COMPRESS=DEFLATE
               -burn 102-burn 120 -burn 42 -burn 255 -co PREDICTOR=2
               -co ZLEVEL=9 -ot Byte -a_nodata 255 -a class
               -ts 500000 500000 -l input C:/input.shp C:/output.tif

Step 2: we want to generate tiles but gdal2tiles is hanging for a while just to generate a single tile. Maybe it does not support
compressed file for tiling.

Any idea how to proceed?


texts: Is it possible to find the Map Services URLs used in ArcGIS Flex or Silverlight web applications?

texts:
With the ArcGIS Server JavaScript API, you can find the URLs in the map services in the source code. Do the Flex and Silverlight APIs completely obfuscate the map services URLs?

As an example, the County of Ventura has this web application in Flex. However, there doesn't seem to be a way to find the rest services URLs for the map services that one could use in their own applications/mashups. Perhaps obfuscation is the point to using a compiled web application vs the JavaScript API?


texts: Big performance difference reading shapefiles between QGIS and R

texts:
I'm trying to read the belgian landuse ESRI shapefile from geofabrik.de:

http://download.geofabrik.de/europe/belgium.html

In QGIS it's just a matter of seconds, but in R using the readOGR function my RAM (4gbs) fills and the reading process does not actually end even after several minutes.

I on a lenovo i5-4300 intel quadcore laptop with windows 7 on it and I use R studio Version 0.99.447 and R x64 3.2.1.

The code is the following:

shp.landuse <- readOGR(layer="landuse")

Is there a better way?


texts: Landsat NDVI collections, are they cloud filtered?

texts: I am wondering if the Landsat NDVI collections (e.g. https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT04_C01_T1_8DAY_NDVI) were cloud-filtered before their creation? I know these collections don't have cloud cover data in them to filter out, but what I'm trying to understand is whether cloudy images were filtered out before these NDVI collections were made.


texts: Where to get world-wide detailed administrative boundaries?

texts:
I'm looking to build a world map that plots all application users and their locations around the world. The initial zoomed out world view would show total numbers clustered by country, then when you click on these numbers it would zoom to that country and show a further clustering based on state/county within that country.

Where can I find data to produce these sort of visualizations? US State geojson data seems readily available but what about the rest of the world? What is the generic term for this level of zoom (states in US, counties in UK for example) to aid my search?


texts:
Is there a command directly in the QGIS field calculator that is equivalent to Excel's SUMIF (without exporting to a CSV file)?

I want to check whether the sum of items in the attribute table which fulfill a specific condition (same ID) is above or below a certain treshold.

=SUMIF(RANGE,CRITERIA,[SUM_RANGE])


texts:
I would like to iterate through all of the added layers in an ol.Map instance and only select the vector layers. So far I could get the individual layers with the a property of the resulting object of map.getLayers(). As you can see on the image below, a is an array and contains an object related to the corresponding layer.

The layers in the array are described with a letter (T for tile, V for vector). My question is, how to extract that information for my script to process?

I have read a related post with an answer using a .CLASS_NAME property, but the OpenLayers 3 ol.layer object doesn't have such attribute.

Any other approach to get the layer type or proven fact, that one can't get this property after the layer objects are constructed is considered as a correct answer.


texts: Visual Basic editor command icon is always disabled

texts:
I recently installed ArcGIS 9.3 in a PC with Windows 7.0. I opened an existing mxd file within which I developed some toolbars for a project. Each icon of a toolbar has behind it a VBA and ArcObjects code. Unfortunately, I noticed that icons are all missing and the symbol of each icon has been replaced by a red circle with a slahed line and the commnad of Visual basic editor under the Tools menu is always disabled-inactive, thus I cannot get in the VBA editor.

Can anybody help me please?


texts: OpenLayers style doesn't work on certain GeoServer WFS layer

texts:
I want to change styling of the GeoServer WFS layer using OpenLayers. The problem is, there is a layer that the style can be changed, but there are other layers that can't be changed.

Using this code

style: new ol.style.Style({
                image: new ol.style.Circle({
                    stroke: new ol.style.Stroke({
                        color: 'rgba(255, 0, 0, 1.0)',
                        width: 5
                    }),
                    radius: 5
                })
            })

I can change this layer (SRID : 4326) to like this

But the style can't be applied to the other layer that has SRID : 32663. No matter what kind of style that I try (stroke, fill, color, image), it will always show up like this (block shape)

I imported these layers from PostgreSQL database. Looking at the geometry projection, the successfully changed layer has point-shape like this

SELECT ST_AsEWKT(geometry) FROM "table1" LIMIT 1;
result : SRID=4326;POINT(126.8865913 37.2598192)

geom sample : "0101000020E6100000C39A6FE9BDB85F40BB6F6BC141A14240"

Meanwhile the unsuccessfully changed layer has block-shape like this

SELECT ST_AsEWKT(geometry) FROM "table2" LIMIT 1;
result : SRID=32663;MULTIPOLYGON(((14240035.8111278 4485667.02788355,14239940.2255882 4485585.20329766,.........

geom sample : "0106000020977F00000100000001030000000100000005000000CDA1878968066B41EE70C72749445141284876F45D066B418F4696B13144514100B1FC4552066B41989893F24644514160E00CDB5C066B415B95DD685E445141CDA1878968066B41EE70C72749445141"


texts: How I can associate GeoServer workspace with role by GeoServer REST API?

texts: I have a new role in GeoServer I called name "Company" moreover some workspaces with different name also, I am going to know how I can associate my workspaces with "Company" role but only through GeoServer REST API not web admin GUI?


texts: QGIS Lyon 2.12, select by location tool crash

texts:
I'm trying to select points from a vector point layer (quite big ~2 million points), that are within a coastline polygon for the gulf of california. The area is in the south with quite a complex coastline.

I'm trying to remove the points that are over water into a new dataset.

Using the select by location tool (i.e. select points within land polygon and delete), QGIS crashes, I can only assume due to the complex nature of the coastline and the amount of points it has to iterate through.

I've tried using the clip tool, i.e. clip points using a polygon that represents only the ocean, again I left it running overnight and by morning it was less than a third done. (most of the points are over the water)

Are there other ways to solve this problem? Or is it best to leave the clip tool running for as long as it takes?


texts:
I've set up a tilestache server and I am displaying vector tiles from the service using leaflet and the leaflet-tilelayer-geojson script from:

https://github.com/glenrobertson/leaflet-tilelayer-geojson

This works great but the sample code displays all polygons using the same style.  I would like to display a different style (polygon fill color) for each polygon based on a field attribute.  Not totally sure how to do this on the geometryCollection that is created using leaflet-tilelayer-geojson javascript.  It would seem I need to create a style function but not sure how to do this on the geometryCollection.


texts: Generating full planet tiles from OpenStreetMap data?

texts:
i am tested using two scenarios,

1) First, i am used switch2osm for tile rendering. its good it handles many things. But it takes long days to pre-render all tiles and  it takes huge memory in TB.

2) Second, i am used tilemill to generate MBTiles and served using https://github.com/chelm/mbtiles-server But i dont know how much efficient for larger using.

Other than this, Is any other way serving Tiles for whole planet in efficient way.

Machine config : 1.5 TB and 128 GB main memory.


texts:
I have a list of POIs from around the world and their latlongs. I also have the database from all roads in the world. What I want to do is find the popular roads from all of these.

My idea was to check how many POIs are there on this road. Hence with the number of POIs and the popularity of these POIs (I have this) i can write a simple arithmetic function to approximate the popularity of the street

My question is: How can I determine that a POI exists on a road.Consider that I have a shapefile for roads and  as a table of POIs


texts: Can't set transparency to a RBG raster on QGIS

texts:
I need to display an RGB raster on QGIS, with Multiband Color render type. After I set the Contrast Enhancement option to No enhancement, this is how the image is displayed.

No issues so far, since it is the correct visualisation.
Unfortunately, when I set the transparency to 50% the colours are totally altered, as you can see in the following image.

There is not a transparency band, therefore I have set the Transparency Band option to None. Also trying to assign specific transparency band the result is basically the same.


texts: QGIS 2.0 Catchment areas by using a 1 hour walking time

texts: i would like to have catchment areas around my points which show the area of an one hour walk. I looked around and found information about using the hiking funktion for calculating a distance with the new plugin "walking time" and found instructions for catchment areas using a road network. But i couldn't find a solution for getting the zone which lies around an 1 hour walk of my starting point (using something like the hiker function and not road systems!). Is there anyone who could help me?


texts: Exporting model to Python script using QGIS?

texts:
I want to edit a few things to my model in QGIS 3.2.2, but first I need to convert this model to Python script.

Is there a way to do it?


texts: TSQL Geometry Query Requires conversion to string


texts: GDAL2TILES black triangels and no transparency

texts:
I refer to the Problem/Solution in this Article:
Output of gdal2tiles has black edges round it
I've the same problem and tried so many options and variations with no success. :(
I've some geotiffs (tif + tfw) with a black background (this shoud be transparent in the finels TMS).
First i create a VRT Layer by:
gdalbuildvrt.exe "C:\Tiles\huenenberg.vrt" "C:\Tiles\huenenberg/*.tif"
Second i create the TMS by GDAL2TILES by:
python3 C:/OSGeo4W64/bin/gdal2tiles.py --profile=mercator -s EPSG:21781 --processes=6 -z 10-15 -e -a 0,0,0  "C:\Tiles\huenenberg.vrt" "C:/Tiles/huenenberg/tileset/"
I tried with different options, but i cant't eleminate the black triangle-border.
I also tried first to reproject by gdalwarp with no success.


texts: How to discover why geomesa-accumulo gets stuck? Where are geomesa-accumulo logs?

texts:
After saving some data records using Spark Streaming, I usually check those records using the cli with the export command. The point is that sometimes it gets stuck: I would like to know why, but I don't know how. If then I check my simplefeatures with the following command, it gets stuck as well:

geomesa-accumulo get-type-names -u myUsername -p myPassword -c myCatalog

Are there any logs to check why geomesa-accumulo gets stuck? I can see that hdfs is ok since each node is up and runnning ("in service") from the browser console.


texts: This extension is corrupted : No module named qgscollapsiblegroupbox

texts:
I'm building a QGIS plugin, and I am making the GUI using Qt Designer.

Whenever I am using one of the "QGIS custom widgets" (in the present case, a QgsCollapsibleGroupBox) in my plugin window, it doesn't work anymore.
If it's a new plugin and isn't installed yet, it is flagged as corrupted, with the error "No module named qgscollapsiblegroupbox".
And if I modify the GUI of an existing plugin, I got the same error but with a bit more details :

  Traceback (most recent call last):

  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 219, in startPlugin
      plugins[packageName] = package.classFactory(iface)

  File "C:/Users/eltheo/.qgis2/python/plugins\myplugin__init__.py", line 34, in classFactory
      from .myplugin import myplugin

  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:/Users/eltheo/.qgis2/python/plugins\myplugin\myplugin.py", line 31, in
      from list_dockwidget import listDockWidget

  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:/Users/eltheo/.qgis2/python/plugins\myplugin\myplugin_dockwidget.py", line 30, in
      os.path.dirname(file), 'myplugin_dockwidget_base.ui'))

  File "C:\OSGEO4~1\apps\Python27\lib\site-packages\PyQt4\uic__init__.py", line 213, in loadUiType
      exec(code_string.getvalue(), ui_globals)

  File "", line 205, in

  File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)

  ImportError: No module named qgscollapsiblegroupbox

I had the same problem a couple weeks ago with a QgsFieldComboBox, so I guess the problem lies with all the QGIS custom widgets.

I've looked in the ui_myplugin.py file that it generated when the plugin is compilated, I've found a line at the very end, that seems to be the problem :

  from qgscollapsiblegroupbox import QgsCollapsibleGroupBox

I've try to put that line at the begining of the code with the other import, then to replace it with

  from qgis.gui import QgsCollapsibleGroupBox / from qgis.gui import *

But nothing changes, which is odd for the error should at least be different as there is no more mention of "qgscollapsiblegroupbox" in my files.


texts:
I have a KML file viewer made in OpenLayers using the following code:

var vector = new OpenLayers.layer.Vector({
        source: new OpenLayers.source.Vector({
          url: window.Laravel.baseUrl + "/" + item.items,
          format: new OpenLayers.format.KML({})

        })
      });

      this.mapshape.addLayer(vector);
      var vectorSource = vector.getSource();

      vectorSource.on("change", e => {
        if (vectorSource.getState() === "ready") {

          this.zoomAbove(vectorSource.getExtent());
        }
      });

the zoomAbove method has:

zoomAbove: function(extent) {
  this.mapshape.getView().fit(extent, this.mapshape.getSize());
},

I can view some files without problems as shown in the following image

the problem is with certain files showing only a blank map

I have opened the files in QGIS and they all have the same EPSG: 4326, what could be the problem ?

I update my question and add EXAMPLE KML files.

1.-This KML file is not visible
enter link description here

2.-This KML file is visible
enter link description here


texts: QGIS: creating user defined CRS from local CRS - tutorial?

texts:
Is there any tutorial or at least a list of commands on how to create a user defined CRS in QGIS from local coordinates so I can switch between projections in more or less laymans terms?

Specificly I have a simple cartesian CRS thats 5.000 by 5.000 m with a custom orientation.

I assume it is not as simple as to define various coordinates in their UTM or WGS84 counterparts?

I feel really stupid to ask this, but I really can't find any understandable information relating to my problem.


texts: Split selected feature with selected line from another layer in QGIS LTR 3.4.9

texts:
Can't seem to find that tool since I switched from QGIS 2.14 to 3.4.9
It doesn't seem to be included in the Advance Digitizing Toolbar like before.For now, I re-installed 2.14 since I need to use this tool but I would like to know how/if I can have it in the latest LTR 3.4.9 Madeira ? First picture is 2.14.22, second picture is 3.4.9 with the same toolbar missing the tool.


texts: How to remove unnecessary bands from .sid file (keeping file format)

texts:
An ImageMosaic layer created from .sid data containing 5 bands has black areas where data is missing and setting transparency parameter in GeoServer does not help as error appears:

Error rendering coverage on the fast path
java.lang.IllegalArgumentException: BandCombine: a row of the matrix does not have the correct number of entries, should be OpImage.getExpandedNumBands(source0.getSampleModel(), source0.getColorModel()) + 1.
BandCombine: a row of the matrix does not have the correct number of entries, should be OpImage.getExpandedNumBands(source0.getSampleModel(), source0.getColorModel()) + 1.

Tried adding

<RasterSymbolizer>
    <Opacity>1.0</Opacity>
    <ChannelSelection>
        <RedChannel>
            <SourceChannelName>1</SourceChannelName>
        </RedChannel>
        <GreenChannel>
            <SourceChannelName>2</SourceChannelName>
        </GreenChannel>
        <BlueChannel>
            <SourceChannelName>3</SourceChannelName>
        </BlueChannel>
    </ChannelSelection>
</RasterSymbolizer>

to the layer style but no result

gdal_translate -b ... in.sid out.sid can not output .sid files and outputs .tiff instead making data set larger which is undesirable


texts: Auto-generated field in ArcSDE for end user

texts:
The objective: Create a process where a coworker can open an .MXD, start editing, add a feature to represent a complaint, then add records in a related table to represent an inspection. Along the way, I want the coworker to be able to use a unique number that is auto-generated as part of a larger docket number.

I am using global IDs in a relationship class to relate the Complaint feature with the Inspections table. I am doing this so that I can easily hide the global ID field in the .MXD my coworker is using so there is no risk that they will accidentally break the relationship by changing the value.

The problem: The complaint feature needs to have another unique field with an incremental value that can be used to build a docket number. Object ID will not work because that can change, and because in an SDE environment the Object ID increases by 400 every editing session (before long the number would be way too large). So I basically need a project ID that will start at 0 or 1 and go up by one for every record that is added. I could then make this field read only in my coworkers .MXD so they can only view but not change it.

The kicker here is, I really want this process to be done automatically as soon as my coworker creates a new record during an editing session. I realize this is probably impossible, so is there a way to do it through a script that runs every night so the number is available for my coworker the next day? The important thing is that this number is always unique and is not repeated if, say, an earlier record is deleted (autoincrement field calculate would have this problem).

We are working with ArcGIS 10.2.2 in an SDE environment on a SQL server (I think Microsoft 2008 but not sure).


texts:
I work with large many (tens of thousands) of large (0.1-10 gigabytes) rasters in GDAL and Python and occasionally will see the following error:

ERROR 1: ZIPDecode:Decoding error at scanline [XXX], incorrect data check

This happens once every 10,000 files or so and I've been unable to reproduce it with a simple example. On the other hand it is reproducible on long computational runs.

I almost always work with rasters in compressed mode since their sizes are so large I'd otherwise be bottlenecked by the throughput to disk. I use the following GDAL creation options: ('TILED=YES', 'BIGTIFF=YES', 'COMPRESS=DEFLATE', 'BLOCKXSIZE=256', 'BLOCKYSIZE=256')

I have tried using LZW compression as well as various predictors and found that that helps in some rasters but other rasters will fail. So far the only way I've been able to avoid this bug is to work with rasters in uncompressed mode, but it is undesirable since my computation is then often throttled by disk throughput.

If relevant, here's an example of a full error stack that happened to me a few minutes ago:

ERROR 1: ZIPDecode:Decoding error at scanline 11264, incorrect data check
ERROR 1: TIFFReadEncodedTile() failed.
ERROR 1: workspace_global_sdr_dir/sdr_workspaces/3/1/9/8/ws_na_bas_15s_beta_448913/intermediate_outputs/pit_filled_dem_ws_na_bas_15s_beta_448913.tif, band 1: IReadBlock failed at X offset 4\
4, Y offset 6: TIFFReadEncodedTile() failed.

Does anyone have any experience with this type of error in GDAL, or any advice on how I should deal with large rasters, or any advice on how I could debug the issue?


texts: i.landsat.toar in GRASS 7.8.2 "Unable to open header file"

texts:
I'm working with QGIS 3.12.1 and I'm using the GRASS tool i.landsat.toar with Landsat 8 images to convert DN to reflectance. Unfortunately, at every attempt I get this error:

C:\Users\Jacopo e Teo\Documents>i.landsat.toar sensor="oli8" method="dos4" date="2020-03-15" sun_elevation=38.75187762 product_date="2020-03-25" percent=0.01 pixel=1000 rayleigh=0 scale=1 -r -n input="rast_5e81b136e658e4." output=outpute55b5f6723a04dcdb2fa9b27a977d660 --overwrite
Calculating dark pixel of <rast_5e81b136e658e4.1>...
Calculating dark pixel of <rast_5e81b136e658e4.2>...
Calculating dark pixel of <rast_5e81b136e658e4.3>...
Calculating dark pixel of <rast_5e81b136e658e4.4>...
Calculating dark pixel of <rast_5e81b136e658e4.5>...
ERROR: Unable to open header file for raster <rast_5e81b136e658e4.6@

I already tried to rename the bands file in different ways, such:

Just B1 for Band 1
B, so using just the base name as pointed out by the manual https://grass.osgeo.org/grass79/manuals/i.landsat.toar.html
Band name without underscore, i.e. LC08L1TP192028202003152020032501T1B1

In every case, I obtain that same error. I'm working on the integrated QGIS interface, so not by console.

What could be a possible solution?


texts: Connecting output as input in ModelBuilder of ArcGIS Pro

texts:
I want to use the output of the the merge function to be the input for the dissolve function and further on for the spatial join function. However, it is only possible to use as a precondition. I want this tool to be a generic tool that people can use with their own input layers. In my model i did not add any data yet, because people have to specify the inputlayers themselves.

What am I doing wrong?


texts:
I 'm new in Python script and i want to export shapefiles in the folder as the kml file with define layer files.  for single shapefile it work perfectly refer below script. But I want to export 4 different shapefiles in the folder as kml with define symbology. Can any one help me?

import arcpy

from arcpy import env

#set the current workspace
env.workspace = r"C:\Work\20141118_Addresses\MGA"

#Set layer to apply symbology to
InputLayer1 = r"C:\Work\20141118_Addresses\MGA\Address_project.shp"

#Set layer that output symbology will be based on
symbologyLayer1=r"C:\Work\20141118_Addresses\Layer\Address.lyr"

#Set Output Kmz files at

OutWorkspace1 = r"C:\Work\20141118_Addresses\Output\Address.kmz"

#Apply the symbology from the symbology layer to the Address layer
arcpy.MakeFeatureLayer_management(InputLayer1,"Address_layer")
arcpy.ApplySymbologyFromLayer_management("Address_layer",symbologyLayer1)
arcpy.LayerToKML_conversion("Address_layer",OutWorkspace1,"12000","false","DEFAULT","1024","96","CLAMPED_TO_GROUND")


texts: Extracting data from Collector (iOS) to server

texts:
Just noticed, that when syncing my Collector data to server, it also is written into Ipad's cache memory.
And now its full. Is there any way to extract data and add to server manualy through ArcMap ?


texts: Looking for open-source solution to show map with massive objects(3x3 polygon) on a web site

texts:
I don't have much experiance in GIS systems.

I am developing a web site which need to show a map with 3m x 3m rectangles for a radius of about 400 meters.(about 58,000 polygons for one location)
I need to be able to support about 10,000 locations
Overoll 580000000 objects...

So far I'be been using google maps with javescript V3 to show limited information.
I've examined fusion-table solutions but the abount of data allowed to upload is too small.
I've tested GmapCreator - but if I use csv files - it's about 5.5GB of information and I don't think It will be able to support this amount of data.

The creating of an image tiles file - looks to me like the right directions - but I need to be able to create the image on the fly per demand  and put it over the google map as an layout.(remmeber it should be on a web site)

Can anyone suggest which tools I can use.
My comfort zone is .Net c#.

Thanks


texts: Does ArcGIS for Desktop support SpatiaLite?

texts:
SpatiaLite is playing an increasing role in my organization.

As it stood in 2012, using SpatiaLite alongside ArcGIS Desktop required an amount of importing and exporting of data that was not always trivial.

Outside of products such as the Data Interoperability Extension or FME, what other options are there for SpatiaLite support in ArcGIS for Desktop?


texts: QGIS: How to plot a GPS track color-coded by the altitude (or any other value like speed, ...)?

texts:
I have GPX files recorded from various treks.
I want to plot them on a QGIS map and have the color of each track segment modified by the altitude recorded.

An idea of the result I am looking for is illustrated on the following picture:

I have imported GPX files on QGIS as vector layer.
It provided in QGIS a polyline and a serie of points.

I have managed to color the dots using a style scaled on the data field "ele" (for elevation in meters).

But I am looking to draw the polyline (and keep only the line on the final map).


texts: How to add the Delimited Text Plugin for QGIS 1.8?

texts:
I can't find the Delimited text Plugin- everything keeps telling me it's in the core build, but which core build? the Mac OS variant comes in multiple installers so without programatically unpacking all of those files to discover it where the hell is it?
Can anyone please point me in the right direction, or post a link to the file; so that I can get it installed on my macs.
Or alternatively state that the plugin is NOT available for the mac version [unhappy face]


texts: No options for "Print layout" while animating lines with mmqgis

texts:
I am trying to use the mmqgis animate lines tool to animate some lines. But for some reason the dialogue box has the "print layout" section greyed out.

The line layer is called 'POC 3 to POC 4 shape', the data looks like this

I change the directory to somewhere convenient for me and because print layout is greyed out this is the result.

I have tried uninstalling and reinstalling mmqgis, I have tried manually installing the plugin by dropping it into the plugins directory and the same problem persisted.

I even tried an older version (last 2016 variant) and of course, QGIS refused to run it as it is incompatible with my version of QGIS (3.2.1)

Anyone else having the same issue?

Ultimately I just want to animate a bunch of lines


texts:
I have a time series of rasters where the cells of each raster represents some value at a certain time.

I would like to generate a map that highlights the magnitude of positive or negative trends in this value over time for each cell.

My somewhat naive approach is to fit a simple linear regression (X=time and Y=value) to each cell and output the array of slopes to a raster (as per example images below).  This can be filtered by only exporting significant results.

How else might I represent trend over time in a raster timeseries?

I am interested in general techniques not software specific instructions.


texts:
I'm using the Python bindings for GDAL to do some processing on a set of satellite imagery. In my preprocessing step, I'm attempting to use ExecuteSQL; however, I've been getting a strange AttributeError that I can't find any solutions to.  Here is a snippet of my relevant code:

def preprocess(full_lyr):

# Preprocess for park boundaries
UNIX_time = ogr.FieldDefn('ACQ_SECOND', ogr.OFTInteger)
full_lyr.CreateField(UNIX_time)

# create acquire seconds field
for i in full_lyr:
    full_lyr.SetFeature(i)
    dt = datetime.datetime.strptime(i.GetField('ACQ_DATE'), '%Y/%m/%d')
    new_time = time.mktime(dt.timetuple())
    new_time = new_time + float((i.GetField("ACQ_TIME") * 60))
    i.SetField("ACQ_SECOND", new_time)
    full_lyr.SetFeature(i)

layerName = full_lyr.GetName()
layer = full_lyr.ExecuteSQL('select * from "%s"' % layerName)

When run, I get the following error:

Traceback (most recent call last):
  File "/Users/cschenker/anaconda/envs/garamba/fireEvent/Preprocess",
    line 79, in <module> preprocess(whole_lyr)
  File "/Users/cschenker/anaconda/envs/garamba/fireEvent/Preprocess",
    line 47, in preprocess
    layer = full_lyr.ExecuteSQL('select * from "%s"' % layerName)
  File "/Users/cschenker/anaconda/envs/FIRES/lib/python3.6/site-
    packages/osgeo/ogr.py", line 1397, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, Layer, name)
  File "/Users/cschenker/anaconda/envs/FIRES/lib/python3.6/site-
    packages/osgeo/ogr.py", line 74, in _swig_getattr
    return _swig_getattr_nondynamic(self, class_type, name, 0)
  File "/Users/cschenker/anaconda/envs/FIRES/lib/python3.6/site-
    packages/osgeo/ogr.py", line 69, in _swig_getattr_nondynamic
    return object.__getattr__(self, name)
  AttributeError: type object 'object' has no attribute '__getattr__'

Any input on how to remedy this? It could be due to a compatibility issue with swig within my conda environment, but I haven't come across any GDAL users with a similar problem.


texts: Extracting grid polygon that are completely filled with a raster

texts:
I have a gridded polygon in WGS84 geographic coordinates (courser resolution i.e. approximately 6 km), and a raster (finer resolution i.e. approximately 500 meters) also in WGS84. Now I want to extract/clip only those polygons that are completely filled with the raster (yellow color). So the result will be a clipped polygon which will only contain grids that were completely filled with the raster.
How can I do this ArcGIS desktop?


texts: [ArcGIS toolbars.Draw.POLYGON ]Object # has no method 'activate'

texts:
I am facing this error while activating the toolbar.

This is my body code

  <button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.POLYGON); map.hideZoomSlider();">Polygon</button>

And this is the javascript i am loading:

 //Polygon & FreeHand Polygon------------------------------------------------------------------------------------

      var toolbar, symbol, geomTask;

        function createToolbar(map) {
            toolbar = new esri.toolbars.Draw(map);
            dojo.connect(toolbar, "onDrawEnd", addToMap);
        }

    dojo.require("esri.tasks.geometry");
    dojo.require("esri.toolbars.draw");

      function addToMap(geometry) {

            switch (geometry.type) {

                case "polygon":
                    var symbol = new esri.symbol.SimpleFillSymbol
                    (esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol
                    (esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));

                    break;

            }
            var graphic = new esri.Graphic(geometry, symbol);
            map.graphics.add(graphic);

            var theme = document.getElementById('SelectTheme').value;
            var token = "xkg8VRu6Ol+gMH+SUamkRIEB7fKzhwMvfMo/2U8UJcFhdvR4yN1GutmUIA3A6r3LDhot215OVVkZvNRzjl28TNUZgYFSswOi";
            var queryTask = new esri.tasks.QueryTask("http://www.onemap.sg/DataService/Services.svc/" + theme + "?token=" + token);

            var query = new esri.tasks.Query();

            query.geometry = graphic.geometry;
            query.outFields = ["DESCRIPTION"];
            query.geometryType = "";
            query.outSR = "";
            query.returnGeometry = true;
            query.spatialRel = "esriSpatialRelIntersects";
            query.text = "";
            query.where = "";

            //Execute QueryTask
            queryTask.execute(query);
            dojo.connect(queryTask, "onComplete", function (fset) {
                //create symbol for selected features

                //                var symbol = new esri.symbol.SimpleMarkerSymbol();
                //                symbol.style = esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE;
                if (theme == "Disability") {

                    var symbol = new esri.symbol.PictureMarkerSymbol('/images/disability.jpg', 25, 25);

                    symbol.setColor(new dojo.Color([255, 255, 255, 1]));
                }
                else if (theme == "VoluntaryWelfareOrgs") {

                    var symbol = new esri.symbol.PictureMarkerSymbol('/images/Welfare.jpg', 25, 25);

                    symbol.setColor(new dojo.Color([1, 1, 1, 1]));
                }
                 else if (theme == "ElderCare") {

                    var symbol = new esri.symbol.PictureMarkerSymbol('/images/elder.jpg', 25, 25);

                    symbol.setColor(new dojo.Color([1, 1, 1, 1]));
                }
                else if (theme == "CommuinityClubs") {

                    var symbol = new esri.symbol.PictureMarkerSymbol('/images/ramp.jpg', 25, 25);

                    symbol.setColor(new dojo.Color([255, 255, 255, 255]));
                }

                var infoTemplate = new esri.InfoTemplate();
                infoTemplate.setTitle(theme);
                var resultFeatures = fset.features;
                for (var i = 0, il = resultFeatures.length; i < il; i++) {
                    var graphic = resultFeatures[i];
                    graphic.setSymbol(symbol);
                    graphic.setInfoTemplate(infoTemplate);
                    OneMap.map.graphics.add(graphic);
                }
            }

            );
        }

can anyone help me out?


texts:
In QGIS I am trying to read raster band data from a specific layer in my Python plug in.

I can easily get access to the layer from the console with something like this.

iface.mapCanvas().layers()[0]

and I can easily get access to a single random pixel value with something like this.

iface.mapCanvas().layers()[0].dataProvider().sample(QgsPointXY(longitude, <latitude>),1)

but what I want to do is grab the whole band matrix of values. something akin to this.

ds = gdal.Open(iface.mapCanvas().layers()[0].source())
band1 = np.array(ds.GetRasterBand(1).ReadAsArray())

but without having to open up the file again.

I assume since the band data is attached to the layer that I must be able to access it somehow, but I've now spent hours reading documentation trying to figure it out only to come up short.

Is there a way to read band data from a raster layer into a numpy array in pyQGIS once I get access to the layer I care about? or is the "open a file using the layer source with GDAL" my best option?


texts:
Using the FeatureToPoint tool I've having difficulty calling just the name for the shapefile without the extension or path. Here is the part of the script that I'm creating that I am stuck on.

eg. C:\user\shapefiles\polygon.shp I just want the word polygon

import arcpy

file1 = arcpy.GetParameterAsText(1) # this is a .shp file
savepointlocation = arcpy.GetParameterAsText(2)

arcpy.FeatureToPoint_management(file1, save1, "INSIDE")

The problem is that its calling for the path of C:\user\shapefiles\polygon.shp and not just the name polygon.

I'm new and I'm sure there is some function or way to just call the name of the file without the path or the .shp in the file.


texts: Load a specific spatial data from a postGIS table

texts:
A single postGIS table contains multiple type of spatial data(example: Linestring,Polygon,etc.,). How to load a specific spatial data from PostGIS table into QGIS by using pyqgis?

Sample code snippet is given below

uri = QgsDataSourceURI()
uri.setConnection("xxx.xxx.xxx.xxx", "port", "dbname", "username", "password")
uri.setDataSource("public","tablename","geom")

uri.setWkbType(QGis.WKBPolygon) #geometry type has to be mentioned

uri.setSrid('4326')
vlay=QgsVectorLayer(uri.uri(),"test_poly","postgres")
QgsMapLayerRegistry.instance().addMapLayer(vlay)


texts:
I have tried the guide http://hub.qgis.org/projects/quantum-gis/wiki/Download

  yum install --enablerepo=updates-testing qgis qgis-python qgis-grass qgis-mapserver

it shows only QGIS 1.8 is available

any guide on installation of QGIS 1.9?


texts:
Anyone know what the SRID is for the following projected coordinate reference system:

{
   PROJCS   [
      "Florida 0901, Eastern Zone [1983, US Survey feet]",
      GEOGCS      [
         "NAD 83 [Continental US]",
         DATUM         [
            "NAD 83 [Continental US]",
            SPHEROID            [
               "GRS 80",
               6378137.0,
               298.257222101
            ]
         ],
         PRIMEM         [
            "Greenwich",
            0.0
         ],
         UNIT         [
            "Decimal Degree",
            0.0174532925199433
         ]
      ],
      PROJECTION      [
         "Transverse_Mercator"
      ],
      PARAMETER      [
         "False_Easting",
         656166.666667
      ],
      PARAMETER      [
         "Central_Meridian",
         -81.0
      ],
      PARAMETER      [
         "Scale_Factor",
         0.9999411764705882
      ],
      PARAMETER      [
         "Latitude_Of_Origin",
         24.33333333333333
      ],
      UNIT      [
         "U.S. Foot",
         0.304800609601219
      ]
   ]
}

My guess is: 102658. I'm assuming I can just make sure all the different values are the same and I'm good.


texts: How to combine bands and band ratios using earth engine

texts:
I am trying to display a multispectral image of bands (4,5,6,4/6,6/5) using Landsat8 satellite imagery. I am doing this in Google Earth Engine using Python. I am new to earth engine and python, so I am taking this as an important learning exercise.

For example, I would like something as intuitive as the following to work (where "test" is an image from Landsat8):

Image(url=test.getThumbUrl({
         'region':safata_region,
         'bands':'B4,B5,B6,B4/B6,B6/B5'
        }))

But it doesn't  (If I were to remove the ratios B4/B6 and B6/B5 it works)

Creating the ratios of bands 4,5, and 6 is simple. For example:

A = test.expression(
'RED/SWIR',{
    'RED' : test.select('B4'),
    'SWIR' : test.select('B6')
    }
)

B = test.expression(
'SWIR/NIR',{
    'NIR' : test.select('B5'),
    'SWIR' : test.select('B6')
    }
)

But I cannot combine this with the other bands in the same fashion as above because A and B are not bands of "test"... I tried finding something similar in Google's fantastic guides, but no luck... Anyone able to give some guidance?


texts: How to customize code generated from Web Appbuilder for ArcGIS?

texts:
I created a web application using the Web AppBuilder for ArcGIS.

However, how can I edit the code to add new features (functions)? e.g. I already added one published geoprocessing (an url) to the widgit (other panel).

However, I could not just find the corresponding code that I downloaded.

Could anyone with this experience give me some guidance?


texts: Calculation surface of building external walls from shapefile

texts:
I have two datasets (attached):

1) A shapefile of buildings containing the height of each building.

2) A parcel shapefile. Several buildings are assigned to a single parcel.

I am interested in calculating the sum of the surface of external walls of buildings (m2) in each parcel. In other words, I want to know how many square meters (m2) of external walls I have in each parcel.

However, it is important for me to exclude those walls which are in common in between buildings. For instance, if two buildings with the heights of 10 m and 6 m are attached from one side, the goal would be to include 4 m of the 10 m external wall and exclude the 6 m which both walls are attached with each other.
I hope I was successful in describing the question.


texts: Maximum length of WHERE clause with IN statement

texts:
I need to get all features from feature class where their field value matches to input array. To achive this one may set IQueryFilter.WhereClause property similar to 'FIELD_NAME IN (array[0], array[1], array[2],...., array[n-1])'. But the size of array might be quite big.

The questions are how long IN statement can be? And can I define it at runtime?

Thanks in advance!


texts: Why raster layer name change to default when using raster::calc function?

texts:
Why raster layer name change to default when using raster::calc function, but not when using Arith-methods:

Toy example copied from Reference manual (calc function).

library(raster)
r <- raster(ncols=36, nrows=18)
r[] <- 1:ncell(r)
names(r) <- "Band1"
r

rc1 <- calc(r, function(x) { x * 10 })
names(rc1) # Default name "layer"

#But when:
rc2 <- r*10
names(rc2) #It conserves the name "Band1"

I did not find an easy way to check the calc function code?


texts:
I'm trying to fix what I believe to be an encoding issue with Tilestache and was curious if someone else has seen this issue.

Here's an example of the string that gets passed:
�9*y��c�ަ��uSA��ٍ�c��'��uSA

Though when I print it out it looks like: "\x01\x02\x00\x00\x00\x02\x00\x00\x00\xab9*y\xac\xd8c\xc1\xde\xa6\xd2\x19\x8duSA\x1a\xe2\xd2\xd9\x8d\xd8c\xc1\x03\x94'\x9f\x97uSA"

I have to imagine this is just my unfamiliarity with Python 2 unicode issues.

Traceback (most recent call last):
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/werkzeug/serving.py", line 181, in execute
application_iter = app(environ, start_response)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/init.py", line 409, in call
status_code, headers, content = requestHandler2(self.config, path_info, query_string, script_name)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/init.py", line 285, in requestHandler2
status_code, headers, content = layer.getTileResponse(coord, extension)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/Core.py", line 450, in getTileResponse
tile.save(buff, format, **save_kwargs)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/Goodies/VecTiles/server.py", line 329, in save
mvt.encode(out, features)
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/Goodies/VecTiles/mvt.py", line 81, in encode
wkb = approximate_wkb(feature[0])
File "/VirtEnvs/gismaps27/lib/python2.7/site-packages/TileStache/Goodies/VecTiles/wkb.py", line 142, in approximate_wkb
input, output = StringIO(wkb_in), StringIO()
TypeError: initial_value must be unicode or None, not str


texts: Using Geometry by Expression tool to make set of lines in QGIS

texts:
I am using QGIS 3.x.

I am trying to make a set of lines that are 50m to 2000m, at 50 meter intervals (eg: line 1 is 50m, line 2 is 100m, line 3 is 150m, etc).

I did it manually using the Advanced digitizing tool bar, but I would like to learn to do it more elegantly using the Geometry by Expression tool.

How do I use the "Geometry by Expression" tool to make a set of lines with a particular length interval using QGIS 3.x?


texts: Query Layer with user-defined (dynamic) parameters in ArcGIS 10.1

texts:
I have prepared and published with ArcMap 10.1 to my ArcGIS Server a Query Layer to access
some information in my database. My output map represents the European
Union states and using annotations, the number of cities and villages each country has.

Now, I would like to go a step further and try to specify some parameters
in the WHERE clause of the SQL query that defines my query layer. Therefore
the user in my web application can select from a drop-down list box simple parameters
like filtering just by "Cities" or "Villages" or by population number.

I just would like to know if it is possible to configure ArcGIS to expect
some input parameters coming from the web and execute the SQL query with these parameters once
they have been received. Is there a way of injecting those parameters back
to the ArcGIS Server and make it calculate the data I need?

Please, could you provide any ideas or guidelines about how this would be done?


texts:
while sophisticated styling of popups (infowindows when clicking on a point) are probably better in css, are there any options for styling infowindows within an arcgis.com webmap?

I really just want a less-technical user to be able to style the background, header color, and basic layout.

Any ideas are appreciated.


texts:
I have a line layer with roads. Every road has a unique start and endpointnumber, as attribute. From this layer I want to select some roads. Therefore I have an excel table with start- and endpoint, which I want to select. The road layer and the excel table don´t have an id, for a join.
Is there any option in the query builder, that I can use columns from the table for my query on the line layer?

part of the excel table

part of the attribute table of road layer

I want to select all roads with the values of "vnk" and "nnk" from the excel table, but I can´t join them.


texts: Connecting to WMS in QGIS - Single Band Image Won't Render as TIFF?

texts:
In QGIS when we connect to an ArcGIS Image Service via WMS we can load the data as PNG/JPEG, however TIFFs do not render on the map.

It is only occurring with single band Image Services, the 3-band services are able to render as TIFFs through WMS.

What could be the problem?
All services have the same WMS capabilities enabled.

Can a TIFF not render a single-band 32-bit floating point dataset in WMS?


texts: Generate Tessellation & Centroids using ArcGIS Pro?

texts:
I first generated a square tessellation (using Generate Tesselation) using the following:

arcpy.GenerateTessellation_management(Output_Feature_Class="/File Location Removed", Extent="371935.1483 411977.256099999 1618490.2735 1596583.8365", Shape_Type="SQUARE", Size="1 SquareKilometers", Spatial_Reference="PROJCS['NAD_1983_Texas_Statewide_Mapping_System',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',1000000.0],PARAMETER['False_Northing',1000000.0],PARAMETER['Central_Meridian',-100.0],PARAMETER['Standard_Parallel_1',27.41666666666667],PARAMETER['Standard_Parallel_2',34.91666666666666],PARAMETER['Latitude_Of_Origin',31.16666666666667],UNIT['Meter',1.0]];-37624400 -27099700 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision")

Now I am needing to add centroid coordinates for each grid using ArcGIS Pro.

I have tried to use add geometry attributes, polygon to point, and using Python code in ArcGISPro. I also tried using (using How To: Find the centroid of polygons using Calculate Geometry). However, I keep getting the same centroid information for all of the individual grids.


texts: Performing a Spatial Query in a loop in PyQGIS

texts:
What I am trying to do: loop through a point shapefile and select each point that falls into a polygon.

The following code is inspired by a spatial query example I found in a book:

mitte_path = r"D:\PythonTesting\SelectByLocation\mitte.shp"
punkte_path = r"D:\PythonTesting\SelectByLocation\punkte.shp"

polygon = QgsVectorLayer(mitte_path, 'Mitte', 'ogr')
points = QgsVectorLayer(punkte_path, 'Berlin Punkte', 'ogr')

QgsMapLayerRegistry.instance().addMapLayer(polygon)
QgsMapLayerRegistry.instance().addMapLayer(points)

polyFeatures = polygon.getFeatures()

pointsCount = 0

for poly_feat in polyFeatures:
    polyGeom = poly_feat.geometry()
    pointFeatures = points.getFeatures(QgsFeatureRequest().setFilterRect(polyGeom.boundingBox()))
    for point_feat in pointFeatures:
        points.select(point_feat.id())
        pointsCount += 1

print 'Total:',pointsCount

This works, and it does select datasets, but the problem is that it selects by bounding box, hence obviously returning points I am not interested in:

How could I go about only returning points within the polygon without using qgis:selectbylocation?

I have tried using the within() and intersects() methods, but as I was not getting them to work, I resorted to the code above. But perhaps they're the key after all.


texts: Generating missing yearly data, based on a more detailed temporal data set

texts:
I have several very large raster data sets of land use classifications (ie. forest, wetland, argicultural, etc).

The most comprehensive data spans 2009-2015. I have reclassified this data to match the categorizations used in an older data set. My problem is that the older data only exists once per decade (1990, 2000, and 2010). As you can see, I have 2 different data sources for 2010, which might come in handy.

I want to know if there is a way to generate data for how the land may have changes in those 10 year gaps. Is there a way for ArcMap to populate the missing data from 1991-1999 and 2001-2009, where it first looks at which rasters have changed in those 10 years. Then in each generated data set (1 new set for each missing year) each raster that changed in those 10 years has a 1 in 10 chance of having changed from A to B in any given year. So as an example: by the time it generates the 1999 data, 90% of the rasters should have changed - with the year 2000 representing 100% of the changes.

I have a follow up question, which is much more advanced. So my main focus would be on answering the first part.

Because I have the complete 2009-2015 data, maybe there would even be a way to extrapolate how changes occur based on that existing data? Such as a spatial relationship, like if one raster changed from forest to agriculture, it is now more likely that the adjacent rasters also changed that same year.


texts: How to Display Local Basemap Tiles from ArcGIS for Server Using OpenLayers?

texts:
I am using the OpenLayers JavaScript API within a web application. I generated a basemap tileset using ArcGIS Server for a particular region and i wrote a code to display the basemap tileset using OpenLayers. But whenever i load the webmap it shows the tiled images as pink and its not displaying... Can someone please help out?

Here's the sample code:

<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>Olabode Olushi OpenLayer</title>
<script type='text/javascript' src='OpenLayers.js'></script>

<script type='text/javascript'>

var map;

function init() {

map = new OpenLayers.Map('map_element', {});

cacheLayer = new OpenLayers.Layer.ArcGISCache( "ArcGISCache",
                    "http://localhost:6080/arcgis/rest/services/Shane/Niagara_Cache_Example/ImageServer", {
                        isBaseLayer: true,

                    });

map.addLayer(cacheLayer);

map.addControl(new OpenLayers.Control.LayerSwitcher({}));
map.addControl(new OpenLayers.Control.PanZoomBar({}));

map.zoomToExtent();

}

</script>
</head>

<body onload='init();'>
<div id='map_element' style='margin: 0; width: 1570px; height: 740px; box-shadow: 0px 5px 5px 3px #6B9000'>
</div>
</body>
</html>


texts:
When running the following code:-
outProj = Proj("+proj=vgridshift +grids=dvr90.gtx")

I am getting the following error:
pyproj.exceptions.CRSError: Input is not a CRS: +proj=vgridshift +grids=dvr90.gtx +type=crs

I am trying to convert from lat/long to ETRS89 / UTM zone 32N + DVR90.


texts: What is the equivalent of summarize field in QGIS

texts:
In ArcMap, user can create a table that groups the field values using summarize field tool (as shown below)

How can I create a table that summarizes field values in QGIS?


texts: Reprojecting with a specific value for no-data

texts:
I'm using Python to perform forest analysis.
I used the MSPA tool to produce a fragmentation map of a specific AOI (for testing I use Singapore). To produce statistics that make sense in Ha I need to use a conform projection (ESRI:54009) but I want to go back to EPSG:4326 for display purposes.
Here is the unprojected fragmentation map in QGIS (as it's coming from an ESRI:54009, the projection is not a pure rectangle):

Then using Gdal Python binding I project this map into EPSG:4326:
gdal.Warp(mspa_map_proj, mspa_map, creationOptions=['COMPRESS=LZW'], dstSRS='EPSG:4326')

but I obtain the following image with grey bands on the left and right sides:

The problem is that the developer of the MSPA tool decided to use 0 as the non-forest value (in grey) and 129 for the background (in white).
So my question is simple : is it possible to force gdal to use the value 129 when it's adding pixels to complete the image when reprojecting instead of 0?
Edit
here is the ESRI:54009 sample for those who want to test
http://www.filedropper.com/sn308111mspamaptmp


texts: ArcGIS JavaScript API for OGC WMTS vector tiles

texts:
Are there the plans to support OGC WMTS vector tile in ArcGIS JavaScript API?
As I understand esri adopted mapbox format while opengis.net developed a format around a classic WMTS: kind a WMTS, but tiles are served as "vectors".
OGC Vector Tiles Pilot: WMTS Vector Tiles Extension Engineering Report
So what are esri intentions to support that format? Or are there a lot of open source proxy implementations that can convert between these formats?


texts: How do I generate an image of each polygon in a shapefile?

texts:
I have shapefiles containing areas (states, counties, bodies of water, etc.) and need to generate an image (png / jpg) of each area. How can I do this?

In my mind, the manual workflow would be:

Zoom to extents of each polygon,
Zoom out a tad more to create a border around the polygon,
Create the image file,
Move to the next polygon and repeat above steps.
Repeat for each shapefile.

I have access to ArcMap 10.3, QGIS for my GIS tools and python and .NET for development tools.

This automated process would not need to run frequently, maybe a few times each year, so performance is not really a concern.

A repeatable outcome / consistency is important. The image does not need to be an even scale (1:24000, e.g.) as this will be displayed on-screen only and no scale bar will be applied. The height to width must be scaled equally; not x = 1.00 and y = 1.23.

I do not want to manually create the images (screenshots, print to raster, etc.). This really needs to be automated. There are dozens of shapefiles and hundreds of polygons so automation is definitely worth the time.


texts: OpenLayers Get Column Value Of Currently Selected Feature Having JSON Data Source

texts:
I have a service that return data in json format as the following snippet:

{"type":"FeatureCollection", "features":[{"type": "Feature", "id": 1, "sheet_no": "NF4011D", "geometry": {"type":"MultiPolygon","coordinates":[[[[57.25,21],[57,21],[57,21.25],[57,21.5],[57.25,21.5],[57.5,21.5],[57.5,21.25],[57.5,21],[57.25,21]]]]}}, ...

All I want is to get the sheet_no of the selected feature, example: NF4011D

I added the selection method as follows:

selectClick = new ol.interaction.Select({
    condition: ol.events.condition.click,
    layers:[indexLayer]
});
navMap.addInteraction(selectClick);

I added also the click event to this layer as follows:

selectClick.on('select', function(e)
{
      //I tried
      var x = e.element.get('sheet_no');// Uncaught TypeError: Cannot read property 'get' of undefined
      //also
      var features = selectClick.getFeatures();
      var feature = features.item(0);
      var no = feature.get('sheet_no');  //results in undefined
      //also
      var name = features[0].attributes.id // attributes not defined
      //and others
      //also
      var sheets = selectedFeatures.getArray().map(function(feature)
        {
            return feature.get('sheet_no');
        });

        if (sheets.length > 0)
        {
            console.log("names: "+sheets); //returns nothing
        }
});

I have tried for a day almost every solution that is market as correct in stackoverflow but unfortunately I could never get one working:

This this question has been there for a while and got answered. But I think that there is something in my json file that is different.
Please help


texts: How to launch a tool when my button has been pressed

texts:
I use ArcGIS 10.0 and ArcGIS .net SDK. I created AddIn project which contains Tool:

<Tool id="AddSearchLocationPoint"
  class="AddSearchLocationPoint"
  category="Add-In Controls"
  image="Images\insert.png" />

and DockableWindow:

<DockableWindow id="SearchDockableWindow"
                class="SearchDockableWindow"
                image="Images\SearchDockableWindow.png">
  <InitialPlacement height="360" width="570" state="pinned" position="right" />
</DockableWindow>

The dockableWindow contains WinForm’s HostElement which displays my WPF UserControl. Now I want to add a button to the WPF UserControl which will launch my tool. Do you know a way to raise the event which launches the tool?


texts: I have a global raster map opened in QGIS which is centered in the pacific. How do I change this map to be Atlantic centered?

texts: I am trying to present a map for a document which needs to be Atlantic centered. I would like to know what tools I can use to do this using QGIS


texts: I have to select manually the areas of extraction from SAS Planet