texts: Masking edges of S1 composite in Google Earth Engine

texts:
From the following code I would like to mask the edges of my sentinel 1 composites.

@Daniel provided the code.

var roi = Map.getBounds(true)
var startDate = ee.Date('2015-01-01')
var endDate = ee.Date('2015-03-01')
var deltaDays = 16

var myCollection = ee.ImageCollection('COPERNICUS/S1_GRD')
    .filter(ee.Filter.eq('instrumentMode', 'IW'))
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
    .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
    .filterBounds(roi);

var days = endDate.difference(startDate, 'days')
var composites = ee.ImageCollection(
  ee.List.sequence(0, days.subtract(1), deltaDays)
    .map(function (offsetDays) {
      var start = startDate.advance(offsetDays, 'days')
      var end = start.advance(deltaDays, 'days')
      var masked = ee.Image([ee.Image(), ee.Image()]).rename(['VV', 'VH'])
      var composite = myCollection
        .filterDate(start, end)
        .median()
      var empty = composite.bandNames().size().eq(0)
      composite = masked.addBands(composite, null, true)
      return composite
        .addBands(
          composite.expression('c.VV - c.VH', {c: composite})
            .rename('VV-VH')
        )
        .select(['VV', 'VH', 'VV-VH'])
        .set('start', start.format('yyyy-MM-dd')) // Include dates of composite
        .set('end', end.format('yyyy-MM-dd'))
        .set('empty', empty)
        .clip(roi)
    })
  )
  .filterMetadata('empty', 'equals', 0) // Drop empty images
  .toList(1000)

I tried this but it did not bring me to any solutions:

exports.maskEdge = function(img) {
  var mask = img.select(0).unitScale(-25, 5).multiply(255).toByte().connectedComponents(ee.Kernel.rectangle(1,1), 100);
  return img.updateMask(mask.select(0)).set('system:time_start', img.get('system:time_start'));
};


texts: Leaflet - how do you get individual markers from a featurelayer?

texts: In Leaflet, if I have a feature layer filled with markers, how do I get these markers back from the layer? I want to apply different popups to each individual marker, instead of the entire set. I can't find a method for this in the documentation.


texts: Plotting the centroid of a polygon feature layer

texts:
I'm working with arcGIS javascript api 3.12.

My current call for displaying the feature layer is as follows:

var recLayer = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3" ,{
  infoTemplate: recParkTemplate,
  outFields: ["STATE_NAME"]
});
map.addLayer(recLayer);

However, instead of plotting the polygon on the map as this is an esriGeometricPolygon. I would rather have it plot on the map like a esriGeometryPoint. I know this method in getting the specific polygon's centroid:

https://developers.arcgis.com/javascript/jsapi/polygon-amd.html#getcentroid

What I have done so far is something like this when the map has finished loading:

recLayer.on("graphic-add", function(graphic) {
        console.log("\n\n" + recLayer.graphics.length);
        console.log(graphic.graphic);
});

What this does is give me the graphics object as they are loaded. From here I figure I can manipulate them into displaying the centroid alone. However, this is not working as expected where I'd think it would be

graphic.getExtent().getCenter();

This comes with an error. From there I'd like to change the graphic to a plot point and then have a pin display at the center of the polygon.

Do I have the right approach? Is there something I'm missing?

Here is the current site if you would like to take a look at it: http://joshferrell.net/ece_project/


texts:
I have a table("ecw") with a field ("raster_path") which contains the paths of many rasters (ecw type)
Selecting several rows from the table, I Would like to add the rasters into my dataframe.

How do I do it?

(Sorry if my english is not good; It isn't my native languaje)


texts: Passing track_total_hits Param via WFS Query through GeoServer to ElasticSearch Backend

texts:
We are executing WFS 1.1.0 based queries via a GeoServer instance (2.18) backed by an ElasticSearch datastore (v7.x - not sure of the specific version), and are looking to retrieve an accurate Hit count for the results. However based on the version of Elastic (v7.x) we need to provide an additional parameter to each query, namely "track_total_hits": true.
My attempts thus far have centred around use of Native Queries and using the "viewParams=q:{query_body}". I have managed to pass through Queries to ElasticSearch, however the additional track_total_hits param is being ignored/not passed through. I have been using XML format WFS GetFeature queries, specifying the viewParams attribute.
Some attempts included (not conforming to Elastic query formats I know, but was getting desperate):

viewParams=q:{"match_all":{}},"track_total_hits":true
viewParams=q:{"match_all":{},track_total_hits:true}
viewParams=q:{"match_all":{},"track_total_hits":true}
viewParams=q:{"match_all":{}},{"track_total_hits":true}

Any assistance/advice on whether this is possible would be appreciated.


texts: Geometry type and create trigger for that in postgresql

texts:
I want to create a trigger (before inserting trigger), to check the geometry type weather is point, polygon, line, or multi-polygon. After that, I want to set the color property. How can I do this?

I am using postgresql 9.4. My OS is Windows 10.

Table Name: Test, column(s): geoData and color.

CREATE OR REPLACE FUNCTION trigger_color()
  RETURNS trigger AS
$BODY$
BEGIN
if(st_geometrytype(NEW.geoData) like 'ST_Point') then
       INSERT INTO "Test"("color") VALUES (red);
          NEW.color = 'red';
elseif(st_geometrytype(NEW.geoData) like 'ST_Polygon') then
       -- your logic here, for example:
          NEW.color = 'green';
elseif(st_geometrytype(NEW.geoData) like 'ST_Linestring') then
       -- your logic here, for example:
          NEW.color = 'yellow';
elseif(st_geometrytype(NEW.geoData) like 'ST_MultiPolygon') then
    NEW.color = 'blue';
else
    NEW.color = 'black';
end if;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION trigger_color()
  OWNER TO postgres;

It shows me :

ERROR: record "new" has no field "geodata"
SQL state: 42703
Context: SQL statement "SELECT (st_geometrytype(NEW.geoData) like 'ST_Point')"
PL/pgSQL function trigger_color() line 3 at IF

How i can solve this?


texts: ArcObjects -- How to tell if an event is already wired up

texts:
Using Visual Studio 2010 C# and ArcMap 10.1.

In a custom ArcObjects extension, a bunch of events are wired up at startup.  For example, this simple standard code chunk:

        IEditEvents_Event m_EditEvents = (IEditEvents_Event)m_Editor;
        m_EditEvents.OnStartEditing += EditEvents_OnStartEditing;
        m_EditEvents.OnCreateFeature += EditEvents_OnCreateFeature;
        m_EditEvents.OnChangeFeature += EditEvents_OnChangeFeature;
        m_EditEvents.OnDeleteFeature += EditEvents_OnDeleteFeature;
        m_EditEvents.OnStopEditing += EditEvents_OnStopEditing;

Later on in the program, depending on the state of things, any particular handler might have been turned off (-=) or turned back on (+=).  While debugging, I am interested in using some sort of Visual Studio debug/diagnostic tool or ArcObjects interface that allows me to see with some sort of detail either (or both):

the function that is wired up to any particular object.event
the events that are wired up to any particular method


texts: Modifying Mercator projection in ArcMap?

texts:
I have a shapefile which is consistently drawing in the wrong place. Luckily I was given some information about it and am now wondering how to get the shapefile properly projected and drawn.

What I know:

It is in Mercator
The latitude and longitude of origin are 33 and 60 degrees, respectively
The scale factor is 1.15
There is no false easting or northing.

I am a bit confused because I can't seem to modify these parameters in various Mercator projections through ArcMap. I can usually only modify one or two of them (ex: scale factor and central meridian or only central meridian, etc).

What process do I need to go through to get this shapefile projected correctly and drawing in the right place?

What I've tried:

Creating a new projected coordinate system in Data Frame properties. Took projection "Mercator_Variant_A" and entered in the above central meridian (60) and scale factor (1.15). I then projected the .shp into this projection. Results: draws in the same incorrect place.
Assuming the projection of the .shp is wrong, I deleted the .prj file for my .shp, then used "Define Projection" to this same new projection defined from "Mercator_Variant_A". Results: draws in the same incorrect place.


texts: Create a polygon to wrap around polyline features in QGIS 3

texts:
I have a series of polylines representing sewer mains, with an attribute indicating the network it is in.

Is there a way to create a polygon that wraps around all of the polylines with the same attribute in QGIS 3.4. My intention is then to use the Wrapper polylines to transfer attributes to a number of other features in the sewer network which are stored as separate SHP files (eg valves, pumps, etc).

Periodically I will need to regenerate the wrapper polygons as the network expands.


texts: PyQGIS - Adding layer from PostGis database

texts:
I want to add new layer from PostGIS database but this code isn't working... Can someone help me?

uri = QgsDataSourceURI()
uri.setConnection("IP address", "5432", "ruian", "user", "pass", QgsDataSourceURI.SSLdisable)
uri.setDataSource("public", "okresy.originalnihranice", "MultiPolygon", "", "ogc_fid")
layer = QgsVectorLayer(uri.uri(), "okresy", "postgres")

if not layer.isValid():
    print "Layer %s did not load" % layer.name()

QgsMapLayerRegistry.instance().addMapLayers([layer])

layer is always empty


texts: Cell Statistics in ArcMap not working properly

texts: I just want to use the Cell Statistics tool to sum the value of 8 different raster layers. The problem is that the output always just includes a part of the input rasters, no matter what i change.The area with the black triangle is what i get and as you can see there is much more cells that should be calculated.


texts: R: Change RasterBrick dimensions from TXY to XYT

texts:
I am having difficulties in R getting climate data from a netCDF file into the right format for further analysis. I am working with gridded global data on Standardized Precipitation Index (downloaded from here and want to aggregate the monthly values for each grid-cells to an annual average.

Now the issue is that in the file the data is organised as TXY, where T are the number of months since January 1960 and X and Y are longitude and latitude respectively. As a result, when I load the file into R with,

library(raster)
spi<-brick("data.nc")

I get the following dimensions:

class       : RasterBrick
dimensions  : 144, 441, 63504, 58  (nrow, ncol, ncell, nlayers)
resolution  : 1, 2.5  (x, y)
extent      : 228, 669, 0, 360  (xmin, xmax, ymin, ymax)
coord. ref. : NA
data source : data.nc
names       : X.66.25, X.63.75, X.61.25, X.58.75, X.56.25, X.53.75,...
degree_north: -66.25, 76.25 (min, max)
varname     : aprod

So annoyingly, the monthly observations are on the columns whereas the latitude coordinates are on the layers. Which I don't find very useful and makes processing the data rather difficult.

Therefore I wondered, if there is a way in which I can change the dimensions to a more conventional format? With the data of interest on the layers.


texts: Drive Times issue with Rendering Graphics

texts:
I am trying to consume the Esri Drive times geoprocessing service within a Flex application, based around the v2.2 Flex API.

I have seen the sample on how to do this.
-  However, mine is a bit more based on ActionScript over MXML.
-  I should also point out that I am fairly new to Flex/Esri API development, so lamens terms would be great :)

My application seems to be hitting the GP service ok, and I think I am getting the features returned from the Esri servers, however I am having some difficulty setting up a renderer for the results:

I get these 'call to a possible undefined method' a fair bit, but not too sure on how I can tweak this to work.

I have been following the samples provided for symbolising graphics with renderers.

If it helps, I have recorded a short screencast to show the rest of my code.

---EDIT-----
I am getting the features returned to me from the gp service, and I have tried to mimic the Esri Flex sample for drive times, but the graphics are not rendering.

Here is a new screencast to give you more details.
Here is the code in a text file.
i have added a small bounty.  Winner will be one who helps spot what ive done wrong and gets my results to render in graphics layer (let me know if you need more info).
bonus points on suggestion to streamline the code.

---EDIT2---
Been investigating the requests/responses made from my app and the Esri sample. (links have more info)

So, looking at the response, im getting it in WKID 4326, when it should be 102100.
Im now using the same basemap as the Esri Sample.
I have also hard-coded the output spatial reference to be 102100.
Still no joy.

My App GET request:

  http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygons/execute?f=json&Drive%5FTimes=1%202%203&Input%5FLocation=%7B%22features%22%3A%5B%7B%22geometry%22%3A%7B%22x%22%3A%2D13629847%2E781785995%2C%22y%22%3A4548460%2E945559423%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D%7D%5D%7D

Esri Sample GET request:

  http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygons/execute?f=json&env%3AoutSR=102100&Input%5FLocation=%7B%22features%22%3A%5B%7B%22geometry%22%3A%7B%22x%22%3A%2D10608048%2E003182963%2C%22y%22%3A4721388%2E810494098%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D%7D%5D%7D&Drive%5FTimes=1%202%203


texts: how can I maintain curves when converting from geodatabase to postgresql using og2gui

texts: I am using the ogr2gui to convert a feature class in a geodatabase to a postgresql feature class. My original data is in a file geodatabase, and I am using the folder OpenFileGDB format as my input type. I can see that where I previously had curves, they are now gone in the postgres feature class. How can I maintain the curves? I am running postgreSQL 9.2 with postgis 2.0.6.


texts: Get correct coordinates of feature when projection is wrapped around dateline / OpenLayers 3

texts:
When I use a wrapped world projection the retrival of feature coordinates doesn't get the right "repitition" of the world, if it's not the center one. In detail:

In OpenLayers 3 I have a vectormap which is wrapped around the dateline:

new ol.source.Vector({ ... wrapX: true});

When I fetch the features at an event pixel via

var feature = map.world.forEachFeatureAtPixel(pixel, function(feature, layer) {
  return feature;
});

The coordinates I get via

var coords = feature.getGeometry().getCoordinates()

... are always the same no matter in which "repetition" of the wrapped world I hover. Then I position an ol.Overlay via

overlay.setPosition(coords);

And this positioning also doesn't detect the repitition, which leads to the behaviour, that the overlay is positioned off the view, when the "central world" is panned of the screen.

EDIT: Actually the problem can be seen in this OL3 example:
http://openlayers.org/en/v3.6.0/examples/icon.html?q=overlay ... just zoom out until the icon appears again to the left or right and click on it. The popover will appear in the central version.


texts: Changes to Clip and Intersect between 2.8 ltr and 2.12 for lines

texts:
Clip and Intersect in 2.8 yield the result as expected. When using 2.12 the shapefile is empty.

To test this I have run both versions on Linux (Opensuse Leap) and OSX. The results are consistent.

Workflow:

Create a polygon in Google Earth (a dam outline) and save as a KML file
Set the project CRS to HBK lo 31 (South African projected coordinate system with CM 31)
Add a vector layer using the KML polygon
Save the polygon to a Shapefile using CRS HBK Lo 31
Disable the KML layer
Add a Vector Grid. Vector -> Research Tools -> Vector Grid
Save using CRS HBK Lo 31
Clip the lines to the polygon. Vector -> Geoprocessing -> Clip

In 2.8 this works fine. In 2.12 it returns an empty file.

If I use points the clip works fine (Vector -> Research Tools -> Regular Points) in both versions.

The only reason I wish to use 2.12 is that it allows for a rotation of the grid.

Has something changed that I need to modify the workflow?


texts: What is the vector data type of enclosed polyline?

texts:
For a long time, I was wondering which GIS spatial vector data types does the enclosed polyline feature possess.
Somebody told me, that when polyline feature's last vertex meets the first one, e.g. their coordinates are identical, it is always a polygon. And it is actually true following basic logic.
This article (Vector vs Raster: What’s the Difference Between GIS Spatial Data Types?) says apparently the same

POLYGONS connect vertices and close the path
When you join a set of vertices in a particular order and close it,
this is now a vector polygon feature. In order to create a polygon,
the first and last coordinate pair are the same.

My question is simply by which means/conditions enclosed polyline feature will possess the polygon vector data type? Otherwise, why the error did not evoke when I enclosed polylines in GIS-software (e.g. QGIS, ArcGIS)?

QGIS
When I deploy a tiny example in QGIS I am getting not a wrong but probably not a proper output.
Let's assume we have six features in the polyline layer, see image below.

When I execute a small query using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer...
SELECT p.id, ST_AsText(p.geometry)
FROM "polylines" AS p

I am getting the following output, where the first and last vertices are equal for a LINESTRING() object.

Moreover, when I copy&paste the same feature into the polygon layer it will end up as a normal polygon object. Nevertheless, the same arrangement is applicable for normal polyline objects, where the last vertex will be connected with a first one, similar to MakePolygon() function, see image below.

ArcGIS
A similar case will arise when I accomplish this task in ArcGIS 10.5 Desktop Advanced.
Let's assume we have four features in the polyline layer, see image below.

Using the ArcPy
for row in arcpy.da.SearchCursor("polylines_layer", ["SHAPE@WKT"]):
  print row[0]

I am getting the following output, where the first and last vertices are equal for several features


texts: QGIS 3.0.3 - Shift when saving image from Google Satellite as VRT

texts:
I tried to save Google satellite images with "save as", using VRT option, and setting up the correct resolution. Everything works but the resulting image is slightly shifted to the north, about 3 meters.
All projections are ok, and I noticed when I don't use VRT but a plain image, the shift diappears.
I tried to check all I could think of, to no avail.

Has anyone any idea?


texts: How can I implement animation with lines using QGIS TimeManager?

texts:
Among all the examples I saw, I can only find those with animated dots.

I need to implement a time slider based on each link's capacity, and display different colours according to the magnitude.

My data are in csv form and the links are structured by 2 coordinates (start and end points).

Is there a way to display animated lines features instead of simple dots using TimeManager?


texts: Auto incrementing field based on groups within feature class?

texts:
I am needing to auto increment a field based on groups within a feature class. I have 8 plots within a given polygon and I need to assign them an ID from 1-8 for each set of plots within each polygon. The polygon would have its own unique ID number to be used to group the plots.

I assume it would be an alteration of this:

rec=0
def autoIncrement():
 global rec
 pStart = 1
 pInterval = 1
 if (rec == 0):
  rec = pStart
 else:
  rec = rec + pInterval
 return rec


texts: Merge points from multiple features that share common attribute

texts:
I have several point feature classes that all share similar attribute structure. How might I extract the points from all 9 feature classes that share a specific attribute?

Background: There are 9 different assessment areas for studying streams - each was studied at different dates so the data for photo points are stored in separate feature classes. I'd like to merge all the photo points into a single feature.


texts: Calculating angle using three WGS 84 points

texts: I am looking for a way to calculate an angle between two points at a specific third point. My coordinate system is WGS 84. I can measure the angle with QGIS clicken on those three points, but I want to calculate it to ensure that I have the correct coordinates plus I have more than 8000 angles to calculate. Therefore, I am looking for a way to calculate it. I cannot figure it out.


texts: Merge shapefiles in folders and subfolders with arcpy

texts:
I try to merge 20 shapefiles in order to get one shapefile that include all the features.   All shapefiles are called "migrashim", and they spread in big folder that divided to a lot of sub folders. My code is:

import arcpy,os,sys,string,fnmatch
import arcpy.mapping
from arcpy import env

rootPath = 'C:\Project\layers'
pattern = 'migrashim.shp'
counter = 0
for root, dirs, files in os.walk(rootPath):
    for filename in fnmatch.filter(files, pattern):
        print( os.path.join(root, filename))
        arcpy.Merge_management(["migrashim.shp"], r"C:\Project\layers\migrashim_total.shp")
        counter = counter + 1
print counter

and i get an error:

  ERROR 000732: Input Datasets: Dataset migrashim.shp does not exist or
  is not supported Failed to execute (Merge).


texts: PostGIS does not find intersection between line and polygon

texts:
I have a line and polygon:

I would like to programmatically figure out whether they intersect or not. So, I do:
select ST_Intersects (
    (
        select ST_SetSRID(ST_Buffer(ST_Transform(ST_SetSRID((p.geom), 4326), 26986), 50), 4326)
        from point p
        where p.id = 25785
    )
    ,
    (
        select ST_SetSRID(ST_MakeLine(ST_SetSRID(p.geom, 4326)), 4326)
        FROM point p
        where p.trajectory_id = 1455
    )
);

But when I run the query, PostGIS says that they do not intersect!! But on the picture above we definitely see that they intersect (or line crosses the polygon).

What is the problem?
I also tried ST_Crosses function, but it also gives false.


texts: How to return GeoJson from a SQL Server Query using GeoJson.Net in ASP.NET MVC

texts:
I have a spatial table in SQL Server, which I want to map using either OpenLayers or Leaflet.

My problem is I can't figure out how to convert the returned results from my query to geojson.

My Linq query looks like this:

 var world = _db.worlds.Select(w => new
        {
            w.ID, w.CODE ,
            COUNTRYNAME = w.CNTRY_NAME,
            COUNTRYPOP = w.POP_CNTRY,
            w.FIPS,
            GEOMETRY = w.geom,
            w.WKT
        });

Tried using GeoJson.Net but it's not documented enough for me to understand, but what I know is the geometry that is returned when parsed to text, it returns Well Known Text with Multiple Geometry, i.e polygons and multipolygons to be precice.

var geometries = new GeoJSON.Net.Geometry.GeometryCollection(world.WKT);
//This is giving an error that world.WKT is not of type IGeometryCollection<>

Anyone know a work around my problem even using other packages that isn't the GeoJson.Net?


texts: Converting raster file to vector in QGIS takes long time

texts:
I am a new user of QGIS, and I am trying to convert a .tif file in a vector.
To do that I have used the "Raster conversion" option, but it is taking a long time. I am waiting 20 minutes for the conversion.
This .tif file is of 1 142 007 Kb.
If this is not normal, is there something that I could do to speed it up?


texts: QStringList() error in plugin of QGIS 2.10

texts:
I have made a Dialog in PyQt for use it like a plugin under QGIS 2.10

The Dialog works fine like a standalone application, but if I try to call it like a QGIS plugin, I get this error:

AttributeError: 'module' object has no attribute 'QStringList'

There are a similar question here, but it doesn't work for  me.

The form is made with Qt Designer

This is a snippet of my Dialog:

from qgis.core import *
from PyQt4 import QtCore, QtGui, QtSql

from Ui_BuscadorParcelas import Ui_BuscadorParcelas

# create the dialog for BuscadorParcelas
class BuscadorParcelasDialog(QtGui.QDialog):
    def __init__(self):
    .......................
    def PrepararCuadros(self):
        self.consulta = QtSql.QSqlQuery(self.conexion)
        if self.consulta:
            for i in range(self.numCamposLineEdit):
                cadenaConsulta = "SELECT DISTINCT "+self.campo[i]+" FROM crcc ORDER BY "+self.campo[i];
                self.consulta.exec_(cadenaConsulta)
                self.ListaValores = QtCore.QStringList()
         ...................................................

I need the QStringList() to set a QCompleter object

I complete the answer of Mathias Kuhn saying that if I get the values of the list from a database query, like my example, I need to prepend unicode for obtain a python list that QCompleter can use like argument (first line in the following code replace last line of first one)

self.ListaValores = []
while self.consulta.next():
    self.ListaValores.append(unicode(self.consulta.value(0)))
self.completer = QtGui.QCompleter(self.ListaValores, self)


texts: Forcing area calculation into miles in QGIS (without changing the PCS)

texts: I'm working on an assignment that requires me to create an area column in miles without changing the projected coordinate system. ArcGIS has a tool that can do this ('Calculate Geometry')-- does QGIS have anything analogous? I know about using $area in the Field Calculator but I cannot tell what units the resulting answers are in.


texts: QGIS substring only working on first part of multipart line

texts:
I am trying to extract part of a line starting at x meters and finishing at y meters of it's length. The problem is that if I use the "Line Substring" tool, it only works on the first part of the line. In this example, I wanted to extract a substring from 0 to 30 Km:

The documentation says the following about "Line Substring":

  If a multipart geometry is encountered, only the first part is considered when calculating the substring.

How can I manipulate my line so that it works correctly with "Line Substring"?


texts: Can I escape field names when building a Search Cursor?

texts:
I am trying to iterate through an excel spreadsheet using arcpy but having trouble querying fields that contain spaces in their names:

If I start by examining the fields by the python console I see this:

>>> source_path = r"\path\to\spreadsheet.xlsx\'sheet_name$'"
>>> fields = arcpy.ListFields(source_path)
>>> fields[1].name
u'Shire'
>>> fields[8].name
u'Area ha'

Then if I build a da.SearchCursor like this I am able to query "Shire" successfully:

>>> with arcpy.da.SearchCursor(source_path, fields[1].name) as cursor:
...     for row in cursor:
...         do_some_work(row)

But if I apply the approach to query "Area ha" it is unsuccessful:

>>> with arcpy.da.SearchCursor(source_path, fields[8].name) as cursor:
...     for row in cursor:
...         do_some_work(row)
Runtime error
Traceback (most recent call last):
  File "<string>", line 2, in <module>
RuntimeError: Syntax error (missing operator) in query expression 'Area ha'.

This leads me to ask how to escape the space character in this context or otherwise achieve this query?

I am running:

ArcGIS Desktop 10.3.1.4959
Microsoft Office Access database engine
2007 12.0.1418.1031


texts: Assign order number in which line intersect polygons

texts:
Is there any tool (plugin) for QGIS to assign order (sequence) number of line intersecting through polygons?

At this moment I use a bit cumbersome solution which works but...

I use Qchainage plugin to generate dense points along the line with order
With spatial join (Vector / Data Management Tools / Join attributes by location) I assign values from points into polygons
I make sure all polygons have assigned some value (in all of them was point), if not I fill in manually missing values
I recalculate values so they are in sequence from 1 to n (n is number of polygons the line intersect) with interval 1

There is also possible solution using PostGIS Find all intersections of a LineString and a Polygon and the order in which it intersects it . Maybe it is possible to do something similar in QGIS without PostGIS?


texts: I am looking for oil and gas pipeline for Africa or Nigeria. I have tried searching the global energy observatory platform and I cannot find it.


texts:
I have made sure the SVG path is set and that the path has SVG files:

Settings->Options->System->SVG Path > "C:\OSGeo4W64\apps\qgis\svg"

In Layer Properties > Style Manager > Marker Symbols only 14 marker symbols show up...

I have reinstalled QGIS and delete registry keys and still no luck any ideas?

Only thing I can think of is that I installed a server version once to experiment with, I deleted it however maybe something from that install is still around?


texts: Copy selected features to another feature class

texts: I had two polyline feture classes representing the same objects that I spatially joined together to reconsile/consolidate data about.  At the time I was directed to remove some features from the joined feature class because they were not of interest at that point.  Subsiquently they now are and I want to bring them from one of the original layers into the joined layer.  What is the best way to do this?


texts: Zoom to GeoJSON point feature in leaflet

texts:
I'm relatively new to Web Mapping  and trying to develop a litte Application with Angular JS and the angular-leaflet-directive. In this application I will work with a GeoJSON point layer representing different stations of a field trip. What i want to achieve is to have a button and zoom to a specific point/marker when you click on it.

I've already seen this example and was trying to reproduce the functionality for a GeoJSON point layer instead of a multipolygon.

Specific functionality in example code:

        $scope.centerJSON = function() {
        leafletData.getMap().then(function(map) {
            var latlngs = [];
            for (var i in $scope.geojson.data.features[0].geometry.coordinates) {
                var coord = $scope.geojson.data.features[0].geometry.coordinates[i];
                for (var j in coord) {
                    var points = coord[j];
                    for (var k in points) {
                        latlngs.push(L.GeoJSON.coordsToLatLng(points[k]));
                    }
                }
            }
            map.fitBounds(latlngs);
        });
    };

Now my code:

    $scope.centerPoint = function () {
    leafletData.getMap().then(function (map) {
        var lalo = [];
        console.log(lalo);
        var coord = $scope.geojson.data.features[0].geometry.coordinates;
        console.log(coord);
        lalo.push(L.GeoJSON.coordsToLatLng(coord));
        console.log(lalo);
        map.setView(lalo, 18);
    });
};

which gives the following error in firebug console:

Does anyone of you know why the setView method doesn't like my LatLng object? If I manually fill in a LatLng object like below it just works fine:

map.setView(new L.LatLng(51.4, 7.4), 15);

My GeoJSON looks like this and has only one point in it for testing purposes:

{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "id": 5 }, "geometry": { "type": "Point", "coordinates": [ 7.483522475876038, 51.487886145585634 ] } }
]
}


texts: What are Bands, Dimensions, and Histograms in QGIS?

texts:
First; I can see a band as synonymous with a channel in an image editing program like GIMP, is this correct?

If so then bands play the role of color mixing and masking.  Are there any other functions of a band in GIS ie. would I ever find more than four bands in a layer?

Second; dimension applies to a raster size in the project CRS, right? This is pixel independent (the graphic card sorts it out).  Change the CRS and raster dimensions change.  Change resolution and the raster dimensions change.

Third; anything immediately apparent in the histogram below as to the cause of binary resolution (black hole and blank space) and what parameters to alter?  Thanks so much for the help.

I just noticed from this post :

QGIS rounds up the coordinates to six decimals when saving layer changes

that numbers are rounded to six decimal places.  This is a sample of my coordinate data:

-75.10978995    40.02942646

-75.0801132 40.06566807

-75.0801132 40.06566807

-75.03800228    40.03786083

-75.24746918    39.95963876

-75.23858404    39.96544434

-75.23560721    39.94817612

-75.22978442    39.98298566

-75.20350911    39.96409881

-75.17341205    39.99858338

Is it possible that I should use the raster calculator to make these numbers bigger?


texts: How to project black lines in one image onto a shapefile?

texts:
I made my shapefile transparent and started drawing lines on the top of it using base map. It will take lot of time to do the same for all coloured palettes.

Is there an easy way to do this?


texts:
I am working on a web-map system which I am embedding in a form in an Access database. I will be distributing this database to clients so need it to be as self-contained as possible (i.e. no installation). Other than Access itself I am trying to keep this FOSS in order to keep development time and costs down.

I am looking for a way of serving map tiles to this without using an internet connection.

Can this be achieved by creating a well-structured folder of pre-created png tiles?

If not, is there a mapserver which I could distribute alongside my Access database?

Bonus question: What software can I use to create WMS tiles?


texts: I want to share my QGIS project to someone else who also uses QGIS, how would I do this? I am very new to QGIS and am not very tech savvy.


texts: I use geotools library for creating my application. Geometries I use need to be represented with style which is defined by sld. I have these styles as a library in svg format and need to convert it to sld. Are there some convertor or software whith which I can make these conversion?


texts: GeoDjango: Find all points within radius?

texts:
I am working in GeoDjango (with a Django 1.7 and PostGIS 2.1.4 backend). I have a model with a PointField in my database and I am trying to find all items within 10km radius of a point.

Here is my model code:

class Place(models.Model):
    id = models.IntegerField(primary_key=True)
    location = models.PointField(null=True, blank=True)
    objects = models.GeoManager()

Here is my view code (abridged for readability):

    from django.contrib.gis.geos import Point
    from django.contrib.gis.measure import Distance
    lat = 52.5
    lng = 1.0
    radius = 10
    point = Point(lng, lat)
    print point
    places = Place.objects.filter(location__dwithin=(point.location, Distance(km=radius)))

This gives me:

AttributeError: 'Point' object has no attribute 'location'

I see the point in the console: POINT (1.0000000000000000 52.5000000000000000).

How should I structure the query differently?

If I try just using point rather than point.location (as per the dwithin documentation) then I get a different error: ValueError: Only numeric values of degree units are allowed on geographic DWithin queries.

UPDATE:

This seems to work, but I don't know if it's correct:

    radius = int(radius)
    degrees = radius / 111.325
    point = Point(float(lng), float(lat))
    places = Place.objects.filter(location__dwithin=(point, degrees))

The results look OK, but I don't know if my conversion to degrees is reasonable.


texts: Problem with accessing the layer legend using pyqgis in QGIS 2.4

texts:
I'm trying to clear the layer selection using pyqgis.
It appears to me that:

lgd = iface.mainWindow().findChild(QtGui.QTreeWidget, "theMapLegend")

Doesn't work in QGIS 2.4 to access the layer legend.
Does anyone know a way to solve my problem?


texts: Which projections emphasise the Northern Hemisphere, other than Mercator?

texts:
I'm working on a project where I have data points in the UK, US, France/Italy, Hong Kong and Japan. I want to show a world map with mini charts at each of these locations.

For this project, it makes sense to use a map projection that emphasises the northern hemisphere, so that I have more space for the charts.

Should I just use Mercator?

Or are there other projections that are also/more suited to rendering the northern hemisphere?


texts:
Whenever I open QGIS (Ver. 2.18.3) and QGIS starts loading layers it stops and shows a error box saying:

  could not connect to server: Connection timed out (0x00000274c/10060.)
  Is the server running on "spacialdb.com"(144.76104.239) and accepting
  TCP/IP connections on port 9999.

(see screenshot). A username and a password is visible but I have not created them! The fault just came from time to time. What worries me, is that google warns against entering www.spacialdb.com!


texts:
I've developed an query to find self-intersection points by using PostgreSQL 10 and PostGIS 2.4 database. The query took long time (aprx 90mins) to produce the result from 3,122 polygons. The query is:

SELECT * FROM (SELECT DISTINCT ST_AsText((ST_DumpPoints(ST_Node( ST_ExteriorRing(geom)))).geom) pnt, id FROM "Table_Polygon" ) AA WHERE aa.pnt not in (SELECT DISTINCT ST_AsText((ST_DumpPoints( ST_ExteriorRing(geom))).geom) pnt FROM "Table_Polygon" )

The vertices returned from the two sub queries are 4,09,122 and 4,09,120 respectively. Only the additional two vertices from 1st the sub query will be result as self-intersection points

The result is:

Are there any alternative PostGIS functions which can be used to optimize this query to get the quick result from this huge volume of data?


texts: Dropping OID column when executing "Table to Table" tool in ArcMap ModelBuilder?

texts:
I am creating a ModelBuilder model, and from a feature class I am exporting the final output as .txt with "table to table" tool. (I just want a list of two fields (PID and DIST ). On the tool's field mapping list, the OID field is not there, but it shows up in the text file I create.

I tried to run "Make Table View" tool without the ObjectID field, but it still shows up in the output.

So, in the final output I have 3 fields: OID, PID, DIST (instead of PID and DIST only).

How can I get rid of the OID field?


texts: Trying to set up GeoServer for GeoMesa Hbase on EMR S3

texts:
I am running GeoMesa Hbase on AWS S3. I am able to ingest / export data from inside the cluster with geomesa-hbase ingest / export but I am trying to acces the data remotely. I have installed GeoServer (on the same Master node where GeoMesa is running if that is relevant) but I have difficulty with providing GeoServer the correct JARs to acces GeoMesa. I can find the list of JARs that I should provide to GeoServer here but I am not sure how or where to collect them. I have tried using the install-hadoop.sh & install-hbase.sh shell scripts in the /opt/geomesa/bin folder to install the HBase, Hadoop and Zookeeper JARs into GeoServers’ WEB-INF/lib folder, but if I change the Hadoop, Zookeeper & Hbase version in these shell scripts to be the same as the versions running on my cluster it does not find any JARS.
What I tried: One of the GeoMesa distributions contained a shell script 'install.dependencies.sh' which I used to collect the JARs listed here (but with versions corresponding to my setup). But when I try to add a new Data store in GeoServer I get an class not found error.
...
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
    ... 112 more
Caused by: java.lang.NoClassDefFoundError: com/ctc/wstx/io/InputBootstrapper
    at org.locationtech.geomesa.hbase.data.HBaseDataStoreFactory$.canProcess(HBaseDataStoreFactory.scala:138)
    at org.locationtech.geomesa.hbase.data.HBaseDataStoreFactory.canProcess(HBaseDataStoreFactory.scala:94)
    at org.vfny.geoserver.util.DataStoreUtils.aquireFactory(DataStoreUtils.java:95)
    at org.vfny.geoserver.util.DataStoreUtils.getDataAccess(DataStoreUtils.java:59)
    at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:626)
    at org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:33)
    at org.geoserver.web.data.store.DataAccessNewPage.onSaveDataStore(DataAccessNewPage.java:89)
    at org.geoserver.web.data.store.AbstractDataAccessPage$1.onSubmit(AbstractDataAccessPage.java:173)
    at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:111)
    at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215)
    at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1309)
    at org.apache.wicket.markup.html.form.Form.process(Form.java:976)
    at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:797)
    at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171)
    at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:155)
    at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:601)
    ... 117 more
Caused by: java.lang.ClassNotFoundException: com.ctc.wstx.io.InputBootstrapper
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
    ... 133 more

I am running everything on an EMR 6.2.0 release version (which comes with Hadoop 3.2.1, Hbase 2.2.6 and Zookeeper 3.4.14). On top of the cluster I am running GeoMesa 3.0.0-m0 with GeoServer 2.17 but I have also tried GeoMesa 2.4.0 with GeoServer 2.15. I’m fine with switching in either the EMR release version or GeoMesa/Server if that makes things easier.


texts: Error using QGIS 3.2.2 Warp (Reproject) tool with custom coordinate system

texts:
I'm using the QGIS Warp (Reproject) tool to reproject a raster from WGS84 to a Lambert Conformal Conic custom projection in QGIS 3.2.2. The call to the GDAL/OGR console is the following:

gdalwarp -t_srs "+proj=lcc  +lat_1=13.31666666666667  +lat_2=14.25  +lat_0=13.783333  +lon_0=-89 +x_0=500000 +y_0=295809.184 +ellps=clrk66 +units=m +no_defs +towgs84=0,125,194,0,0,0,0 +wktext" -r near -ot Int16 -of GTiff C:/n13_w090_1arc_v3.tif "C:/Users/HP COREi5/Documents/n13_w090_1arc_v3_nad27.tif"

The result I get is the following:

Processing algorithm…
Algorithm 'Warp (reproject)' starting…
Input parameters:
{ 'DATA_TYPE' : 1, 'INPUT' : 'C:/n13_w090_1arc_v3.tif', 'MULTITHREADING' :
False, 'NODATA' : None, 'OPTIONS' : '', 'OUTPUT' : 'C:/Users/HP
COREi5/Documents/n13_w090_1arc_v3_nad27.tif', 'RESAMPLING' : 0, 'SOURCE_CRS'
: None, 'TARGET_CRS' : 'USER:100057', 'TARGET_EXTENT' : None,
'TARGET_EXTENT_CRS' : None, 'TARGET_RESOLUTION' : None }

GDAL command:
gdalwarp -t_srs "+proj=lcc +lat_1=13.31666666666667 +lat_2=14.25
+lat_0=13.783333 +lon_0=-89
+x_0=500000 +y_0=295809.184 +ellps=clrk66 +units=m +no_defs
+towgs84=0,125,194,0,0,0,0
+wktext" -r near -ot Int16 -of GTiff C:/n13_w090_1arc_v3.tif "C:/Users/HP
COREi5/Documents/n13_w090_1arc_v3_nad27.tif"
GDAL command output:

FAILURE: No target filename specified.

Usage: gdalwarp [--help-general] [--formats]

[-s_srs srs_def] [-t_srs srs_def] [-to "NAME=VALUE"] [-novshiftgrid]

[-order n | -tps | -rpc | -geoloc] [-et err_threshold]

[-refine_gcps tolerance [minimum_gcps]]

[-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]

[-ovr level|AUTO|AUTO-n|NONE] [-wo "NAME=VALUE"] [-ot Byte/Int16/...] [-wt
Byte/Int16]

[-srcnodata "value [value...]"] [-dstnodata "value [value...]"] -dstalpha

[-r resampling_method] [-wm memory_in_mb] [-multi] [-q]

[-cutline datasource] [-cl layer] [-cwhere expression]

[-csql statement] [-cblend dist_in_pixels] [-crop_to_cutline]

[-of format] [-co "NAME=VALUE"]* [-overwrite]

[-nomd] [-cvmd meta_conflict_value] [-setci] [-oo NAME=VALUE]*

[-doo NAME=VALUE]*

srcfile* dstfile

Available resampling methods:

near (default), bilinear, cubic, cubicspline, lanczos, average, mode, max,
min, med, Q1, Q3.

Execution completed in 0.18 seconds
Results:
{'OUTPUT': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/HP
COREi5/Documents/n13_w090_1arc_v3_nad27.tif, 'createOptions':
{'fileEncoding': 'System'}}>}

Loading resulting layers
The following layers were not correctly generated.

C:/Users/HP
COREi5/Documents/n13_w090_1arc_v3_nad27.tif

You can check the 'Log
Messages Panel' in QGIS main window to find more information about the
execution of the algorithm.

If I type the same GDAL/OGR call in the OSGeo4W Shell it runs without problems.

Does anyone know if there is a workaround in QGIS?


texts: How to get a pop up in QGIS when clicking on points on a map

texts:
I have QGIS V 2.12.0 and am an absolute novice, doing some volunteer work for a charity.

I have created a map with added Delimited Text Layer.  This references Buildings by Latitude and Longitude from an imported CSV file (an Excel file).  This all works fine on different maps.  I would like to to be able to click on the points on the map and for information to be displayed in a box or window, such as the Building's details and address which has been successfully imported in the Attribute Table and then hopefully with this display a thumbnail image, but I don't know how to do this.

I have seen a similar post regarding clicking points and images then popping up, but the advice given related to creating a point file. Can I use my Delimited Text Layer, or do I need to do something else?  I have no idea as yet how to get the data from my CSV file into a point file if this is the recommended route.


texts:
I have downloaded hadoop tools for ArcMap and installed. In the ArcToolboxe window the hadoop tools are displayed.
In the hadoop toolbox the "Copy from HDFS" tool is asking for an HDFS server hostname, TCP port number, username and remote file. I'm having hard time getting these right. Please tell about the values to be typed in the host name, username and port number.
I'm using "Cloudera VMWare" for analyzing the data using hive queries.


texts: Getting zmin zmax of a raster parameter in a tool validation in ArcGIS Desktop 10.7 toolbox Python script

texts:
I am developing a Python tool (my first one).
The tool has 3 input parameters:

a raster
z min
z max

I am trying to get automatically z min and z max after the user specify the raster using the validation script but I got this error:

TypeError: expected a raster or layer

This is my code (commented lines are other attempts I tried without results):
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed.  This method is called whenever a parameter
has been changed."""

if self.params[0].altered:
  if self.params[0].value:
    #rst_ds = self.params[0]
    rst_ds = self.params[0].value
    self.params[1].value = arcpy.Raster(rst_ds).minimum

    #self.params[2].value = arcpy.Raster(rst_ds.replace('\\','/')).maximum
    #arcpy.MakeRasterLayer_management(rst_ds, "rst_lyr")
    #self.params[1].value = arcpy.Raster("rst_lyr").minimum

return


texts: What is the origin of the term "kinematic" in RTK?

texts:
Where does "Kinematic" in "Real Time Kinematic" (RTK) come from?
Most litterature on RTK explains that it stands for Real Time Kinematic, but not why that name is used instead of something more descriptive like "real time carrier phase differential positioning".


texts: Q: Issue finding the nearest street segment(s) based on an x,y coordinate and ordering by distance

texts:
I'm trying to pull the SNOW_ROUTE attribute from the nearest street segments based on an X,Y coordinate and order the results by nearest segment.  I'm able to return the snow route information but the distance values are not returning and the results are not returned in order with the nearest at the top.

Here is the query that returns the snow routes but doesn't return distance values or sorted by nearest:

SELECT SNOW_ROUTE, sde.st_distance(shape,SDE.ST_POINT(1362521.32365368, 451903.559144756, 300004)) DISTANCE
FROM SDE.STREETS
WHERE sde.st_intersects(shape, sde.st_buffer(SDE.ST_POINT(1362521.32365368, 451903.559144756, 300004),200)) = 1
ORDER BY DISTANCE;

SNOW_ROUTE   DISTANCE
---------- ----------
2-13R
2-13R
2-12P
2-12P
2-12P

5 rows selected.

This is another attempt that runs without error but no rows are selected:

SELECT SNOW_ROUTE, sde.st_distance(shape,SDE.ST_POINT(1362521.32365368, 451903.559144756, 300004)) DISTANCE
FROM SDE.STREETS
WHERE sde.st_intersects(shape, sde.st_buffer(SDE.ST_POINT(1362521.32365368, 451903.559144756, 300004),500)) = 1
and  sde.st_distance(sde.st_geometry(1362521.32365368, 451903.559144756,null,null, 300004),shape) < 500
ORDER BY distance;


texts: GeoServer GetFeatureById Stored query not working

texts:
I can't get the stored query GetFeatureById to work. The GetFeature request with id works:

  https://opendata-view.smhi.se/svar2012_coast-sea/wfs?service=WFS&request=GetFeature&typeNames=svar2012_coast-sea:smhi_kustvatten_och_havsomraden_SVAR_2012_2&featureID=smhi_kustvatten_och_havsomraden_SVAR_2012_2.1&version=2.0.0&

But with the stored query it doesn't:

  https://opendata-view.smhi.se/svar2012_coast-sea/wfs?service=WFS&request=GetFeature&storedquery_id=urn:ogc:def:query:OGC-WFS::GetFeatureById&id=smhi_kustvatten_och_havsomraden_SVAR_2012_2.1&typenames=svar2012_coast-sea:smhi_kustvatten_och_havsomraden_SVAR_2012_2&version=2.0.0&

Error message:

<ows:Exception exceptionCode="NotFound" locator="GetFeature">
  <ows:ExceptionText>Could not find feature with specified id</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Any ideas?


texts: Shift or replace_z values from ALS LiDAR scans

texts:
I have ALS LiDAR scans that I merged into a single file and classified ground points. I'm trying to 're-scale' the Z/height values but without actually normalizing them.. What I'd like to do re-scale the non-normalized min-Z values to 0 at the ground points, and the max-Z values would be relative. The primary reason for doing this (as opposed to simply normalizing the data) is to keep the contour of the terrain for gap-fraction/light-transmittance analysis.
In LAStools, I have used the lasheight tool with the 'replace_z' option, but this appears to result in the same output as simply normalizing the scans. i.e., the min Z values are indeed 0, but the terrain is flat (when it should be moderately hilly). Any LAStools or lidR-based ideas or suggestions (I am new to LiDAR)?
The LAStools script I ran looks like:
-replace_z -o "merge_clip_replaceZ.laz"


texts: Using ESRI Python's Geoprocessor Via mod_python

texts:
I am working on a number of geoprocessing services to be accessed solely by web clients.  The traditional method of encapsulating this type of stuff in toolboxes and then publishing the toolbox just won't work.  For example, I would like to send some binary data (zip files) back to the client, and that is not possible.  I know I could store the zip file on the server, and send the url to the client, but I really HATE that approach for many reasons.

I am thinking about writing a traditional python based gp script, and making that available to a web client via mod_python and Apache.  I haven't even tried it yet to know that its possible, but I can't imagine why it wouldn't be.  However, is the use of the geoprocessor in this context legal (I do have valid AGIS Server license)?


texts: Plot a EPSG:4326 KML File using Google Maps V3

texts:
I have a KML file that uses EPSG:4326.
Is there any way to plot this onto a Google Map (v3) which uses Mercator?

Here is the page I am working on

The district data comes from one source and is Google friendly.

The outage data is generated by the power company using their GIS system. It shows a list of power outages. However nothing is shown on the map.
Have seen this file work in openlayers but I really have no clue why it would not be showing up.


texts:
I have 11 time series wich include the values wind direction, wind speed and wind power. What I want to do is an interpolation between each value. Each time series contains 8670 values for every hour of one year. I need to put this 11 time series into QGIS. Each of the 11 time series has to be a "Weather Station" (Point Layer, maybe in a multipoint layer?!) wich include the 8760 values for each hour and the columns direction, speed, power. Furthermore I want to do an interpolation between the 11 "stations". For Example, I want to say "Qgis ==> Raster==> Interpolation ==> choose Station  ==> value "speed" ... The result should be, that Qgis does an interpolation between every station and values of the choosed column.

What I want as a result at the end is an Windmap wich makes clear how many wind power or wind speed is at a speacial location (as you can see in my picture, WRONG VALUES!)


texts: Printing maps with WMS layers: warning about width & height limits

texts:
Using the mapping I created a template with the necessary elements, but I have a problem, because when I have loaded layers wms and I want to generate the print in pdf format or send direct to the printer, I get this error message "Some servers WMS layer (eg UMN mapserver) has a limit for the WIDTH and HEIGHT parameters.Print layers of these servers can exceed this limit.If this is the case, the WMS layer will not print "

And this happens with any layer of wms service that has loaded. I have tested with versions 2.16 and 2.18 of Qgis. I do not know if there is any specific configuration, as I have reviewed and I find nothing about it.


texts: ArcExplorer - possible connect to a non-SDE database?

texts: In ArcExplorer, I'm wondering if you can connect to a non-SDE database, like SQL Server, with geometry or geography columns?


texts:
I had this option available to me at a previous job, and I have been trying to recreate it for sometime to no avail.  I was trying the custom tool bar route/model builder/ data driven pages route to no avail.

Basically it is tool bar with dropdowns where the user first selects the feature class, then they select the year (a field in the feature class), then they select the name of the job.  Then the user has the one record of interest zoomed to, so they can print off a map.

An example would be like this:

Select the feature class-> the dropdown options would be "logging" or "tree planting", etc.
Select the year (which a field in the logging or tree planting feature class)-> the drop down options would be "2015", "2016", etc
3.Select from a list of jobs associated with first two options-> ie you could see all the tree planting jobs from the year 2015 and select one.

I would consider myself an intermediate GIS user, but I have a feeling that this tool was made by a power user(s) at my previous job.


texts: Storing elevation for hiking paths as polylines

texts:
I need to store the z value for hiking paths. I have the GPS coordinates (points) and the tracks (polylines). I know I can store elevation data easily with the points but are there any ways of storing elevation data with polylines?
I would like to avoid having to make a huge table of a gigantic collection of points so I would prefer to only store the tracks. I am using QGIS.


texts: Json To Features ERROR 001558: Error parsing json file. The workspace is not connected

texts:
I am trying to convert a JSON file into a feature. My code was working fine until today and now I am getting the following error - ExecuteError: ERROR 001558: Error parsing json file '<filepath>'. The workspace is not connected..

I tried it manually in ArcMap using this proceedure:

I first checked that the JSON file looked correct (had all the prerequisites like geometryType, Features, etc...).
In arcMap (10.5), I went to toolbox > Conversion Tools > JSON > JSON To Features.
I input the filepath to the .json file and then made sure the output went to a .gdb.
I double checked the filepaths.

Same results: ERROR 001558. I even tried the default output, which went to the ArcGIS\Default.gdb. I also got the same error:

  ExecuteError: ERROR 001558: Error parsing json file ''. The
  workspace is not connected. Failed to execute (JSONToFeatures).

In researching this issue, I found the ArcGIS Pro page on 001558: Error parsing .json file <value> which states that the The JSON must have at least the geometryType, spatialReference, fields, and features (with geometry and attributes) property. I checked the data and it has
geometryType, spatialReference, fields, and features which have  attributes and geometry.

{"displayFieldName": "CSLF_ID",
"fieldAliases": {...},
"geometryType": "esriGeometryPolygon",
"spatialReference": {
  "wkid": 102100,
  "latestWkid": 3857
},
"fields": [...],
"features": [
  {"attributes": {...},
   "geometry": {...}
  },...]}

So, I am wondering if there might be something else causing the error. Or can anyone see an issue with the JSON file above?


texts: Automatically zoom to region of map where GPS traces appear and run TimeManager

texts:
How would I accomplish in qgis automating of the production of multiple TimeManager recordings with a consistent orientation, zoom  and framing of gps traces?.

I expect it will involve python & postgis db queries but I've new to qgis and python so not sure where to start with setting orientations and framing a map layer or triggering TimeManager

For example suppose I have gps traces of events each with distinct start and end times taking place in different regions.

Region A

Event 1

Region B

Event 2

Region C

Event 3

How can I use qgis & its TimeManager Plugin to automate the creation of the 3 events exports but setting the desired zoom etc to frame the recordings so they are all appear identical without requiring the user to manually pan and zoom to each event location and manually set up TimeManger? It would be great if it was able to react to new data entering a postgis db so that when event 4 was added it would process or at least prompt the user to see if it shold be processed


texts: Selecting parallel line segments but not segments that intersect

texts:
I have 2 different shapefiles that each have railroad track on them. Most of the track being displayed is the same, but since it is coming from 2 different sources, the physical lines themselves are about 0.5 feet apart. The goal of my analysis is to find what segments of track are common between the 2 shapefiles and also what segments of track only exist in one shapefile or the other.

I tried doing select by location: within a distance of 1 foot, which solves most of my problem, but there is an issue. Wherever one track crosses the other, the two segments on either side of the node are also selected, because they are within 1 foot of the other track (due to crossing). Thus, if a segment of track that only exists in shapefile A crosses a segment of track that exists in shapefile B, the 2 line segments of track A on either side of track B will be selected.

I only want common track to be selected, thus if A and B run parallel to each other and are within 1 foot, I want them to be selected. Is there any way to do this without also selecting track segments that cross the track?


texts:
Is there a python library that can be used to make a line shapefile m-aware?

To be achieved only using python code and not arcpy libraries


texts: How to create a Google Maps with draggable routes with fixed markers

texts: I have a webapp where I show a route on a map, I pass two address and show the route on map, so I'd like that this route should be draggable but the points A and B shoud be fixed. How to do this?


texts: Delete layer created during Buffer_analysis

texts:
I am trying to figure out how to delete the layer that is created during the Buffer_analysis line.  I have searched all over the internet and have honestly tried about 100 different methods and cannot seem to find one that works.  If I was to type a layer "name" I can delete the layer, but in this case the layer name will be dependent upon the user input at "outPath = arcpy.GetParameterAsText(1)"

This is only my second script so this is kicking my butt, I have been googling the heck out of this just to get this far, we have had zero teaching in our online class (just told to read a chapter and write a code).

UPDATE:
Here is my full script.

# William Herzig
# Week 6 tool creation
# 6 Aug 2019

import arcpy
from arcpy import env

arcpy.env.workspace = "\\\\SNHU-LABS-UTIL2.snhu-labs.com\\userprofiles$\\william.herzig\\Documents\\programming\\module_5_data\\week_5.gdb"

arcpy.env.overwriteOutput = True

# List of all variables for the script
# User input variables (parameters)
# Input parameters for buffer tool
inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)
bufferDistance = arcpy.GetParameterAsText(2)

inPath1 = arcpy.GetParameterAsText(3)
outPath1 = arcpy.GetParameterAsText(4)
bufferDistance1 = arcpy.GetParameterAsText(5)

inPath2 = arcpy.GetParameterAsText(6)
outPath2 = arcpy.GetParameterAsText(7)
bufferDistance2 = arcpy.GetParameterAsText(8)

# Input parameter Master Shape, used for clip tool, erase tool and Master Shape layer
natPark = arcpy.GetParameterAsText(9)

# Input variable for the final output feature class
finalOutput = arcpy.GetParameterAsText(10)

# Pre-defined variables
buffered_area = "buffered_area"
clip = "clip"
clip1 = "clip1"
clip2 = "clip2"
layer_name = finalOutput
layer_name1 = "Master Shape"
mxd = arcpy.mapping.MapDocument("CURRENT")
df=arcpy.mapping.ListDataFrames(mxd, "*")[0]
layerList = arcpy.mapping.ListLayers(mxd, "", df)

# Clip tool, clipping the 3 input feature classes to the Master Shape.  This will reduce clutter and time due to less features for the buffer tool
arcpy.Clip_analysis(inPath, natPark, clip, "")
arcpy.Clip_analysis(inPath1, natPark, clip1, "")
arcpy.Clip_analysis(inPath2, natPark, clip2, "")

# Buffer tool, places a user defined buffer around each of the 3 input feature classes and exports to the user defined feature classes, also adds as a layer to the map
buffer1 = arcpy.Buffer_analysis(clip, outPath, bufferDistance)
buffer2 = arcpy.Buffer_analysis(clip1, outPath1, bufferDistance1)
buffer3 = arcpy.Buffer_analysis(clip2, outPath2, bufferDistance2)

# Union tool makes a single feature class by combining the 3 buffer outputs into one
arcpy.Union_analysis([buffer1, buffer2, buffer3], buffered_area, "ALL", "", "GAPS")

# Erase tool erases the Union features from the Master Shape (natPark parameter) and saves as the finalOutput parameter feature class
arcpy.Erase_analysis(natPark, buffered_area, finalOutput, "")

# Adds a layer for the Master Shape (natPark parameter)
arcpy.MakeFeatureLayer_management(natPark, layer_name1)
add_layer1 = arcpy.mapping.Layer(layer_name1)
arcpy.mapping.AddLayer(df, add_layer1)

# Adds a layer for the finalOutput parameter (the result of the erase tool)
arcpy.MakeFeatureLayer_management(finalOutput, layer_name)
add_layer = arcpy.mapping.Layer(layer_name)
arcpy.mapping.AddLayer(df, add_layer)


texts: shapely examples use 'figures', what is this library?

texts:
For example

https://shapely.readthedocs.io/en/latest/code/polygon.py

uses a library 'figures'.  I can't seem to locate this library.  There
are several libraries on PyPi with figures in the name, but none seem correct


texts: Determining if two locations are duplicate

texts:
I'm working on an app that will display drugstores in a map. I have a table that has all drugstores, each with its Lat/Lon.

We used several different sources to add the data to the table: the Walgreens location app, Waze, Google Maps, among others. Naturally, one location can be in all three sources, so there are many duplicates.

The problem is that one specific location may be in Waze and the Walgreens app, but they both have slightly different coordinates.

How do I determine if two sets of coordinates are for the same location? Is there a "difference" I can calculate and then determine if they're different locations?


texts: Apply an SLD saved on Geoserver to OpenLayers 3

texts:
I am a complete beginner in JavaScript, XML and coding in general (so if there's anyway for me make my question more clear please tell me).

I have loaded a WMS onto my OpenLayers 3 map. The relevant code looks like this

var vectorLayer3 = new ol.layer.Tile({
    source: new ol.source.TileWMS({
        preload: Infinity,
        url: 'http://localhost:8080/geoserver/wms',
        serverType:'geoserver',
        params:{
            'LAYERS':"jazz", 'TILED':false, 'STYLES':'mostbasic'
        }
    })

});
    map.addLayer(vectorLayer3);

The map loads, but I get the generic style instead the 'most basic' style. I can get the style to show properly using the preview on WMS, so I don't think the problem is with the SLD. Looking at the documentation for ol.source.TileWMS it looks like there should be someway to get the style like I tried, but I am having trouble seeing it.

If I am completely off base, would following this tutorial be the best way to go, should I use a vector, WFS or is there a better strategy?


texts: Conversion of X, Y values to different coordinate system

texts: Is there a way to convert coordinate X, Y values in SQL Server from one type of coordinate system to another using SQL Transaction? Like NAD83 State Planes to WGS 1984. My objective is to use a single ArcGIS web map to analyze and show X, Y values that has different type of coordinate system. I plan to convert or transform first the coordinate values to a common type of coordinate system like WGS 1984 before saving them to geodatabase.


texts: How can a single Open Data Cube product be dumped from the index database?

texts: How can a single product be dumped from the index database to be included in another index database? I know a few Postgres commands to dump the full agdc database within the Postgres database, but the indices we are working with are becoming quite large, so being able to restore individual products without losing others (not a database overwrite - additive) would be quite useful.


texts: Setup a map server that runs from USB to whatever computer it is connected?

texts:
I would like to have a USB that I can bring with me to any computer. That USB should hold a map server, so that the client computer won't need internet and avoid using OSM or Google Maps or any other online map service.

I have another portable application that requests a WMS service to load maps, but I would like to direct that import to my local USB map/WMS server. Is PortableGIS the solution? I am using PortableGIS for QGIS and that works fine. However I can't find any documentation...


texts: WMS reprojection shift using QGIS Server

texts:
I've set up a project in QGIS Desktop 3.14 using EPSG:3857 projection and I'm trying to use it through WMS in a web application.
Data is stored in a SQL Server database in EPSG:3003 projection.
The problem is that using WMS I'm getting a ~100m shift in reprojected data.
This is what I see using QGIS Desktop

When I add the same layer from the same project, using WMS, I get this

I'm using 3857 for the project, in both situations.
The same happens using the WMS with OpenLayers.


texts: OpenLayers WFS protocol: work with filters if the protocol is defined out of layer constructor

texts:
follow question:wfs-load-feature-check

the scenario is: i am trying to load a WFS layer, since it takes a while to load all features, I want to give user a notice while waiting for response. the process employs spatial filter (BBOX strategy) and attribute filters. I am wondering whether there is a good way to make WFS protocol work with these filters, in other words, only request the filtered features.

thanks a lot!

code sample:

 var wfsLayer = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        styleMap: new OpenLayers.StyleMap({
            strokeWidth: 3,
            strokeColor: "#333333"
        })
    });

var filt = new OpenLayers.Filter.Logical({
    type: OpenLayers.Filter.Logical.OR,
    filters: [
        new OpenLayers.Filter.Comparison({
            type: OpenLayers.Filter.Comparison.EQUAL_TO,
            property: "TYPE",
            value: "highway"
        }),
        new OpenLayers.Filter.Comparison({
            type: OpenLayers.Filter.Comparison.EQUAL_TO,
            property: "TYPE",
            value: "road"
        })
    ]
});

var prot =  new OpenLayers.Protocol.WFS({
    url:  "http://demo.opengeo.org/geoserver/wfs",
    featureType: "tasmania_roads",
    featureNS: "http://www.openplans.org/topp"
});

var _CallBack = function(resp) {
    if(resp.error) {
        console.log('error');
        return -1;
    }
    wfsLayer.addFeatures(resp.features);
    console.log('success');
    return 1;
};

var response = prot.read({
    callback: _CallBack
});


texts: QGIS load error ("No transform between 4326 and Customer projection", and "Resource locator error")

texts:
I'm having an endless issue with my QGIS install on start up. I m using 3.18, on Ubuntu Budgie and on startup, it gives me a no-transform error between 4326 and custom.

Not sure what customer means as I don't believe I have any custom projections. QGIS workspace was defaulting to 2193, but I just changed it to 4326 and started and the no-transform error does not appear. But as soon as I try to open one of my projects that uses 2193, then the issue comes back, then I get a resource location error and have to close QGIS. So I can't use QGIS anymore. I have searched the web and don't seem to see or know if I have the correct fix. I tried one and it seemed to work, then I came back to it and it's back again. I can't find that fix again, unfortunately. I think I basically uninstalled the SRS.db file and reinstalled it. Other examples of this don't work, I can't delete all QGIS files for some reason.

How can I troubleshoot this?


texts: Is toggle button's state stored in some property in Mapinfo?

texts: Well can we retrieve On or OFF state of toggle button. Do we have any property of toggle button that can be read from toggle button that is ON or OFF?


texts: Certain errors running ScriptRunner3 on QGIS 2.99 (classFactory() method)

texts:
I have been trying to learn QGIS and I've been tasked to start with QGIS 3 so I have been going through Gary Sherman's PyQGIS Programmer's Guide.

I am currently using QGIS 2.99.0-Master, running Python 3.6.4, and am working with Script Runner 3.0.3.

I also have QGIS 2.18.15 which has Script Runner working fine. (I was midway going through an earlier edition (for QGIS 2.0) of the same guidebook before I got the newer one (for QGIS 3), which I then switched to.)

I have been trying to install ScriptRunner3 using QGIS's own plugin installer, but I keep getting some this error:

Couldn't load plugin 'scriptrunner3' due to an error when calling its classFactory() method

ImportError: DLL load failed: The specified module could not be found.
Traceback (most recent call last):
  File "C:/PROGRA~2/QGIS2.99/apps/qgis-dev/./python\qgis\utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\scriptrunner3\__init__.py", line 24, in classFactory
    from .scriptrunner import ScriptRunner
  File "C:/PROGRA~2/QGIS2.99/apps/qgis-dev/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\scriptrunner3\scriptrunner.py", line 27, in
    import win32api
  File "C:/PROGRA~2/QGIS2.99/apps/qgis-dev/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: The specified module could not be found.

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)]
QGIS version: 2.99.0-Master Master, b6ad920404

Python Path:
C:/PROGRA~2/QGIS2.99/apps/qgis-dev/./python
C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~2/QGIS2.99/apps/qgis-dev/./python/plugins
C:\Program Files (x86)\Python36-32\Lib\site-packages\win32
C:\Program Files (x86)\QGIS2.99\bin\python36.zip
C:\PROGRA~2\QGIS2.99\apps\Python36\DLLs
C:\PROGRA~2\QGIS2.99\apps\Python36\lib
C:\Program Files (x86)\QGIS2.99\bin
C:\PROGRA~2\QGIS2.99\apps\Python36
C:\PROGRA~2\QGIS2.99\apps\Python36\lib\site-packages
C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python

It might be worth to note that there was a previous error, where QGIS could not find win32.api (despite me having installed it already) and I had to append the PYTHONPATH environment variable to get around that. So the error at hand might just be very bad installation on my part.


texts:
I have a shapefile with contours and their heights.

Is it possible to make a DEM from contours in QGIS without using GRASS?

I found Creating DEM from contours using ArcGIS Desktop? but the answer is for ArcGIS Desktop.


texts: Coordinate Transformation Difference between QGIS and Proj

texts:
I transformed coordinates on PyQgis and Proj command line and there is 3.8 meters difference between the transformations. I used the same EPSG codes.
For Proj 6.3:
echo 35.53 38.75 | cs2cs +init=epsg:4326 +to +init=epsg:23036

Result: 719891.09   4292257.07
For PyQgis 3.10:
x, y = 35.53, 38.75
src = QgsCoordinateReferenceSystem(4326)
dest = QgsCoordinateReferenceSystem(23036)
tform = QgsCoordinateTransform(src, dest, QgsProject.instance())
point = tform.transform(QgsPointXY(x, y))
print ("coordinates: ", point)

Result: coordinates:  <QgsPointXY: POINT(719887.53 4292255.79)>
I think Proj command line result is more accurate. Is there a way to fix it for QGIS?


texts: Current User's ID as Default Attribute in QGIS (QField)

texts:
I have a QGIS project running on QField that allows the user to draw points/lines and assign attributes to them. As soon as the point/line is drawn, an attribute mask pops up where all the attributes and photos are filled in. Since this QField project is used by many users (each having an unique ID), it also asks for the ID of the user.

Is there a way to define the user's ID as current default value, so that the current user doesn't always need to select their ID in the dropdown?

Also, all the users use the same tablet at different times.


texts: Creating transparent text (watermark) in ArcGIS for Desktop?

texts:
I am trying to insert a watermark into a map using ArcGIS.  As you can see from the screenshot, I have the text in place, although I need to make the text transparent (e.g. 50% transparency).  I used "insert text from the Insert menu to add the text.  There does not seem to be any way to accomplish this using the insert text method.

Is there another way to include transparent text in a map layout?


texts: Web maps using Oblique Mercator or other alternative projections?

texts:
I'm working toward creating a series of web maps involving relations between Canada and the Asia Pacific. The standard Spherical Mercator projection supported (exclusively it seems) by all major web-mapping frameworks is wildly unsuited to the task due to the extreme distortion in the north.
I really need to be able to use some other projection for this while also still being able to publish the final result as an interactive web map. My understanding is that the support for other projections in web cartography is essentially nil, with the exception of Proj4Leaflet. Working on the front-end only, that of course doesn't help me produce map tiles, and the support for alternative projections in that domain seems to be even slimmer. For example, I tried to create tiles in QGIS with a custom projection set in my map display and it managed to convert everything to Spherical Mercator automatically for the output - no projection options at all.
I'm beginning to wonder if the easiest solution isn't just to define an Oblique Mercator projection suited to my particular region, and then just try to shoehorn it into the framework used to display standard Web Mercator maps.
Is there any better, easier, less hacky way of doing this? Are there any web-mapping frameworks out there that support a reasonable set of alternative projections?


texts: Why does closing and re-opening ArcCatalog before running an ArcGIS modelbuilder model improve stability and can this be replicated in the model?

texts:
I am using ArcGIS 10.2.2 and ModelBuilder. I have a set of models that work and have been tested.

I notice that if I run through the models one after another the open dialogue becomes very slow to open and sometimes freezes. However if I close and re-open ArcCatalog before running, then the model opens OK. This is consistent behavior on different PCs.

My question is, is there some command, or python script I can add at the end of the model that will cause a "re-set" in the same way as closing ArcCatalog? I found a tool on clear cache, but it only relates to ArcSDE.

This is probably yet another quirk of ModelBuilder, but any shared experience would be useful to know.


texts: Getting layer EPSG in ArcMap using ArcPy?

texts:
How do i get my layer EPSG with Python in ArcMap 10.1?

It needs to return a integer.

something like this:

layerEPSG = arcpy.getActiveLayerEpsg()

Here is some context:

    insrs = arcpy.SpatialReference(layerEPSG)
    outsrs = arcpy.SpatialReference(4326)
    newcoord = arcpy.PointGeometry(arcpy.Point(x,y),insrs).projectAs(outsrs).lastPoint

Actually i needed the dataframe factorycode which is this:

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
projectEPSG = df.spatialReference.factoryCode


texts: GDAL Georeferencer Tool Not Appearing In Processing Menu - QGIS 3.4 Ubuntu

texts: I know this question has been raised several times before (Georeferencer on QGIS3 Missing? and Missing Georeferencer), but my situation is somewhat different. The georeferencer tool does not appear in the processing menu, and I have tried checking the box under the plugin settings - it will stay checked while in same session, but if I close QGIS and restart, the box is unchecked again. Either way, the tool never appears in the processing menu. I have also uninstalled/reinstalled QGIS and find the exact same situation.


texts: Suppress Layers not in Map Extent in Printed Map

texts: When a map is printed with a legend, is it possible to suppress the layers not visible within the map extent from being printed in the legend, even if they are activated in the Layers section?


texts: What will happen when Russia shuts down the GPS stations?

texts:
Russian officials are seriously talking about shutting down US GPS ground stations within their borders and Deputy Prime Minister of Russia tweeted on the subject.

What will happen to the GPS? My assumption would be that its accuracy will get worse, at least in some parts of the globe. If it is correct, then where, and by how much exactly?

I have previously posted this question on physics.stackexchange.com and here are two answers I have received there. They seem to be a little contradictory, though.

  Kyle Kanos:
  Usually ground stations are alternative points for a 3rd/4th signal
  since it is a fixed (known) location. Russia, at least in the 90s,
  didn't have a way to connect to the 24 satellites & depended on the
  stations; I doubt that they are of any use anymore given GLONASS

  user6972: There are two types of GPS ground stations for the USA
  system. Main stations about 5 around the world provide corrections to
  timing data due to relativistic effects, clock drift, ephemeris, or
  ionospheric delays that are timing constants rebroadcast by the
  satellites to receivers for corrections. The types of stations in
  Russia are for augmented gps called Global-DGPS . DGPS improves local
  GPS accuracy from about 3m to 10 cm. However this lack of support in
  Russia's areas only effects civilian use of the US system in those areas. The Chinese, EU, and Russian systems won't be effected.

  "Employing a large ground network of real-time reference receivers,
  innovative network architecture, and award-winning real-time data
  processing software, the GDGPS System provides decimeter (10 cm)
  positioning accuracy and sub-nanosecond time transfer accuracy
  anywhere in the world, on the ground, in the air, and in space,
  independent of local infrastructure." (gdgps.net)


texts:
I recently found some information on exporting map styles in arcmap and I used this to save some specific symbology that I will need to reuse many times.  However, I can't find any documentation or tools on importing the map styles? I have the same exact layers with the same schema, but now I want to apply the same symbology using my exported map styles.

I tried this tool for the first time because it seemed more efficient than saving individual styles or saving layer files. How can I import the map styles back in that I exported? I can import them in as a custom style, but I want them to automatically apply back to the appropriate layers.


texts: Accumulated sum using custom Python Expression functions (QGIS3)

texts:
I'm using PyQGIS within an standalone application. Now I wanted to create a custom expression. How to find the cumulative sum of numbers in a colunm?
camada = iface.activeLayer()
features = camada.getFeatures()

camada.startEditing()

def sumComprLote(features, lote):

    soma = 0
    for f in features:
        soma = soma + f["comp"]
        print(soma)

   return soma

sumComprLote(features, -1)

In the Python Editor, this cumulative sum function performs perfectly, but I need to do it on the Field Calculator (Expression or Function Editor).


texts: LZW compression differences between Global Mapper and gdal_translate

texts:
I compressed an GeoTIFF image with both gdal_translate and Global Mapper with LZW compression. The one Global Mapper compressed is much smaller, is almost 30% of the one gdal_translate compressed.

gdal_translate -co COMPRESS=LZW -co TILED=YES -co PREDICTOR=2 1.tif lzw1.tif

How can I compress it further like Global Mapper?


texts: Looking for Mid-Holocene (~6000 BP) bioclim dataset

texts:
I am trying to obtain climate data for the Mid-Holocene (~6000 BP), preferably in the bioclim (19 bioclimatic variables) raster format. The worldclim.org website lists this dataset based on the CCSM and MIROC models, but does not provide any links to download the datasets. I have contacted the authors of the website and received no response. However, this dataset has been used in  Chan et al. (2011) and the lead author on the paper only responds the they obtained the data from MVZ-GIS (UC Berkeley Museum of Vertebrate Zoology GIS). I cannot find the dataset there either. Can anybody direct me to a web source for this dataset or does anybody have these data and is willing to share it? I realize that the raw data is available on the PMIPII website, but I currently do not have the skills to programmatically process this dataset into the bioclim format.

Chan et al. 2011. Integrating statistical genetic and geospatial methods brings new power to phylogeography. MPE 59 (2): 523-537 (http://www.sciencedirect.com/science/article/pii/S1055790311000480).


texts: Data conversion from csv into GRIB or NetCDF format

texts: I want to use Crayfish plugin for spatial temporal analysis of oil spill events. These data are available in csv format. Does anyone has an idea of how csv data can be converted into GRIB or NetCDF formats to enable me proceed.


texts: Is there a no point symbology option in ArcGIS?

texts: I'm sure it exists, but is there a way to set a point layer to have no symbology. This works best for cities as you just want to display the name, and not necessarily show the location. The way I do it now, is by picking a symbol and making the fill and outline to have "no color"


texts: For preparing watershed delineation with QGIS Grass module I couldn't find r.watershed module

texts:
For preparing watershed delineation here some one has described some steps as follows

After step 2, I want to get flow accumulation file, but I can not find this kind of module in GRASS, so I pass it and directly try the r.watershed module.

I couldn't reach r.watershed module, where can I get that

There are several input options in this module, like this：

enter image description here
Sign up or log in


texts:
I'm relatively new to QGIS (2.14.7 on Windows), and trying to learn how to set Map Tips.

Problem is, many points of my point Shapefile are located at exactly same place (overlapping).
Can't be sure but it seems Map Tips picks up the feature of first row found in the attribute table in such a case.
However I would like to display the last feature, if at all possible.

The image below is a fake example of attribute table (LHS), of which all three features are at the same location.

A house (House A) had three owners (Emi, Jon, and Sam) who were recorded in chronological order.
I wish to display Sam (the most recent owner) by the Map Tips, but I see Emi instead (RHS).

Setting of HTML field is:

[% "house" %]

[% "owner" %]

[% "start_y" %] - [% "end_y" %]

Is there any how-to to control what Map Tips shows? (If this question is too broad, then specifically, to choose last record?)

My apologies, but I have some constraints in my working environment, which complicate things:

I am not allowed to modify the order of this Shapefile for various reason. (I thought ogr2ogr can sort it by year in descending order.)
Nor remove duplicated features.
The most recent owner may not mean they are current. It makes filtering (by "end_y" for instance) or applying Expression too difficult... for me.


texts: Can I use Google Maps API and substitute Openstreet map as base layer?

texts:
This Question is based on below requirements.

1 - our application will need to use functionalities of Google Maps API like custom marker/Info pop up/Routing etc.

2 - our application wants to use Openstreetmaps or our ownmaps as the base layer.

Now , can we use Google maps API for functionalities and Openstreet map as base layer,so that I am not charged for using google data ? do they specifically charge for API usage ? isnt the 2500 request limit for http requests to google image/map server ?

Adarsh


texts: Adding spectral values of Sentinel-2 to table with coordinates (20k points) giving error

texts:
I am trying to export an excel sheet with spectral values from Google Earth Engine (Sentinel-2) to my Google Drive. I am using the Python API from my google colab page but I can not get the geemap.extract_values_to_points to work. I even tried the code in the JavaScript code editor (in JavaScript, not Python) and it didn't work there either.
I have tried everything I can find on Google API Docs, StackOverflow, and GIS StackExchange - nothing has worked for me. Everytime I try I receive this error message:

EEException: Request payload size exceeds the limit: 4194304 bytes.

Eventually I need to iterate over all the 20000 points in Europe so that I can extract all the spectral values but to keep it simple for initial export here is my code for a single image:
# For more information regarding this section please visit the website below
# https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S

# Load a feature collection.
## featureCollection = ee.FeatureCollection("FAO/GAUL/2015/level0")
featureCollection = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017')
# Filter the collection.
# filteredFC = featureCollection.filter(ee.Filter.eq('ADM0_NAME', 'Europe'))
filteredFC = featureCollection.filter(ee.Filter.eq('wld_rgn', 'Europe'))

#Initiate map to check results
Map = geemap.Map(center=[52,5], zoom=10, layer_ctrl=True)
Map

# insert required period of time
point = ee.Geometry.Polygon(filteredFC)
start = ee.Date('2019-05-01')
finish = ee.Date('2020-06-01')

# Google Earth engine settings
collection = ee.ImageCollection("COPERNICUS/S2_SR") \
    .filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than', 20) \
    .filterDate(start, finish) \
    .sort('CLOUD_COVER', True) \
    #.filterBounds(filteredFC)

# Compute the median in each band, each pixel.
# Band names are B1_median, B2_median, etc.
median = collection.reduce(ee.Reducer.median());
clipped = median.clip(filteredFC)
clipped = clipped.reproject(clipped.projection(), scale = 60)

# The output is an Image.  Add it to the map.
vis_param = {'bands': ['B4_median', 'B3_median', 'B2_median'], 'min': 0, 'max': 2000,}
Map.addLayer(clipped, vis_param)

# import geojson shapefile to geemap
#in_shp = 'LUCAS_TOPSOIL_2015.geojson'
in_fc = geemap.shp_to_ee('coordinates.shp')
#Map.add_geojson(in_shp, 'Points')
Map

# read csv file to which spectral information will be added
out_csv = 'coordinates_with_spectral_values.csv'

#extract the spectral information and add to csv file
geemap.extract_values_to_points(in_fc, clipped, out_csv)

So I first create my Sentinel-2 image using the Google Earth Engine API. I then load the points into the same map. The last step however, to add spectral information of the bands does not seem to work to to the EEException error. Can anyone help me with this?


texts: Problems when trying to Convert polygon to raster

texts:
Well, I'm having a problem when trying to convert polygon to raster on ArcGis 10.0.
Here is the thing: Ther output raster is much smaller than the input polygon, and the coordinate system is diferent as well! I've already tryied the environment tool from the "polygon to raster" boz, on arctoolbox, but still no success!
I observed that when I try to save on the defalt folder, my process goes ok1! But whe I select a specyfic folder my problem appear!
What could possibly be happening? Any help is welcome!


texts: Openlayers 3 Select Interaction style function

texts:
I have a style function for LineStrings which will place a circle at each vertex of a feature.

When I select the feature it reverts to using the default style even though I have replicated my style function with a minor (colour) change. The other minor bug is that the function has two params (start, end) but I would like to place the circle on every vertex. Is there a way to achieve this?

Specifically though, is there a reason why it might be unable to display a selected feature using a style function? I am replicating the code below:

var selectedStyle = function (feature, resolution) {
var geometry = feature.getGeometry();
var styles = [
  // linestring
  new ol.style.Style({
      stroke: new ol.style.Stroke({
          color: '#ffcc33',
          width: 6
      })
  })
];

geometry.forEachSegment(function (start, end) {
    var dx = end[0] - start[0];
    var dy = end[1] - start[1];
    var rotation = Math.atan2(dy, dx);
    // circles
    styles.push(new ol.style.Style({
        geometry: new ol.geom.Point(end),
        image: new ol.style.Circle({
            radius: 5,
            fill: new ol.style.Fill({
                color: 'rgb(0, 0, 255)'
            }),
            stroke: new ol.style.Stroke({ color: 'blue', width: 2 })
        })
    }));
});

return styles;
};


texts: What are the effects of using Ifeature.Delete() on a feature within a feature class?

texts:
I call Delete() on a feature in a feature class, then I want to proceed to the next feature by using ICursor.NextRow() but this produces an error. The code is simple:
EDIT: More code showing the instantiation of the cursor and the version is ArcGIS 10.2

 ICursor curs;
 object id;
 IFeature feature;
 curs = (ICursor)fclass.Search(new QueryFilter(), true);
 feature = (IFeature)curs.NextRow();
 if(some_criteria){

 while (feature != null)
        {
            try
            {

                id = feature.get_Value(index); //get the ID of the record which is not in source
                if (id does not exist in target)
                {
                    feature.Delete();
                }
                feature = (IFeature)curs.NextRow();
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);//testing purposes
            }
        }
        curs = null;
    }
}

Now, the deletion occurs, but in the next iteration, I get an error at the line: id=feature.get_Value(index) saying "Feature was deleted". My question is, shouldn't reassigning feature to the next row be good enough to move on?


texts: Check if other features besides atlas feature are displayed in the map

texts:
I am making an atlas in Print composer and I want to check if other features besides the atlas feature are present in the map. In the Print composer map below, the (current) atlas feature is Licab, and I want to check via expression if there are other features present in the map besides Licab.

How can I check via expression if the map contains other features besides the current atlas feature?


texts: joining polylines on geometry and attribute

texts:
I have dowloaded an Open street Map shapefile containing streets and their attributes, for my whole country.
I have qgis  and spatialite_gui and a very basic understanding of SQL
The problem I have is that OSM splits roads of the same name according to a variety of factors such as attribute changes , this means our main street is divided into multiple sections. each section has it's own OSM_ID

I wish to join these sections back together ( I don't care about the attributes, except the name) based on their proximity and their names. (My software that will consume this data from another api will determine if the intersecting road terminates at the intersection from the linestring, i.e. it's not just for display purposes.)

I have tried using the qgis-line dissolve method but dissolving on name alone causes a merge between all streets in the country having the same name. eg there are about 30 "Victoria streets".
so I need to merge the streets that have the same name AND have a similar geometry (e.g. within 10-20m )

How/what steps should I take to achieve this,
I will then want to convert back to a shapefile which will be uploaded to public data server which others can use.

My table is called CentrelinesTBL
with fields

osm_id
Highwayname
Speed
Name  ( <--Streetname)
Geometry - looks to be a blob, eg: it appears in the table as "BLOB sz =384 geometry" but if I use blob explore I can see...

{"type":"LineString","coordinates":[[175.4088968683988,
-39.40728494205201,0],[175.4091779512512,-39.407522943693,0],
[175.4107932119636,-39.40868038774494,0]]}


texts: How can I connect QGIS with compiled GDAL on linux?

texts:
I've compiled GDAL on Debian with FileGDB support. The output of

ogr2ogr --formats | grep GDB

is

OpenFileGDB -vector- (rov): ESRI FileGDB
FileGDB -vector- (rw+): ESRI FileGDB

and

gdalinfo --version

is

GDAL 2.0.2, released 2016/01/26

I then installed qgis using "sudo apt-get install qgis" and it's version 2.14

I expected it to link to GDAL and have FileGDB support. No such luck. In QGIS About it says it's using GDAL 1.10.1

How do I connect it to the binaries that are compiled and have FileGDB support?


texts: How to get pixel positions when cropping a raster with rasterio? (Faster)

texts:
I am trying to crop a raster but instead of just getting the values of the cropped raster I am trying to get the positions of that values on the matrix.
I already did this with this code:
import geopandas
import rasterio
import rasterio.mask
import numpy as np

shp = gpd.read_file('myshapefile.shp')
with rasterio.open('mytif.tif') as src:
    mask_shp = [feature['geometry'] for feature in json.loads(shp.to_json())['features']]
    for index in range(len(mask_shp)):
        out_image, out_transform = rasterio.mask.mask(src, [mask_shp[index]], crop=False, nodata=np.nan)
        z,x,y = np.where(~np.isnan(out_image))
        #Some calculations using the positions of pixels inside the geometry

The problem with the code above is that it is very slow, the part which makes it slow is setting crop=False.
When I set crop=False the output dimension of cropped raster is the same as the original raster so I can calculate the positions of pixels inside polygon with np.where(~np.isnan(out_image))
But the difference of time when setting crop=False instead of crop=True is too high, I wonder if there is a better way to do it.


texts: Script not processing shapefiles from one folder to another using PyQGIS?

texts:
I am working on a script which takes shapefiles from one folder called "Original files", process them and then output the results into another folder named "Processed files. I asked a question on how this can be done on stackoverflow (which includes a diagram) and received a detailed answer. I'm now trying to incorporate that answer into the script but unfortunately no shapefiles are being saved into the Processed files folders.

from os.path import expanduser
home = expanduser("~")

root_dir = home + "\Test\\"
original_dir = 'Original files'
processed_dir = 'Processed files'

outputs_1=general.runalg("qgis:creategrid", 1000, 1000, 24108, 18351.157175, 258293.802316, 665638.226408, 1, 'EPSG:7405', None)

for path, subdirs, files in os.walk(root_dir):
    if original_dir in path:
        for file in files:
            if file.endswith('.shp'):
                outputs_2=general.runalg("qgis:clip", outputs_1['SAVENAME'], file, os.path.sep.join(path.split(os.path.sep)[:-1]) + os.path.sep + processed_dir + os.path.sep + file)

Am I missing an obvious step?


texts: Python/GDAL get unique values in discrete-valued raster

texts:
I would like to get some advice on the most efficient way to return a list of unique values of a discrete-valued raster using Python and GDAL.

I had thought that the most obvious way would be to examine the raster's attribute table, but if I do band.GetDefaultRAT() on the band of a raster dataset that contains an attribute table (the table is visible in ArcCatalog, anyway), the result is always None:

>>> rat = band.GetDefaultRAT()
>>> rat == None
True

In that case, I end up having to scan through each cell of the raster and build a list of unique values manually. Is this the only way to do it?

Or is there a way to build an attribute table with Python and GDAL, then query it for a list of unique values?