texts:
We're looking to launch a study that examines spatial behaviour on a university campus. Given the near ubiquity of smartphones among our study population, we're excited about the possibility of using GPS tracking via a smartphone app to garner microscale travel behaviour data that could be analysed in conjunction with retrospective interviews.

We're keen to minimise privacy intrusion (and battery drain) by only tracking behaviour on campus. We'd also like to minimise responded burden by making the application operate silently "in the background" and easy to opt-out of at any time after giving consent.

What apps are available to collect this data? Are there any ethics or privacy issues we should be aware of?


texts: CartoDB Convert from the_geom to google's lat long

texts:
I have a CartoDB table that when I query it via the rest api I get something like this:

{
  "name": "sas",
  "street": "la plata 2390",
  "cartodb_id": 1,
  "created_at": "2013-06-26T00:46:21.412Z",
  "updated_at": "2013-06-26T00:58:26.799Z",
  "the_geom": "0101000020E6100000FDA4DAA7E32D4DC0E3FC4D28445041C0",
  "the_geom_webmercator": "0101000020110F0000064377E72DC858C1BB2873CAD2614FC1",
  "cartodb_georef_status": true
},

I want to conver the the_geom_webmercator to a lat, long pair of numbers, to use with leaflet like this:

L.marker([-34.617917, -58.433257]).addTo(map)
  .bindPopup('A pretty CSS3 popup. <br> Easily customizable.')
  .openPopup();

Which would be the best way to achieve it?

Create a view or query on CartoDB? (I tried with ST_Transform, but I don't know what parameter to use)

Use a specific leaflet option to pass the webmercator value?

Use some js library to do the conversion?

-- EDIT

I've found the st_asText(the_geom) that returns me something like: POINT(-58.35851 -34.62708)

and also st_x(xxx) and st_y(xxx) functions which returns each coordinate.

so I create a the_geom_lat and the_geom_long columns and executed the following query

update test set
the_geom_lat = st_y(the_geom),
the_geom_long = st_x(the_geom)

I still would like to know if there's any js function that could achieve the same, so I wouldn't have to create a cartoDB view


texts: Does a Scanned Map have to be georeferenced in the projection of the original Source?

texts:
I have a historic paper map for the Indian Sub-continent which has been scanned. The Map is in Albers Equal Area Conical projection, and has the latitude and longitude grid on it.

I was trying to georeference in the projection of the source, but I do not have all the required parameters for this projection. Only the two standard parallels are noted on the map. I don't know the Central Meridian or the Latitude of origin, or the datum for that matter.

What should be done in this kind of situation? Since this is a map which spans 4000km by 4000km, I don't really think it is possible to get any kind of high accuracy output. I was thinking of georeferencing it in wgs84 Geographic coordinate system.

Is this a good idea? Or is there something else which you would suggest?


texts: Converting a single GPS point in xy coordinate to latitude and longitude

texts: I picked a GPS point for a Helipad using the AGD 66 Zone 55 Datum, however have been asked by the chopper pilot to give him coordinates in the Latitude and Longitude format so he can land the chopper for an emergency case and I was'nt able to do that. To avoid such issues in the future, could someone help me convert this. I use MapInfo Encom Discover 2013.


texts: Is there any way to get QGIS Decorations passed through to prints or layouts or QGIS2Web?

texts:
I can't see any way to have the QGIS decorations that are available to the desktop passed on to any outputs!
The don't show up in layouts.  They don't export to html via QGIS2web. (except the scalebar!)  What was the idea of having them available only to the desktop and not be able to be printed or displayed anywhere else?  Am I missing something?


texts:
I have a PostGIS dataset with just over 2 million rows. Each row has a PostGIS geometry point value and several attributes.

I'd like to do some analysis on certain subsets of the data, but I can't figure this out. Is there a way of querying data once you have it in GRASS GIS? Alternately, is it possible to leave the attribute data back in Postgres, and then do queries or filters based on this data?

For example, suppose that my 2+ million rows had a boolean column X. How would I run GRASS analysis on the entire dataset, then immediately do the same analysis on only the data where this column is set to false?


texts: ArcMap label expression returning NoneType error

texts:
I'm trying to create street range labels rounded to the nearest 100 unless a street range is less than 100 I'm using "50". I have a field l_refaddr that is a string with number ranges for a street segment. If a string value has less than 3 characters i want the expression to return "50", if the length is 3, then return first character and concatenate with "00", if length is 4, first two characters and "00", if legth is 5, first three characters and "00". Here's what I wrote in the expression builder:

    def FindLabel ( [l_refaddr] ):
      if len( [l_refaddr]) < 3:
        [l_refaddr] = "50"
      elif len( [l_refaddr]) == 3:
        [l_refaddr] =  [l_refaddr][0]+"00"
      elif len( [l_refaddr]) == 4:
        [l_refaddr] =  [l_refaddr][:2]+"00"
      else:
    [l_refaddr] = [l_refaddr][:3]+"00"
    return [l_refaddr]

And this is the error I'm getting:

Any ideas what I'm missing?


texts: d.rast -o failed after successfully imported.

texts:
I imported a geotiff raster using GUI grass, it was successful.

(Thu Nov 20 15:55:35 2014)
r.in.gdal input=C:\Users\Administrator\grassdata\kavaja\JPEG_8.tif output=JPEG_8
Projection of input dataset and current location appear to match
r.in.gdal complete. Raster map  created.
r.in.gdal complete. Raster map  created.
r.in.gdal complete. Raster map  created.
(Thu Nov 20 15:55:47 2014) Command finished (12 sec)

But when trying to display the imported image it fails.
Command 'd.rast -o map=JPEG_8@mapset_kavaja' failed

I checked from File-Manage maps and volumes, the image is listed

(Thu Nov 20 16:00:23 2014)

g.list type=rast

raster files available in mapset :

JPEG_8.blue  JPEG_8.green JPEG_8.red

(Thu Nov 20 16:00:24 2014) Command finished (0 sec)


texts: Is there a way to get the current way a table is sorted in order to iterate over it?

texts:
I have a tool in ArcObjects that I'm working on where the OnClick() method finds the current row in the active attribute table (not the selection, but the row that has the carat to the left of the left most column), changes the current row to the next one in the attribute table, selects that feature, and then pans to it (basically the same as right clicking on a row, and selecting "Pan To" from the context menu).

If I use a search cursor or a selection set (either from the IFeatureLayer or the IDisplayTable interfaces) to iterate through the list, it only returns the rows in numerical order according to the ObjectID field.  In most cases this suits our purposes, and I currently have this working.

However, in instances where the table is sorted by another field beforehand (say, a name field), is there a way to have a cursor or selection set that respects a sort done on the table before my tool is run?

I looked at ITableSort, but it seems to apply to performing a sort instead of what I want to do.  I'm currently running ArcGIS 10.2.1.


texts: Why is DWITHIN filtering my data with native EPSG 4326 with meters instead of degrees?

texts:
Ok so I have a PostgreSQL Table, to which I added a PostGIS geometry column using:

SELECT AddGeometryColumn ('public','my_table','geom',4326,'POINT',2);

Followed by:

UPDATE public.my_table
SET geom = st_geometryfromtext('POINT('|| lon ||' '|| lat ||')',4326);

I then publish this table as WFS 1.0.0 using Geoserver 2.12.0. When I make a query using filter

DWITHIN(geom, Point(lon lat), distanceInDegrees, meters)

my query returns geojson with zero features.

If I query using

DWITHIN(geom, Point(lon lat), distanceInMeters, meters)

then I get correct results within the specified radius. I simply cannot figure out why the units are meters and not degrees when native EPSG is 4326? In the past when I have published layers as 4326, DWITHIN always took only degree units.

The layer configs in Geoserver:

native srs - EPSG:4326

declared srs - EPSG:4326

srs handing - Force Declared


texts: How to cache map service in different screen resolution using ArcGIS server 10.1

texts:
I want to cache a map service to use tile map in my project .The problem is that i have some clients with different screen resolution . When i cache the map service and use anti-aliasing the best resolution and anti aliasing show in my screen resolution and in another clients the quality of map is not good.The screen resolution of clients are very different for example the screen resolution of my computer is 1920 * 1080 but on of the clients screen resolution is 5600 * 3150 screen. How can i manage caching process in different screen resolution ?

Thanks


texts: data defined labeling with postgis layer

texts:
How to use the expression based (edit: data defined) labeling with postgis?

I'm wondering, whats the best way to use expression based (edit: data defined) labels with postgis (I'm new to postgis). Just by adding new columns for x and y and so on, or by using a relational table with that columns? Or is there a other way?

EDIT: The image below shows the common way to use data defined labels for shape files: Add a column for x and y position for the label (and/or color, size, etc.) to the attribute table and set the correct field in the layer preferences. Now I would like to know if its possible to store the x and y (etc.) columns into a second relational table (with postgis). Because I would like to use the Data-Defined-Function without modifying the attribute table itself.


texts: How to add attributes to shapefile with Python and pyshp?

texts: I'm using pyshp for creating a shapefile. I need to populate tens of fields with values using the record() method of shapefile.Writer. I have those values as a list, but have no idea how to send it to the method without enumerating them as w.record(values[0], values[1], etc.).


texts: Doing supervised classification for images on ERDAS?

texts:
i want to do a supervised classification for images on ERDAS, using GIS, i clipped the areas i want to use as training/signature from the original images. but i just can't create a signature file, because they need to be in AOI format.

I already tried to convert them to shapefiles (raster to polygon tool), and enter the shapefile on ERDAS. All tutorials i have seen so far require to cut or draw an AOI from the image manually.

How do I convert these clipped areas to AOI files without having to cut anything from them?


texts: Increasing the x and y values of a point by a value

texts: I have a point dataset with many overlapping points. For the locations where I have overlap, I want to increase the x and/or y location for 1 of the points by 0.1 meters. I need to do this consecutively until there are no points that overlap but are "neighborly". I cannot google this question well enough to get an answer. Thoughts?


texts:
I have an interesting problem:

I need to batchprocess a few files. I do that in a for-loop, where some operations are performed. Later on I want to write the outcome into an existing shapefile which I do like so:

myShapeFile@data <- data.frame(myShapeFile@data,  dynamicColumnName = VALUE)

The dynamicColumnName gets created dynamically - depending what statistic is performed and so on. Meaning: The name is stored in the variable.
So dynamicColumnName could be "2245", in the next iteration of the loop or "0000" or "3334" and so on.

However, the function above does not accept the "characters/integers" stored in the variable. Each column gets named dynamicColumnName.

Any ideas how to not let this happen?


texts: GeoServer WPS Aggregation Functions Example

texts:
The scenario: I want to present a user with names of polygons from a layer in GeoServer. I then display the polygon(s) whose name(s) the user selected.

What I've done: I have a search box, which allows a user to enter name of a polygon they'd like to see. This works perfectly fine, even for wildcards. I've implemented it using CQL filters.

What I want: Instead of a user entering a name of a polygon, I want to pull all the polygon names and display them to the user for selection. After some research, I found out that my best bet is to use GeoServer's WPS aggregation function gs:Aggregate. I've been looking for examples on how to use this, but no success so far. Can anyone who's had this experience point me in the right direction. I'll also be grateful for any alternative approaches.

My environment: GeoServer 2.1.3, PostGIS 1.5, OpenLayers 2.11.


texts: Setting one input parameter for several models?

texts:
I have a bunch of models (about 20) in my custom toolbox. I need to run them one after another and look for some errors which they make in table. I could put all these models into one but it is not allowed for my tasks.
Nevertheless, I want to ease this work just by making a tool which sets a certain path to my geodatatbase in all models I need to run.

All my models have input parameter of workspace which is GDB base with "Model Parameter" label. After I set this parameter by showing the path to gdb file, I run the model. When process is done I open another model and have to set this path again.
After the my current geodatabase is scanned for errors, I bring another base, which also has to be checked with that models.
I haven't found yet a tool in System toolbox for automatic setting of input parameters in models.


texts: Publish ArcSDE FeatureService for Versioned Editing

texts:
Scenario: I need to Publish a data (from ORACLE ArcSDE) for versioned editing. Each user should be able to connect to his version and edit the data throu web application (Silverlight/JAVA/Flex API).
Question: Do I need to create a FeatureService for each user (with ArcMap document containing data from version)? Or is there a simpler way to do it? I would prefer if I have to make only one ArcSDE connection in ArcMap and publish that resource as a featureservice.


texts: Using QGIS with a pre-existing installation of Python 3.2 and matching GDAL

texts:
I need to have GDAL/OGR working with Python 3.2 because of another dependency.  However, I also want to have QGIS for convenience.  However, QGIS - FWTools in particular is built against Python 2.5, so while most of QGIS works, I have none of the FWTools raster tools.

The error message I get is:

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

  Traceback (most recent call last):   File
  "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 138, in
  startPlugin
      plugins[packageName] = package.classFactory(iface)   File "C:/OSGeo4W/apps/qgis/./python/plugins\GdalTools__init__.py", line
  32, in classFactory
      from GdalTools import GdalTools   File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 283, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/OSGeo4W/apps/qgis/./python/plugins\GdalTools\GdalTools.py",
  line 39, in
      raise ImportError( error_str ) ImportError: Module use of python32.dll conflicts with this version of Python.

  Python version:
  2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

I have tried using the QGIS Windows installer and the OSGeo4W installer and have Python 2.5 under the OsGeo4W folder.  Is there an easy way of having the FWTools working correctly in QGIS and have GDAL/OGR working with Python 3.2?

In your answers you need to bear in mind that I am not familiar with compiling from source (sorry), but willing to learn if that is required and somebody can hold my hand through the process.

Thanks


texts: GEE Download data around buffers on multiplie points, adding coordinates of each point to table

texts:
I want to download a time series of the average pixel value of a buffer around a number of points. In the resulting table, I'd like to have the coordinates of each point as a variable. How to do this?
A strategy seems to be generating the centroids of the buffers and add as a feature, but I can't make the centroid value appear in the table.
Also, what is the .geo() variable in the resulting table in the example below?
Code here

// set of points

var pointList= ee.List(
        [[-133.49345223488783, 28.4392489430013],
         [-134.28446785988783, 27.273691218174367],
         [-135.73466317238783, 27.351783369494303]]);

// turn them into a feature collection
var pointCollection = ee.FeatureCollection(pointList.map(function(p){
  var point = ee.Feature(ee.Geometry.Point(p), {});
  return point;
}));

print(pointCollection);
Map.addLayer(pointCollection);

// generate the buffers
var bufferBy = function(size) {
  return function(feature) {
    return feature.buffer(size);
  };
};

// adds the centroid to the buffer as a feature
var getCentroids = function(feature) {
  return feature.set({polyCent: feature.centroid()});
};

var pointCollectionBfs = ee.FeatureCollection(pointCollection.map(bufferBy(10000)).map(getCentroids));

print('points Bf',pointCollectionBfs);
Map.addLayer(pointCollectionBfs, {color: 'd63000'}, 'points');

////////////////        //////////////////
// IMAGE COLLECTION - MODIS-Aqua
////////////////        //////////////////
var start = ee.Date('2014-01-01');
var finish = ee.Date('2014-05-31');

var chla = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI')
  .filterDate(start,finish)
  .select('chlor_a');

var coll=pointCollectionBfs ;
var collName='pointBfs' ;

// CHLA
// chla mean
var chla_mean = chla.map(function(image) {
  return image.reduceRegions({
    collection: coll,
    reducer: ee.Reducer.mean(),
    scale: 3000
  }).filter(ee.Filter.neq('mean', null))
    .map(function(f) {
      return f.set('date', image.date());
    })
    .map(function(f) {
      return f.set('id', image.id());
      });
})
.flatten();

Export.table.toDrive({
  collection: chla_mean,
  description: 'example_chla_mean_'+collName,
  fileFormat: 'CSV'
});


texts: Extract coordinate system,projection names for files listed in a csv using gdal/python

texts:
We have 1000's of files for which projection/datum/geocs/projcs names has to be extracted. This code reads the filename listed in the csv.

from os import path
from osgeo import gdal,osr
import csv
csvpath = r"D:\\Test\\QGISPRJ.csv"
csvdir = path.split(csvpath)[0]
with open(csvpath, "r") as csvfile:
    fcs = [r[0] for r in csv.reader(csvfile)]
    for ds in fcs:
        print ds

Output:
E:\Santiago_Low\SourceData\Chile Projects\spectrem\Area2\Area2_AEM_x7.TIF
E:\Santiago_Low\SourceData\_South America Regional\233_080_Si_15m_321comp.ECW
E:\Santiago_Low\SourceData\Inactive Projects\ASTER_VNIR_orthoRGB_PSAD56_19S.TIF
E:\Santiago_Low_Priority\SourceData\Chile Projects\Explora_KRIP_Res.TIF

But, if i use getProjection() in the code - as mentioned in this thread - GDAL/Python: How do I get coordinate system name from SpatialReference? - i am getting this error

from os import path
from osgeo import gdal,osr
import csv
csvpath = r"D:\\Test\\QGISPRJ.csv"
csvdir = path.split(csvpath)[0]
with open(csvpath, "r") as csvfile:
    fcs = [r[0] for r in csv.reader(csvfile)]
    for ds in fcs:
        prj=ds.GetProjection()
        srs=osr.SpatialReference(wkt=prj)
        print srs.GetAttrValue('projcs')
        print srs.GetAttrValue('geogcs')
        print srs.GetAttrValue('Datum')
        print srs.GetAttrValue('Projection')

Traceback (most recent call last):
File "<input>", line 4, in <module>
AttributeError: 'str' object has no attribute 'GetProjection'

But if i run the same code without the csv file as an input and use the filename directly it works fine.

from osgeo import gdal,osr
ds=gdal.Open(r'E:\\Santiago_Low\\SourceData\\Chile Projects\\Ground POS EM\\Mapinfo\\300mSlice_Image.TIF')
prj=ds.GetProjection()
print prj
srs=osr.SpatialReference(wkt=prj)
print srs.GetAttrValue('projcs')
print srs.GetAttrValue('geogcs')

Since i am very much a beginner as far as Python is concerned, i don't know how to proceed.I've read this gdal/python: extracting projection info from hdf file and few other questions w.r.t 'str' object has no attribute error in python. But still couldn't able to figure out what's wrong.


texts: Creating Cost Surface Raster for Least Cost Path Analysis?

texts:
I have a DEM raster and would like to carry out a cost path analysis.

Among other factors such as slope, proximity rivers etc. I would also like to take elevation into consideration. According to the model I am trying to build (using ArcGIS 10.1), the cost of building at high altitude locations would be much more costly compared to low altitude places.

I was wondering how I could create such a cost surface?


texts: Casting 2 separate LINESTRINGS from 2 sets of POINTS that are close

texts:
I have POINT data that comes from the GPS records of the movements of a species. I'd like to calculate the length of their trajectories when they fall within a grid cell. Sometimes a species comes in and out of the grid cell several times, such that I end up with "pieces" of the initial trajectory. My problem is that when I try to calculate the length of these pieces, and use sf_cast to turn the sets of POINTS into LINESTRINGS, they are grouped together and the distances are overestimated.
Here is an example:
tt <- matrix(c(6.153002, 42.99966, 6.152756, 42.99871, 6.152571, 42.99776, 6.152323, 42.99684, 6.151944, 42.99587, 6.112825, 42.9982, 6.113941, 42.99859, 6.115179, 42.99903, 6.116376, 42.99944, 6.117625, 42.99984), nrow = 10, ncol=2, byrow = T) %>%  as.data.frame %>%  sf::st_as_sf(coords = c(1,2))
How can I manage to group the points together but in separate lines? Is there a nearest neighbor argument that I can add to the sf_cast() function? I have a lot of points so I would like to avoid looping through each dataset line if possible!


texts:
What is the correct grass folder in Sextante? I alway get this message:

  The specified GRASS folder does not contain a valid set of GRASS
  modules. Please, go to the SEXTANTE settings dialog, and check that
  the GRASS folder is correctly configured

This is the current sextante grass folder. I did not change anything after the Osgeo4W installation. I gues the path isnt correct.

Thank you!


texts: Filtering attribute table based on names in another table using QGIS?

texts: I have a shapefile showing a list of district names. I have (currently in Excel) a long list of district names in a table. I would like to filter those districts that are in the other list. I think this is something to do with the attribute table and an expression, but I don;t know the expression for "this name is another another list".


texts: ArcGIS - Lines with different symbols and the same color ramp

texts:
i have a layer of lines which drives me crazy...

First i separate them in the tab multiple attributes, based on a value

blue lines = Symbol A (black)
red lines = Symbol B (black)
and so on...

Now i try to give them all the same color ramp, based on another value. But it doesnt't work right, ArcGIS doesnt use the color ramp i choose. Example i choose light blue too dark blue. When i close the Attributes the color is red...
How can i fix this?


texts: Autonumbering fields in versioned ArcSDE Geodatabase?

texts:
I want to have a field with autonumbering in ArcGIS.

I have a versioned ArcSDE for SQL Server geodatabase.

Thus, using the identity seed attribute in the SQL Server is not an option.

Is it not possible to autonumber your own columns in ArcSDE?


texts: Why is UpdateCursor not updating the attributes of my shapefile?

texts:
I am calculating buffer widths based on the ages of polygons. The buffer widths are stored in a new column in the attribute table. The code is:

with arcpy.da.UpdateCursor(hf,["FEATURE","YEAR","BUff"]) as cursor:
for row in cursor:
    f_type = row[0]
    year = row[1]
    buff = row[2]
    if f_type == "GRASSLAND":
        age = 2012 - int(year)
        if age > 60:
            buff = 0
            cursor.updateRow(row)
        if age <=60:
            buff = (10 * age) / 50
            cursor.updateRow(row)

Why is this code not successfully editing the attribute table?


texts: How to extract cell values from a raster file with Idrisi Taiga?

texts: I need to convert raster cells into points. I use Idrisi and I need to generate a table containing xy (coordinates) and z (cell value).


texts: Get number of changed features in a layer under edit mode using pyqgis

texts: Is there a method I can find out, how many features in a layer have changed during edit mode (including changes in the attribute and the geometry)?


texts: How to update the value of a field dependant upon the the fields ID in QGIS Field Calculator

texts:
I am looking to create links to website pages and to automate the procedure a bit more I would like to have a standard link followed by the ID of each field.

For example, I would like the standard link to be 'www.google.com'. I would then like to update the "Link" field dependant upon the ID of that attribute. For example, attribute 001 would become 'www.google.com/001'.

I was hoping to do this using a simple expression within the field calculator of QGIS.


texts: Suggestions for Geocoding Messy, Inconsistent, Single-Field Addresses?

texts:
I have nine spreadsheets containing information about a total of 33,401 unique events in the greater Chicago area. I have been asked to geocode all of these, if possible, and I am certainly no stranger to geocoding. However, the location information for each of them is the worst I have ever seen, written in a single field, with no particular convention.

I have no ZIP codes or city names, but I do have county names in almost every case. When street names are included, they are often missing their suffix ("Ave", "St", "Rd"). State and US highways are both frequently coded as the indiscriminate "Rte/Rt". The majority of locations have been written as intersections (often with extra irrelevant information), such as:

SB Pulaski & 162nd St.
I-55 @ Rt.30
Devon and Cicero (Il 50) NW corner TS
NB Rt.41 @ Half Day Rd. Exit Ramp.

In the case of Interstates, these "intersections" often do not actually exist -- it's just referencing a street the Interstate passes over. A fair number have (relatively) proper addresses:

1800 s Wolf rd. south of Oakton, north of Touhy.
1010 S. Rt. 14 - in front of Thunderbird Country C
Grayslake Maintenance Yard, 217 N. Baron, Grayslak

Some are more vague, but still generally well-specified:

South bound Busse rd south of Oakton and Higgins
EB Elgin-O'Hare W of Rohlwing Rd
NB IL-59,  1 mile north of IL-132

And some are almost certainly impossible to locate without additional context:

EB Elgin  O'Hare expresway
Prairie View Rest Area
Comm Center/Stevenson Yard

My question is, given the wide range of formats and anything-goes approach for specifying addresses in these datasets, are there any suggested methods for parsing at least some of this stuff into a reasonably clean set of geocodable addresses? I've so far been stumped and have been going through the painful process of making sense of individual records in Google Maps. I want to trim off as much manual work as possible, as I'd prefer not to spend the next three years working on this.


texts:
Google Maps API, OpenLayers, Leaflet and Mapbox.

They seem to ultimately do the same thing, each with their own side dishes.

Leaflet and OL (haven't really looked into mapbox yet) for example seem to provide some visual candy that google does not (i.e. animations along a path comes to mind), while the Google API can of course rely on google's services (geocoding, elevation).

Does a major reason, technical or otherwise, come to mind to avoid using them all at once ?

(some points that led to the question: coordinates are coordinates; the code that interacts with the libraries is my js anyway; I already manage my arrays - markers, shapes, overlays - separately, because I do other things with them too)

Edit :: the question is deemed to be too broad, but as the answer I was looking for is pretty much yes or no, save any additional info the answerer may select to provide, I am not sure how to narrow it down.

Obviously the different libraries can coexist, to what extent I cannot yet personally say; I am asking if they canNOT coexist due to some famously known issue that is known to everyone but me (as the latest arrival).

In this context, "No, it's fine", "No, save that OL wants to own the map", or "Yes, if you turn your back 2 minutes Leaflet will give Mapbox a wedgie" seem to me all fine answers. The key of all 3 being the boolean bit.


texts: Getting point that vehicle passed in particular location for first time using PostGIS?

texts:
I need some help setting up a query whith PostGIS.

I have a table where the tracking of a vehicle is recorded (points and timestamp).

How do I write a query to return the timestamp in which the vehicle first passed a certain point, and it may pass more than once?

It is not guaranteed that it passed exactly over the point by varying the accuracy of the GPS.

My records have these fields:

track_id, timestamp, latlng, speed, accuracy

When there was no possibility of 2 passes in the same place, I used something like this:

SELECT
    timestamp
FROM
    tracking
WHERE
   ST_DWITHIN(
        ST_Transform(ST_GeomFromText('POINT(16.920431 -19.662602)', 4326), 26986),
        ST_Transform(latlng::geography::geometry, 26986),
        100
   )
ORDER BY
    ST_Distance(
        latlng::geography::geometry,
        ST_GeomFromText('POINT(16.920431 -19.662602)', 4326)
    )
LIMIT 1;


texts: Connecting to another server with ArcSDE?

texts: How to connect from my server in our office to another server in another office with internet and access to their geodatabase by use of ArcSDE?


texts: Is it possible to convert a batch of WGS84 to SWEREF coordinates?

texts:
I have a problem considering converting a batch of coordinates. I need to convert from WGS84 into SWEREF

Is it possible to convert a batch?


texts:
I want to create a buffer on only one side of a polygon. When I create a buffer in the symbology tab in the layer properties, I get the following result:

I need a buffer that starts at the outline of the polygon and dos not overlap with the yellow filling. I need the result as a .qml file to be able to import it into another feature style.


texts: Programmatic way of accessing mapbox tileset from leaflet WITHOUT studio

texts:
I have a R shiny app that successfully uses leaflet to interact with a custom mapbox studio style.
mapbox_url = "https://api.mapbox.com/styles/v1/bweinstein/ck94nmzn20an31imrz6ffplun/tiles/256/{z}/{x}/{y}@2x?access_token=####"
leaflet() %>% addTiles(mapbox_url)

To do this I

Uploaded tileset to mapbox
Created a new style and added the tileset as a source
Click share in studio and got the CARTO link (as in https://stackoverflow.com/questions/34072237/how-can-i-use-a-custom-created-mapbox-style-along-with-leaflet)

Is there anyway to programmatically create styles, or better yet, directly get the tileset without studio? Studio styles have a limit of 15 sources. I have hundreds of tiles that I'd like to programmatically choose in my app.
Expected behavior
If I have a tileset with the id
bweinstein.CypressCity_03_25_2020

I expected the tileset to be available at url:
mapbox_url = 'https://api.mapbox.com/styles/v1/bweinstein/bweinstein.CypressCity_03_25_2020/tiles/256/{z}/{x}/{y}@2x?access_token=####'

I've tried a number of variants, e.g.
mapbox_url = 'https://api.mapbox.com/styles/v1/bweinstein/CypressCity_03_25_2020/tiles/256/{z}/{x}/{y}?access_token=####'

I don't see anything here: https://docs.mapbox.com/studio-manual/overview/publish-your-style/#leaflet but this seems like a core use-case?
Edit
The answer Using Mapbox tiles with folium from 2016 uses classic mapbox API and appears deprecated.
MacBook-Pro:Downloads ben$ curl http://{s}.tiles.mapbox.com/v4/bweinstein.CypressCity_03_25_2020/{z}/{x}/{y}.png?access_token=#####
curl: (6) Could not resolve host: s.tiles.mapbox.com

Current tileset API cannot find it
MacBook-Pro:Downloads ben$ curl http://api.mapbox.com/v4/bweinstein.CypressCity_03_25_2020/{z}/{x}/{y}.png?access_token=######
{"message":"Not Found"}


texts:
When using Openlayers I am unable to achieve the same zoom level that Google Maps allows. For example, if I embed a Google Map in my web-page I can zoom in to the building level in a city. When using Openlayers, the highest zoom level using a Google Map layer is not at the same resolution (it is always hundreds of buildings at the highest zoom level).

At the moment, my map options are the following:

// map options
var options = {
    units: "m",
    numZoomLevels: 16,
    maxResolution: 15654.0339,
    maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
};

map = new OpenLayers.Map("map_canvas", options);

var googleLayer = new OpenLayers.Layer.Google('Google', {type: google.maps.MapTypeId.TERRAIN});
map.addLayer(googleLayer);

I have tried setting the numZoomLevels: 20 and although the map zooms in further, more detailed tiles are not returned from Google. Is there another setting that I should be changing to increase the zoom level?


texts:
I am creating a 3D subsoil model for display in ArcScene - I can get it displayed nicely as points but in order for the model to be easier to read I need it to be displayed as a raster.

Every point in my shapefile has an assigned lithology in the form of a number, a z-value, and x and y values. My plan was to build a raster from this shapefile to display in ArcMap, using the lithology field as the main display.

I however can't seem to work out how to convert it to a raster without losing all of the data! I have tried every combination of raster options I can think of! And I only ever come up with a raster with a value of either 0 or 3, or just some random numbers!!

There must be a way because I've seen it before - and I assume it is fairly simple! I just want to keep the z-values and the lithology values! In the end I hope to have a 3D subsoil model displayed in ArcScene - with different colours of the lithology at the different depths!!


texts:
I am working on web application to display overlays on an osm map. I am using openlayers in combination with a qgis-server to provide wfs. I am mainly using EPSG:3857, as this is the default for osm.

I load the features with a get request, I get a geojson response, then read the features with ol.format.GeoJSON().readFeatures, then add them to a vectorlayer using ol.vector.getSource.addFeatures()

Now some of my datasets are actually in a different crs, for example EPSG:4326.
According to the documentation here http://openlayers.org/en/master/apidoc/ol.format.GeoJSON.html one can specify the type of data that one is reading, and the desired projection (if I understand it correctly).
Also that is what they seem to do in this example: https://openlayersbook.github.io/ch07-wrapping-our-heads-around-projections/example-04.html
In that example they use proj4s, but if i understand correctly that is only needed when using a crs that is not natively supported by openlayers.

However, the data does not seem to get reprojected, both with and without adding those option to the readFeatures(), the features are still in the original crs.

What am I missing here?

here is a code snippet of my site:

  $.get(url).done(function(response){
      if(SRS == "EPSG:3857"){
        var features = new ol.format.GeoJSON().readFeatures(response);
        console.log("3857 features:", features);
        vector.getSource().addFeatures(new ol.format.GeoJSON().readFeatures(response));
      }
      if(SRS == "EPSG:4326"){
        console.log("SRS 4326")
        var features3857 = new ol.format.GeoJSON().readFeatures(response, {
        dataProjection: 'EPSG:4326',
        featureProjection: 'EPSG:3875'
      });
      vector.getSource().addFeatures(features3857);
     }
      if(SRS == "EPSG:28992"){
        console.log("SRS 28992")
        var features3857 = new ol.format.GeoJSON().readFeatures(response, {
        dataProjection: 'EPSG:28992',
        featureProjection: 'EPSG:3857'
      });
      vector.getSource().addFeatures(features3857);
     }
  });


texts: How to Develop Optimal Routes for Street Sign Inspections

texts:
We have been approached by our Public Works Department to try and optimize their routing for street sign inspections to improve efficiency and productivity. We are unsure of the best way to go about creating the routes. All of the signs are in a database, there are roughly 55,000 signs that need to be inspected. All trucks would leave from the same location and return to the same location each day. We are using ArcGIS 10.1.

Responding to comments below

The tool suggested is the solution we'd like to use, however, it seems to max out at 1000 stops. The stops are only a couple minutes long so it is possible to do a large number of stops per day, spread out over 4 or 5 trucks. So we are trying to figure out the best way to divide our county up into smaller chunks to be able to meet the 1000 stop threshold.


texts: Does documentation for old ArcGIS Pro versions remain available online?

texts:
I have a suspicion that arcpy.CreateFeatureClass_management() has one more parameter at ArcGIS Pro 2.1.2 than it did at ArcGIS Pro 2.0.

Is the ArcGIS Pro 2.0 Help still available online to check this?

I would have expected to find it linked at the Documentation page like the old documentation for ArcMap is.


texts: QGIS3 does not show results on identify panel

texts:
I have found a new problem in qgis 3.2.2 for Mac. When you try to use identify features on any object on the map you do not get any results on identify results panel.
QGIS 3.2.2-1, Python 3.6.6, OS X 10.11.6


texts: Create feature collection of polygons' centroids in GEE

texts:
I am trying to determine the distance between province centroids and a polygon. Based on this past post, I was able to store the geographic coordinates of the province centroids into their feature collection.

var Iraq = ee.FeatureCollection('users/salem043/Iraq_ADM1');  //available to all users
var getCentroids = function(feature) {
  return feature.set({centralPoint: feature.centroid()});
};

var IraqCentroids = Iraq.map(getCentroids);

The new feature collection still recognizes the original feature collection's geography. Consequently, my spatial filter using IraqCentroids still identifies the minimum distance between the province's border and the polygon, not the distance between the province's centroid and the polygon.
Is there a way that I can create a new feature collection of points with the geographies of the province centroids, based on the properties stored in IraqCentroids?
Alternatively, is there a way to adjust my minimum distance algorithm such that it is measuring the smallest distance between the centroids stored as properties in IraqCentroids, not every geographic point that constitutes the province polygons? The minimum distance algorithm is below:

var spatialFilter = ee.Filter.withinDistance({
  distance: 5000000000000,  //Make it big, we need to link Basra etc. to border
  leftField: '.geo',
  rightField: '.geo',
  maxError: 10
});

var joined = ee.Join.saveAll({
  matchesKey: 'neighbors',
  measureKey: 'distance',
  ordering: 'distance'
}).apply({
  primary: IraqCentroids,
  secondary: sharedBorder, //data not shared
  condition: spatialFilter
});

var withNearestDist = joined.map(function(f) {
  var nearestDist = ee.Feature(ee.List(f.get('neighbors')).get(0))
      .get('distance');
  return f.set('nearestDist', nearestDist);
});


texts: Load an (updating) point layer from Access: Problems with pointslayerfromtable algorithm

texts:
I'm a python dummy user and in general a QGIS dummy user. I'm using 32 bit QGIS 2.14.1 Essen version.

Referred to the post How to load an (updating) point layer from Access? ,i try underdark solution but it doesn't work with an access mdb. I don't know what underdark means when write "Check the Processing | Log to see the syntax for Access" because in QGIS Processing Log menu doesn't suggest syntax for Access.Here the code where i replace sensitive information with opportune tag:

import processing

def openProject():
    pts=processing.runalg("qgis:pointslayerfromtable","ODBC:<UserDSNname>|layername=<tablename>|subset="and"fieldX"and"= 'ValueX'","X","Y","EPSG:32633", None)
    processing.load(pts['OUTPUT'])

Obviously it doesn't work :-(. I tried to manually compile the code above (excluding "def openProject():") in python console in order to understand which is the problem. Following the output:

Console Python
Usa iface per accedere all'interfaccia API QGIS oppure digita help(iface)per le informazioni
import processing
pts=processing.runalg("qgis:pointslayerfromtable","ODBC:  <UserDSNname>|layername=<tablename>|subset="and"fieldX"and"= 'ValueX'","X","Y","EPSG:32633", None)
Error: Wrong parameter value: = 'ValueX'

excluding the fieldX filter condition, the result doesn't change:

pts=processing.runalg("qgis:pointslayerfromtable","ODBC:<UserDSNname>|layername=<tablename>","X","Y","EPSG:32633", None)
Error: Wrong parameter value: ODBC:<UserDSNname>|layername=<tablename></i>

The same error appears if i change the USERDSNname with mdb pathfile:

Console Python
Usa iface per accedere all'interfaccia API QGIS oppure digita help(iface) per le informazioni
import processing
pts=processing.runalg("qgis:pointslayerfromtable","<pathfolder>\<DBname>.mdb|layername=<tablename>|subset="and"fieldX"and"= 'ValueX'","X","Y","EPSG:32633", None)
Error: Wrong parameter value: = 'ValueX'
pts=processing.runalg("qgis:pointslayerfromtable","<pathfolder>\<DBname>.mdb|layername=<tablename>","X","Y","EPSG:32633", None)
Error: Wrong parameter value: <pathfolder>\<DBname>.mdb|layername=<tablename>

I understand that ODBC connection or db access pathfile doesn't work properly...Can you help me? In the web i don't find any information that can help me. Another observation: applying the command with a csv file instead of mdb file, as tried by underdark in the referred post, all works well.


texts: ArcMap 100k meters square identification - double?

texts:
ArcMap - 1:50.000 - 5x3 meters - MGRS

I put on a grid defined with the standard 1:50.000 grid style in ArcMap.

I tick the box for "100,000 meter grid square identification", but it makes it double... See image. I never intended to do it double, I just want one set of grid square identifications.


texts:
I have the same image (exactly the same dimensions) in Google Maps as in OpenStreetMap, but the scaling of the image in OSM is totally different. The scaling in Google Maps is after my opinion the correct one.
Google Maps:

OpenStreetMap:

As you can see, the image boundaries are in Google Maps not even near those, of the image in OpenStreetMap.

My question is, can I add a limitation to the image boundaries in OSM?
My code for the image is the following:
var layer_image = new ol.layer.Image({
   source: new ol.source.ImageStatic({
       url: '../static/kml/' + href,
       imageExtent: merc(west, south, east, north)
   })
});

EDIT:
function initializeMap() {
var projection = ol.proj.get('EPSG:3857');

var raster = new ol.layer.Tile({
    source: new ol.source.MapQuest({layer: 'osm'})
});

map = new ol.Map({
    target: 'map',
    layers: [raster],
    view: new ol.View({
        center: [1728012.45558, 5982976.33295],
        zoom: 7,
        projection: projection
    })
});
return map;

}
EDIT2: I'm still having this problem, I experimented with the ol.source.ImageStatic imageSizeand imageExtent option but I didn't get any usefull results.


texts: How to add labels etc. with EIA shapefiles in R?

texts:
I'm trying to create a map of US shale basins and I'm very new to creating maps. I have downloaded the shapefiles from the US Energy Information Administration (EIA). I have also, been able to created a basic map with the bases plotted (please see code below). I would like to add labels etc. to this map. I believe these would be in the other files downloaded outside the shapefile.

library(maps)
map("state")
shapLocation<- "C:/shapfile/shalegasbasin/"
pcontorta <- readShapePoly(paste(shapLocation,"US_ShaleBasins_EIA_May2011.shp",sep=""))
plot(pcontorta, add=TRUE,  col=adjustcolor("black", alpha.f = 0.6),  border=FALSE)

Shapefile from: http://www.eia.gov/maps/layer_info-m.cfm

Description of a shapefile: http://en.wikipedia.org/wiki/Shapefile


texts: Is there a way to refresh the browser on QGIS programatically with PyQGIS?

texts:
I have tried the QgsBrowserModel but it doesn't seem to work. I am not even sure if that is the right class to use.
The problem is that I add WMS and database connections through a plugin but they won't show up in the QGIS Browser until I hit the refresh button

Do you know a way to refresh the Browser through the QGIS API? And if so, could this be applied to all currently opened instances of QGIS?


texts: QGIS Voronoi Polygons Float Division by zero

texts:
I have created a vector which is a connection to Sql Server. I then select Vector > Geometry Tools > Voronoi Polygons. I select my input layer and a temporary file for my Voronoi polygons. I get the float  division by zero error and the file is empty that is supposed to be created. I am new to QGIS and am baffled as to what I am doing wrong. I have used the Check Validity menu item and the geometry in the input layer is valid. Also where do I get to select the grouping for my input data for the polygons generated ?. Any ideas anyone?

I should add that I get the same error for Delaunay triangulation algorithm. There is something I am missing but I an unaware of what it is.


texts: using shapely: translating between Polygons and MultiPolygons

texts:
[EDIT: the solution to this was simply to use OGR to read shapefiles. See geographika's example.]

In an ESRI shapefile, there is no distinction between Polygons and MultiPolygons. Furthermore, there is no explicit
distinction between interior holes and exterior rings (besides the "handedness" of a given polygon).

So after reading a shapefile, I have a list of coordinate sequences describing rings, but without some more intensive processing, I
cannot distinguish which of these rings are exterior rings, interior holes, or additional polygons.

It appears that for shapely's Polygon and MultiPolygon constructors, there must be a clear distinction between exterior
and interior rings, so how should I move from an unclear list of rings to an ordered set of separated
polygons, with clearly designated interior and exterior rings?

To summarize:
if I have a list of polygon rings, but I don't know which rings are
    holes in the interior or are separate polygons, how should I best sort them into separate polygons with designated
    interior holes?

I'm looking for a simple algorithmic solution that I can implement in python, can be used to process hundreds of polygons in ~a minute or less, and I'm doing this in order to perform a large number of intersections.


texts: Troubleshooting ERROR 000989 Python syntax error from ArcGIS Field Calculator?

texts:
I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why.
I'm trying to create a function to just set the values of all cells in a column to be a multiple of the argument that I pass in ( I wanted to try something simple to test it out, as anything more complicated I tried also failed).

However, the error messages are telling me that my syntax is incorrect:

but I can't understand what is incorrect.

As an aside, I'm also horrified at how hard it is to write readable python in the field calculator box as there is no syntax highlighting, or clear indentation. It would be quicker, and easier to write an external Python script to do this calculation, but I want to try to figure out how this new function worked within the program.


texts:
I have an instance of geoserver running on tomcat on centos.
It is frequently locking up, and whilst the load average on the server is only 3.5 and you can log into the command line, you cannot request any tiles nor log into the admin section.

It seems that too many requests from openlayers stops http access.
How can I get to the bottom of this issue?


texts: How to create shapefile from OS MasterMap data using ArcGIS Desktop 10?

texts:
How do I create a shapefile from OS MasterMap data in Arcgis 10?

I have tiles from the Ordnance Survey Site and would like to create a topomap from the existing tiles.

These tiles contains the data I require for the creation of the shapefiles.

I will be grateful if someone could help me out with this.
Thanks


texts: Insert geometric data to a column from coordinate values in double precision

texts:
Screenshot of database
http://wp.me/aIW9p-i0

For table “households”, I want to create two new columns:
1) “Geom”, data type – geometry;
2) “WKT”, data type ‐ text;

I am intending to do the following tasks:
1. For each household, I have the location, indicated by x_coord and y_coord, respectively in the table. Then I have to create a geometric object – point, based on the x_coord and
y_coord for each household. Insert these geometric data to the column “Geom” accordingly.

Now, after the first step, I have a geometric object for each household. Translate the geometric point data to the well‐known‐text,showing the longitude and latitude of the
location of each house.

Insert these values to the second column “WKT”, accordingly

For the Step 1 I wrote the following function but I am getting the error:
Query returned successfully with no result in 54 ms.

CREATE OR REPLACE FUNCTION my_geom() RETURNS SETOF clean.households AS
$BODY$
DECLARE
x clean.households%ROWTYPE;
pst geometry;

BEGIN

FOR x IN SELECT * FROM clean.households
LOOP
pst := ST_GeomFromText('POINT(' || x_coord || ' ' || y_coord || ')');

UPDATE clean.households set geom = pst;
RETURN NEXT x;

END LOOP;

RETURN;
END
$BODY$
LANGUAGE 'plpgsql' ;


texts:
I create a webmap and use publish it on ArcGIS Online. Unfortunately the tiling engine of AGOL creates multiple labels for the same item. How can I prevent this?
Same label problems occured, when I created the tiles locally.

The labeling works great in ArcGIS Pro, BTW


texts: Getting Null Reference Exception when adding field to first layer in map using ArcObjects?

texts:
I am trying to add a field to first layer in the map here is my code

ESRI.ArcGIS.Framework.IApplication app = ArcMap.Application;
ESRI.ArcGIS.Framework.IDocument doc = app.Document;
ESRI.ArcGIS.ArcMapUI.IMxDocument mxd = doc as ESRI.ArcGIS.ArcMapUI.IMxDocument;
ESRI.ArcGIS.Carto.IMap map = mxd.FocusMap;
ESRI.ArcGIS.Carto.ILayer lay = map.Layer[0];
ESRI.ArcGIS.Carto.IFeatureLayer flay = lay as ESRI.ArcGIS.Carto.IFeatureLayer;
ESRI.ArcGIS.Geodatabase.IFeatureClass fcls = flay as ESRI.ArcGIS.Geodatabase.IFeatureClass;
ESRI.ArcGIS.Geodatabase.IFieldEdit fld = new ESRI.ArcGIS.Geodatabase.FieldClass();
string nam = "map";
fld.AliasName_2 = nam;
fld.Type_2 = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString;
fld.Length_2 = 50;
fld.Name_2 = "country name";
fcls.AddField(fld);

It throws a NullReferenceException, where I did do wrong?


texts: Split a vector layer based on attribute value?

texts:
I have read the question and comments on:

Splitting shapefile into separate files for each feature using QGIS/GDAL/SAGA?
that can be seen here:
Splitting shapefile into separate files for each feature using QGIS/GDAL/SAGA?

However, in my case I don't have unique values for each polygon but instead I have grouping variables.

A sample dummy data is that I have a vector layer with field "forestClass" and in this field my polygons have the following codes: 134,134,134,879,908,675,675,908,879,923,675,675.

I would need to get a polygon layer for each forest class, thus resulting in:

Polygon layer 1 with forestclass 134 and 3 polygons
Polygon layer 2 with forestclass 879 and 2 polygons
Polygon layer 3 with forestclass 908 and 2 polygons
Polygon layer 4 with forestclass 675 and 4 polygons
Polygon layer 5 with forestclass 923 and 1 polygons

Is there any ready solution for this in QGIS or dependencies? and If not, is there someone that could guide me how to do this?

After I get the subgroup vector layers I need to perform buffer/select by location and save intersect polygons to new layers. For this task I am using processing/graphical-modeler and I have solved almost everything but the splitting into subgroups is my pain now.

I have this situation with hundred of polygons and it would not be efficient to do this on a regular basis manually.


texts: Determine which zip codes are within defined boundary

texts:
The Antelope Valley Air Quality Management District publishes their district boundaries here:
https://avaqmd.ca.gov/district-boundaries

I need to figure out which zip codes fall within those boundaries (even if only a portion of a zip code falls within).

On their site, they publish a Google Earth file that can be downloaded.

The following tools fall a little short because I either need to define the area myself or it only take in one address:

https://www.freemaptools.com/find-zip-codes-inside-user-defined-area.htm
https://www.randymajors.com/p/zipcodegmap.html

Given the boundary file provided by AVAQMD, what solutions are available for me to generate a list of zip codes that fall inside that boundary?


texts: Trouble getting leaflet-label plugin to work on geojson file

texts:
I cannot figure out how to get labels on my featureLayers to show in my LeafLet map for a mapbox featureLayer using the leaflet-label plugin. I thought all i needed to do was add

.bindLabel('Look revealing label!')

Please help.

<!DOCTYPE html>

    <meta charset=utf-8 />
    <title>A Site Survery of Antikythera Greece</title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

    <link href='https://api.mapbox.com/mapbox.js/v2.3.0/mapbox.css' rel='stylesheet' />

    <link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-label/v0.2.1/leaflet.label.css' rel='stylesheet' />


texts: ListRasters not recognizing raster files in python

texts:
I have 2 rasters in my workspace, one in TIFF Format and the other in GRID format: "C:\ExampleFolder"

When I use the python script:

import arcpy
>>> rasl=arcpy.ListRasters("C:\ExampleFolder")
>>> print rasl
None

Python does not recognize my raster files. I'm attempting to use the script in this previous question:

Clip raster using shapefile into multiple rasters using ArcGIS Desktop?

I keep receiving error:
ERROR 000732: Input Rasters: Dataset does not exist or is not supported.

Any reason why Python does not recognize my raster?


texts: How to toggle Fusion Tables layer on/off based on map scale?

texts:
In the Google Maps API v3 I'm displaying points derived from a Fusion Table by specifying a FusionTablesLayer

Is it possible to set a minimum/maximum scale on this layer, so it turns off when zooming out?

EDIT: I'm presuming that I'll need to listen to the map's zoom_changed event, and handle the visibility manually. But how can I change the visibility of a Fusion Tables layer?

A marker has the boolean property Visible and the method SetVisible() but I can't see an equivalent for a layer.

An overlay can have show/hide methods - do I need to build my Fusion Tables layer as an overlay? (I'm a Google Maps novice so I don't know much about overlays vs layers)

Thanks


texts: Geoserver sending BigDecimal data as String in vector tiles

texts:
Setup details:
Geoserver: 2.12.1
DataStore: PostgreSQL 10.1 with PostGIS 2.4.2
mapbox-gl: 0.42.0

I am using mapbox-gl to render vector tiles from geoserver using TMS. I am styling the tiles using data-driven styling as explained here. The styling works amazingly for most of the part, but there are few datasets which are not being styled properly.
The problem occurs in case of interval based styling on an attribute which is not of Integer type in the postgreSQL tables.

The following are snapshots of the table:

postgres# \d+ layer_data

  Column  |   Type
----------+--------
  lat     |   numeric

On the Geoserver portal (Edit Layer --> 'Data' tab), the layer attribute looks like:

The feature data received on the mapbox-gl in JSON form is as follows:

{
  "__mlocate__created_by": 1,
  "__mlocate__created_date": "2016-05-02",
  "__mlocate__id": 343620,
  "__mlocate__layer_id": 410,
  .
  .
  "altitude": "0",
  "country": "India",
  "date_issue": "No",
  "id": "27283",
  "lat": "27.038510519999999",
  "lng": "88.459210400000003",
  .
  .
  .
}

The URL being hit by the browser to get tiles is:
http://localhost:6792/geoserver/gwc/service/tms/1.0.0/biodiv:lyr_410_butterflyspeciesdistribution@EPSG:900913@pbf/2/3/2.pbf

The style file does data-driven style as below:

'circle-color': {
        property: 'lat',
        type: 'interval',
        stops: [
          [6, '#eee4e5'],
          [12, '#cdaaea'],
          [24, '#bd82f8'],
          [37, '#9c55f1'],
          [49, '#8129fa'],
        ]
      }

The styling doesn't work and all circles are just drawn in black color. I guess this is because the value of 'lat' field is being interpreted as String (notice that this value is enclosed in quotes in JSON data as opposed to some other values, which are Integer type in the database) and hence the styling is not working.
But since this is defined as numeric data type in postgres, is it the geoserver that is sending it as a wrong data type in tiles information or is it mapbox-gl who is mis-interpreting the information send by Geoserver?


texts: Cropping a raster with a buffered area around a polygon line in R

texts:
I want to crop raster cells around the lines of a polygon,up to some width. I have dig around but i could only manage to come to the following reproducible example. For some unknown reason, the projection is giving me a problem that blocks my advance, and then I do not really know how to proceed to crop the raster using the generated buffer region around the polygon. Maybe is not the best approach either...
require(dismo)
require(raster)
require(maptools)
require(rgeos)
data(wrld_simpl)
alt=getData("alt",country="BRA")
cl=wrld_simpl[wrld_simpl$ISO3=="BRA",]
projection(cl)=projection(alt)
plot(cl)
brbuff=gBuffer(cl,byid=F, width = .5)


texts: Creating GeoServer layers from GeoJSON generated by PHP script

texts: I have few layers on my map rendered with ol.format.GeoJSON. I  generated GeoJSON from pgsql database with PHP scripts. The size of layers ranges from 1MB to 5MB so to speed up the process I want to use GeoServer. Is there a way or library in PHP that can send generated GeoJSON to GeoServer and create layer which I will then render as WMS?


texts:
For a test I'm looking to a way to get the added/extendet geometry columns ( Vector menu -> Geometry Tools -> Export/Add geometry columns) for a GPX file.
The function Export/Add geometry columns generate a new column for area and perimeter as I see it on all the help I can find online.
But how can I get to this succesful point with my GPX as an input source?

My goal is to take a GPX file (for example you run around a lake and track it with a GPS watch, then load the gpx file into QGIS) and calculate the perimeter of this file.

Maybe I struggle because the GPX has to be converted first into a valid polygon?

My attempts so far:

load GPX into QGIS
From all the GPX-Shapes, I will use the "track_points" and create a polygon with the Vector menu -> Points2One.
With this created shapefile, I can use the above mentioned Export/Add geometry column function to add the area and perimeter column.
Result: it works, I will get an output, but unfortunately a wrong number, the area is not correct as well as perimeter (way too low and I also don't know which unit it is)


texts: ArcGis using the time slider to animate multiple data frames

texts:
I'm creating an animation of a map that has a zoomed in data frame, in one of it's corner.

How do I get the time slider to act on both data frames at once?


texts: Creating queries in Portal for ArcGIS that do not have to be predefined?

texts:
I am trying to figure out if there is a way to make a query widget in Portal for ArcGIS that is more free form. I want to know if there is a way a user can type in queries that are not predefined. Or if there is something besides the Query widget that might accomplish this.

I am open to python scripting but would like to avoid it for time constraining reasons if possible.


texts: Why is the QGIS 2.10 raster clip function not working correctly?

texts: I am using QGIS 2.10 and everything seems to work just fine so far, except for the raster clipping function (Raster>Extraction>Clipper). I'm using a vector poligon as a mask layer, but after launching the function, it just does nothing - not even showing an error.


texts: Are there PhD programs that specifically focus on GIS, and if so, what is the typical outcome?

texts:
I know of the University of Pittsburgh where you can get a PhD in information science that focuses on Geoinformatics, which seems kind of cool.

I've been looking around but it seems that most PhD programs in Geography focus on either human or physical and don't really get into studying methods of GIS, which is what interests me.

I'm sure there are some that I'm missing though.


texts: What does InsertRow() return if the insert is not successful?

texts:
I have some basic code that inserts rows using an InsertCursor.

oc = arcpy.da.InsertCursor(outputFC, someFields)

for item in rowsForInsertCursor:
    tmp = oc.insertRow(item)

del oc

It seems the return value from InsertRow() is a long containing the ObjectId of the row inserted. What is returned if something goes wrong and the row IS NOT inserted? I haven't been able to create a failure scenario but should consider it can happen.


texts: How do I check my map units (needed for Point Density Tool)?

texts:
The Point Density Tool in ArcMap asks me to specify cell size in map units, but I am confused as to how to find out exactly what my map units are (e.g. whether they are based on the data frame coordinate system, the source coordinate system, or something else).

Where exactly do I go to check what my map units are so that I can define an appropriate cell size?

To minimize the chance of further confusion, I would ideally like specific instructions on where to locate this information within ArcMap.


texts: Labelling only certain polygon features in QGIS

texts: The red colored countries in the image are countries i consider highly vulnerable to freshwater shortages. I like to have the name of only these highly vulnerable countries appear on the map, i'd be glad to get responses on how to go about this.


texts: Listing all feature classes in File Geodatabase, including within feature datasets?

texts:
From python how can I build a list of all feature classes in a file geodatabase (*.gdb), including inside feature datasets? The standard example only lists feature classes at the top level of the geodatabase:

import arcgisscripting, os
gp = arcgisscripting.create(9.3)

gp.workspace = 'd:\scratch.gdb'
fcs = gp.ListFeatureClasses()

for fc in fcs:
    print fc

Please indicate which ArcGIS Desktop version your answer applies to (I am looking for 9.3 but we might as well collect all versions in one place).


texts: Interpolation with barriers in Google Earth Engine

texts: Does anyone have a code example or helpful information to conduct Empirical Bayesian kriging on Google Earth Engine or of an interpolation with barriers technique in Google Earth Engine?


texts: Free open satellite or other remote sensing data for night time?

texts: I usually work with daytime satellite images to do some image classification (mostly Landsat data from the USGS EarthExplorer). Right now I'd like to check at some night time images to work on city lights but I don't know which data sets or web services I should take a look at. Ideally, I'd like it to be a data set with long historical data 1970s-now but everything is welcome. Any ideas please?


texts: Exporting multiple layers to single dxf file using Grass GIS?

texts:
I'm very new to Grass GIS.

I need to export multiple vector layers into a single dxf file (required in order to import into another application).

However, I can't see a way of selecting more than one layer at the same time for export to a single dxf.

Is this actually possible in Grass GIS?


texts: PostGIS Recursive Query Based on Line Connectivity

texts:
I'm having difficulty with a query. I have a network of linestrings, each with a value in the n_type column. This can be one of a handful of options. I'd like to generate a new table that groups any linestrings that are of the same type and that form a continuous line.

Before:

After:

Here is what I've got so far. It returns results but they don't make any sense - the types don't match up and it returns too many features.

Please also note that I've defined "continuous" as any line within 5 feet of its neighbor and meeting at less than a 30 degree angle.

WITH RECURSIVE all_links (i, pk_uid, n_type, geom) AS (
    SELECT  1 AS i,
            pk_uid,
            n_type,
            geom
    FROM    network
    WHERE   n_type != 'none'

    UNION ALL

    SELECT  a.i + 1,
            b.pk_uid,
            b.n_type,
            b.geom
    FROM    network b, all_links a
    WHERE   b.n_type = a.n_type
    AND     b.geom <#> a.geom <= 5  --lines are continuous if within 5 feet of neighbor
    AND     ABS( DEGREES( 3*pi() - st_azimuth(st_startpoint(a.geom),st_endpoint(a.geom)) + st_azimuth(st_startpoint(b.geom),st_endpoint(b.geom)))::int % 360 - 180) <= 30 )  --only take links within 30 degrees of the same angle

SELECT i, n_type, ST_Union(the_geom) FROM all_links GROUP BY i, n_type

I have assumed a recursive query is the way to go, but I'm happy to be proven wrong on that.  Recursives are a little hard to grok.

Edit: I should also add that I've already tried aggregating using ST_Union and ST_Linemerge, and then dumping the result. This kinda works, but doesn't account for >30 degree intersections and also can't honor the five foot tolerance for connectivity.


texts: How to Use Feature Class to Feature Class After Multiple Fields Added in ModelBuilder?

texts:
I have created a model that towards the end of the model adds two new fields. I want to use Feature Class to Feature Class after the fields have been added and calculated, this way I can take advantage of the Field Mappings parameter. I am using ModelBuilder in ArcGIS 10.2 for Desktop.

This is what I have ... any thoughts on how to add Feature Class to Feature Class after the last two field calculations?


texts: Error coercing raster to SpatialPixelsDataFrame in R

texts:
I obtain the below error when I try to coerce my raster to a vector.

Initially my rasters are of different extents and I use the projectRaster tool to obtain the same extent for both the rasters. However, when I coerce the two to a Spatial Pixels Data Frame in R, I get different number of elements. Why is this happening?

> bio5
 class       : RasterLayer
 dimensions  : 339, 246, 83394  (nrow, ncol, ncell)
 resolution  : 0.04166667, 0.04166667  (x, y)
 extent      : 72.45835, 82.70835, 8.083337, 22.20834  (xmin, xmax, ymin, ymax)
 coord. ref. : +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
 data source : in memory
 names       : bio_5
 values      : 20.7, 43.2  (min, max)

Before Projection:

> lg5
class       : RasterLayer
dimensions  : 339, 246, 83394  (nrow, ncol, ncell)
resolution  : 0.04166667, 0.04166667  (x, y)
extent      : 72.45833, 82.70833, 8.083333, 22.20833  (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : in memory
names       : cclgmbi5
values      : 18.7, 39.2  (min, max)

After Projection:

new.lg5 <- projectRaster(lg5,bio5)
> new.lg5
 class       : RasterLayer
 dimensions  : 339, 246, 83394  (nrow, ncol, ncell)
 resolution  : 0.04166667, 0.04166667  (x, y)
 extent      : 72.45835, 82.70835, 8.083337, 22.20834  (xmin, xmax, ymin, ymax)
 coord. ref. : +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
 data source : in memory
 names       : cclgmbi5
 values      : 18.70035, 39.2  (min, max)

Coercing them to a vector:

 > x <- as(bio5,"SpatialPixelsDataFrame")
 > y <- as(new.lg5, "SpatialPixelsDataFrame")
 > str(x)
  Formal class 'SpatialPixelsDataFrame' [package "sp"] with 7 slots
  ..@ data       :'data.frame': 54202 obs. of  1 variable:
  .. ..$ bio_5: num [1:54202] 40.3 40.3 40.3 40.4 40.4 40.3 40.2 40.2 40.3 40.3 ...
  ..@ coords.nrs : num(0)
  ..@ grid       :Formal class 'GridTopology' [package "sp"] with 3 slots
  .. .. ..@ cellcentre.offset: Named num [1:2] 72.5 8.1
  .. .. .. ..- attr(*, "names")= chr [1:2] "s1" "s2"
  .. .. ..@ cellsize         : num [1:2] 0.0417 0.0417
  .. .. ..@ cells.dim        : int [1:2] 246 339
  ..@ grid.index : int [1:54202] 4 5 6 8 9 10 11 12 13 14 ...
  ..@ coords     : num [1:54202, 1:2] 72.6 72.6 72.7 72.8 72.8 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] "x" "y"
  ..@ bbox       : num [1:2, 1:2] 72.5 8.08 82.71 22.21
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "x" "y"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
  .. .. ..@ projargs: chr "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

  > str(y)
   Formal class 'SpatialPixelsDataFrame' [package "sp"] with 7 slots
  ..@ data       :'data.frame': 54747 obs. of  1 variable:
   .. ..$ cclgmbi5: num [1:54747] 37.6 37.4 37.4 37.4 37.4 ...
  ..@ coords.nrs : num(0)
  ..@ grid       :Formal class 'GridTopology' [package "sp"] with 3 slots
   .. .. ..@ cellcentre.offset: Named num [1:2] 72.5 8.1
   .. .. .. ..- attr(*, "names")= chr [1:2] "s1" "s2"
  .. .. ..@ cellsize         : num [1:2] 0.0417 0.0417
  .. .. ..@ cells.dim        : int [1:2] 246 339
  ..@ grid.index : int [1:54747] 3 4 5 6 7 8 9 10 11 12 ...
  ..@ coords     : num [1:54747, 1:2] 72.6 72.6 72.6 72.7 72.7 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] "x" "y"
  ..@ bbox       : num [1:2, 1:2] 72.46 8.08 82.71 22.21
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "x" "y"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
  .. .. ..@ projargs: chr "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"


texts: Selecting only trees that are close to road from another layer using QGIS?

texts:
I have two layers. First one consists of trees in a map, and second one consists of roads - polygons. I would like to select trees that are for instance 2m near the polygon.

Would you please give me a concept how to do that?


texts:
I'm making monitoring well figures which includes nested wells. This means that I have mulitple features with the same coordinates but having different attribute data (ex. Well ID). I need to label all the wells in the figures however, the labelling of the nested wells is really messy in appearance.I have to convert to annotations and manually adjust the labels.

Is there a way I can script the label so that a nested well will only have one label but it includes all the Well IDs?


texts: How to create a virtual layer in QGIS that shows only the features in the extent

texts: I am trying to make a virtual layer that is based on a map layer that only returns the features in the current map canvas extent. The purpose is to setup a Data Graph that shows statistical data of only the features in the current map extent. I cannot find any examples of this being done in qgis or using SQL. Is it possible?


texts: How to import polygons from OSM to QGIS?

texts:
I am trying to import Polygons from OSM to QGIS 2.0, but so far I have no idea how to do that.
E. g.: Kisterseg auf Tatabanya in HU:
http://www.openstreetmap.org/?relation=1027806

Is there any fast way to get the polygon into qgis?


texts:
I have local GeoServer and QGIS 3.10. Everything was fine until yesterday. QGIS cannot connect to GeoServer. I have such image:

GeoServer runs in normal mode with no errors in log file. There is no mention about connection attemp in GeoServer log. I've tried another QGIS version - 3.6 and there are no changes. What can go wrong with that connection?


texts: Exported GEE one band raster shows three bands in ArcGIS

texts:
I made a raster layer on google earth engine that only contain pixels have value higher than SAVI mean+1SD. I exported the raster layer as GeoTIFF and specified the raster as green colour. When I checked it in ArcGIS, the area wasn't into the green raster region showed black and the black area was larger than my polygon, which made it impossible to overlap this raster with the satellite image beneath. Is there anyway to change the black colour into no colour?
Here is my code:

var Blueskin =ee.Image('COPERNICUS/S2/20160721T223713_20160722T000334_T59GMK');
Map.centerObject(Blueskin, 10);

var Mask = ee.FeatureCollection(table);
Mask = Mask.geometry();
Map.centerObject(Mask);
var Blueskin = Blueskin.clip(Mask);
Map.addLayer(Blueskin,Color, 'False Color');
var Red=Blueskin.select('B4');
var NIR=Blueskin.select('B8');
var savi = (NIR.subtract(Red)).divide(NIR.add(Red).add(0.8)).multiply(1.8).rename('SAVI');

var mean = ee.Number(stats.get('SAVI_mean'))
var std = ee.Number(stats.get('SAVI_stdDev'))
var maskImage = savi.updateMask(savi.gt(mean.add(std)));
Map.addLayer(maskImage, {palette: 'green'}, 'mask image');

// Keep only 'B' bands
Blueskin = Blueskin.select('B.+')
// Export a cloud-optimized GeoTIFF.
Export.image.toDrive({
  image: Blueskin,
  description: '210716FC',
  scale: 10,
  region: table,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});
print(maskImage);

var visualization_params =  {palette:'green'};
// Export a cloud-optimized GeoTIFF.
Export.image.toDrive({
  image: maskImage.visualize(visualization_params),
  description: '210716USAVI8',
  scale: 10,
  region: table,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});

When I checked the image property of "maskImage" -the raster layer on google earth engine, it showed it only has one band called 'SAVI'. But when I imported it into ArcGIS it became three bands (RGB) with red and blue has value "0", which seems like there is only one band (the green) has same value (according to Symbology). Also, in symbology if I change the stretch into only one band the entire layer is just gone black.


texts:
At 10.7.1, I have created this very simple model:

However, when I run the model, it immediately fails at the Add Field tool, with this response:

Executing (Add Field): AddField C:\WorkSpace\CDLT\PARCEL_MODEL\Parcels.shp cdlt_acres DOUBLE # 2 # # NULLABLE NON_REQUIRED #
Start Time: Tue Mar  3 16:09:08 2020
Adding cdlt_acres to C:\WorkSpace\CDLT\PARCEL_MODEL\Parcels.shp...
ERROR 999999: Error executing function.
Failed to execute (Add Field).

Unfortunately, there is no help for ERROR 999999, so I turn to SE for assistance.  I've checked the shapefile's geometry, and restarted Arc, but the error still persists.

FWIW, here are the contents of the model's Add Field tool:


texts: mosaic raster to file geodatabase yields missing raster sections

texts:
Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working with python, but I've duplicated the issue in ArcMap.

Consider a sample dataset, available here, which includes two states (MA and CT) of gSSURGO soil rasters. Create a file geodatabase for outputs, then:

outGDB = <your file geodatabase>
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference("North America Albers Equal Area Conic")
arcpy.env.OverwriteOutput = True
arcpy.env.pyramid = "PYRAMIDS -1 NEAREST DEFAULT"
#arcpy.env.snapRaster = <your snap raster> # I snap to an NLCD layer, not sure its pertinent to the example, though
arcpy.env.cellSize = 30

inFolder = <the folder which contains the extracted zip file contents>
inList = []
arcpy.env.workspace= inFolder
for f in arcpy.ListFiles():
    inList.append(inFolder+f+"/"+f)

arcpy.MosaicToNewRaster_management(ify(inList,";"),outGDB,"soils",albers,"32_BIT_UNSIGNED","#","1",'FIRST')

The operation successfully produces a new raster, but for me it has some unusual properties. Namely, I find large sections of the file do not display when zoomed out:

And as I zoom in incrementally, the gaps fill:

A few notes:

The "Identify" tool tip shows that there is data present even when not depicted. The same issue occurs in both ArcMap and ArcCatalog.
The issue does not occur when I perform arcpy.MosaicToNewRaster_management() with output to a regular system folder.
Scale range is set to "Show layers at all scales".
As I zoom out, the whole extent disappears eventually.


texts: Open dgn and a referenced raster files in QGIS

texts:
I have a dgn file that have a raster file referenced to it. If I open it in Bentley Microstation it understands where to place the raster.

If I open the dgn I get 3 layers (point, line and area) and the raster is a separate layer and not placed correct.

Is it possible to achieve this in QGIS ?
The raster files are in CIT format


texts:
I'm trying to use ArcGIS Pro 2.0 to create photorealistic scenes from specific viewpoints. I often do wide panoramic views that require multiple photo exports that I put into photoshop and stitch together. In order to stitch them together accurately, the pitch should be consistent (ideally set to 0) and there should be some overlap. I also like to give a total bearing for the final photo in the report.

However, I can't find the camera parameters anywhere in an ArcGIS Pro Scene. I can select an imported viewpoint and zoom to it, set my elevation above ground, and pan around w/out moving location (hold down b). But I need to know what my pitch is, my bearing, field of view, etc. In the Animation Properties you can see these parameters for specific keyframes...so it must be possible to see somewhere w/out making an animation.


texts: How to crop an image based on a shapefile using GeoTools

texts:
I'm writing a web application using GeoTools (it's Java running in a web container).  I need to crop a raster file based on a shape file.  The core GeoTools documentation and examples I can follow suggest that cropping is limited to Envelope (rectangular) cuts.

I came across the ImageWorker class which provides "helper methods for applying JAI operations on an image."  It has a promisingly named method "mask" method ... which seems like what I want ... but it's poorly documented and seems really slow.

I'm looking for examples and/or suggestions for alternative strategies.


texts:
I have done this with vector before, but now I have 2 raster layers:

1 raster layer that refers to land use: urban, forest, water, agriculture

1 raster layer that was classified in 3 classes for flood risk: low, medium, high.

What steps I have to do to get a new raster layer of only urban land use which is situated in high flood risk?

And how to find the most land use that is situated inside the high risk zone?

I spent days thinking of this but I don't really have any experience with spatial analysis using rasters.


texts: When to recompile resource.qrc with pyrcc5

texts:
In QGIS3 plugin tutorials that use the plugin builder, it says to run pyrcc5 before importing the plugin.
After what changes should pyrcc5 be run again? I have managed to modify some plugins by changing some of the Python code and the changes were there when the plugin was reloaded, without me recompiling.

I read here that pyrcc5 compiles the resource.qrc file, but I don't really know what that file is for. The documentation mentions icons, so am I right in presuming that I would have to recompile only after changing the additional images (icons, etc.) provided to the plugin?


texts: QGIS changing canvas CRS defaults to imported layer

texts:
I am having trouble setting the mapCanvas CRS in QGIS 3.0 using Python. I am effectively trying to replicate what happens when you change the CRS by clicking on the bottom-right corner of the Canvas and selecting a CRS.

When I set the CRS using iface.mapCanvas().setDestinationCrs(crs) the CRS changes. However when I import a layer, the CRS changes to the layer's CRS.

For instance, in the code below:

Open a new project.
Set the CRS to 4326.
Import Google Satellite image with the CRS 3857.
Set the CRS to 4326 again.
QGIS shows a CRS of 3857.

When I run the same code again but add a print statement between adding the layer and setting the CRS the second time, the code works. I am not sure why this works.

from qgis.core import (
    QgsCoordinateReferenceSystem,
    QgsRasterLayer,
    QgsProject
    )
from qgis.utils import iface

def get_google_layer():
    google_uri = "type=xyz&url=https://mt1.google.com/vt/lyrs%3Ds%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D"
    return QgsRasterLayer(google_uri, 'Google', 'wms')

def change_map_canvas():
    iface.newProject(False)
    crs = QgsCoordinateReferenceSystem(4326)

    iface.mapCanvas().setDestinationCrs(crs)
    iface.mapCanvas().refresh()
    assert iface.mapCanvas().mapSettings().destinationCrs() == crs

    l = get_google_layer()
    QgsProject.instance().addMapLayer(l)

    #print("Here")

    iface.mapCanvas().setDestinationCrs(crs)
    assert iface.mapCanvas().mapSettings().destinationCrs() == crs


texts: Connecting to PostgreSQL database from another machine using QGIS?

texts: I have a database with name "Test" in PostgreSQL 11 in my machine, I can connect to this database from my machine using QGIS with host localhost, but when I tried to connect it from a different machine with the same network by entering my IPv4 address it didn't work. So could you give me solutions pleas?


texts: Changing layer symbology in QGIS 3 with QgsFeatureRendererV2

texts:
I am updating a QGIS Plugin from QGIS 2 to 3 and I am struggling with changing the layer symbology (a single symbol type for a line layer). I would like to have all lines in my layer to have the same color and the same thickness.
For QGIS 2 it worked like this:
symbols = iface.activeLayer().rendererV2().symbols()
symbol = symbols[0]
symbol.setColor(QColor.fromRgb(0, 225, 0))
symbol.setWidth(0.75)
qgis.utils.iface.mapCanvas().refresh()
qgis.utils.iface.legendInterface().refreshLayerSymbology(iface.activeLayer())

For QGIS 3, I understood from the API break documentation that rendererV2() has been renamed to renderer(). Further, symbols() has been removed: "symbols( QgsRenderContext& context ) method should be used instead (previously available as symbols2 in PyQGIS bindings)."
I find it hard to connect this information and what I find under the QgsRenderContext documentation to my problem.
An explanation on how to solve such issue based on the documentations would be helpful.


texts:
I was reading an ArcGIS Help page recently on Polygon to Raster (Conversion) GP tool. There is piece of information there that I became interested in:

  If "bleeding" or stripes occur in the output raster then use the Check
  Geometry and Repair Geometry tools to correct the input feature data.

Can anyone describe what bleeding is in terms of a GIS raster dataset / satellite imagery data and if possible supply an image for illustrating this phenomenon.


texts: arcpy.TableToExcel_conversion works on layer but not if layer is variable

texts:
I'd like to loop through a bunch of mxds, on every layers, and from them I'm trying to export excel files. If I use a layer in arcpy.TableToExcel_conversion it works, but as I set a layer as a variable I get an error message. Why? How could I do this instead?

I loop through the layers not the feature classes because I only want to export the visible fields

Here it works as a layer:

title = "etwas"
arcpy.TableToExcel_conversion("mylayername", "C:/TEMP/export_tables/" + title + ".xls", "ALIAS")

Here it does not work:

inlayer = arcpy.mapping.Layer("mylayername")
arcpy.TableToExcel_conversion(inlayer, "C:/TEMP/export_tables/" + title + ".xls", "ALIAS")

And here is my error message that I get:

Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\conversion.py", line 81, in TableToExcel     raise e ExecuteError:  Traceback (most recent call last):   File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\TableToExcel.py", line 222, in <module>     arcpy.GetParameter(3))   File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\TableToExcel.py", line 190, in table_to_excel     with arcpy.da.SearchCursor(in_table, field_names) as cursor: RuntimeError: cannot open 'GPL0'  Failed to execute (TableToExcel).


texts: Service URL for Web Feature Service (WFS) using GML Simple Features profile?

texts:
Does anyone know of an "almost always available" Service URL for a Web Feature Service (WFS) using GML Simple Features profile?

I'm keen to test WFS client capabilities without having to configure a WFS server.

UPDATE

The Answer to this Question provides advice on how to determine if a given WFS appears to be using SFGML.


texts:
I feel like this is a rather straightforward question but I can't seem to find a suitable answer online. Hopefully someone here can help.

I would like to crop a raster (projected in EPSG:27700) given a bounding box which the user can define. So far I've found the most straightforward way of defining a bounding box is to use an online tool such as https://boundingbox.klokantech.com/.

Unfortunately, the coordinates from this website are lat/long, not EPSG:27700 (if you export as CSV). I need to convert the bounding box to EPSG:27700 so that I can crop to the appropriate extent and carry out an analysis on a subset of all the data I currently have. Is there a straightforward way to do this?


texts: Is it possible to create a VRT file with ogr2ogr?

texts:
I want to create VRT files from ungridded .asc files (example file).
The VRT files should look like this:
<OGRVRTDataSource>
    <OGRVRTLayer name="worms">
        <SrcDataSource>ODBC:DISEASE,worms</SrcDataSource>
        <SrcLayer>worms</SrcLayer>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="x" y="y"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

I can't seem to find a way to create these VRT files with an GDAL/OGR command. The error is "VRT driver has no vector capabilities."
But when I create the VRT file manually (edit the text in an existing VRT file), it works fine.


texts:
I am working on a large data set of Road with snapping tolerance 5px with topological editing option enable. When i am zooming to the snapped vertex with zoom level upto 1:50, its looking snapped or if moving the vertex then all snapped vertex are moving together .

After this i should be confident that snapping option has set correctly. But when i am checking the same dataset with topological checker tool of Qgis 2.14.1Essen with option of dangling nodes. There are lot of error showing in dataset apart from the ends of road. Why this happening . I am not able to get whether problem is with tool or my snapping tollerance settings.


texts: What are the problems of loading overlapping (or the same) tifs into postgis?

texts:
I am still early on the Postgis learning curve.  I have an existing table in Postgres - it looks like this:

create table "public"."mytable" (
  "rid" serial primary key,
  "rast" raster,
  "filename" text);

I have many tifs that I'd like to load into the table:

raster2pgsql -a -s 4326 -M -F -t 100x100  myfile.tif public.mytable > loadtif.sql

followed by (or as part of same step)

psql -d mydatabase -f loadtif.sql

I am curious to know how carefully I need to vet my tifs beforehand to make sure that they don't overlap at all.  Will there be a problem if they overlap with each other?  I notice that if I load the exact same loadtif.sql file multiple times, I get - as expected - a table with rows containing the same data loaded multiple times (though with different rids, of course).

This makes me think that overlapping tifs will indeed cause problems by causing duplicate row entries.  No?


texts:
I have a table with three points in it and I want to create a line from them using PostGIS.

when I try to create a line from this geometry using:

select id,
       st_makeline(geom order by id desc) as geom
from public."point_table"
group by id;

I get null geometery

What am I doing incorrectly?

PostGIS version 2.2.1 PostgreSQL version 9.5.1


texts: Calculating number of different colored pixels in multiple polygons at once

texts: I have a raster with 17 different colors. I need to find the count of pixels in each colour. I could use Zonal statistics for one polygon but I have to find the count in multiple polygons at once. How can I accomplish that in QGIS?


texts:
I am trying to create a new column in my parks database then calculate the area of the park but i keep getting this syntax error.

Can anyone see what is wrong with it?

alter table parks add column area double precision update parks set area = select st_area(geom) * power(0.3048,2) from parks;


texts:
i would like to log every layers openings in PyQGIS, regardless of the opened project.

Is there a way to achieve that ?

Where should be the Python code be located in that case ?


texts: PostGIS broken after Ubuntu 16.04 upgrade

texts:
I upgraded Ubuntu from 15.01 to 16.04 and PostGIS is broken. Below are the errors:

psql (9.5.2)
Type "help" for help.

osm=# select version();
version
-------------------------------------------------------------------------------------------------
 PostgreSQL 9.5.2 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
(1 row)

osm=# \dx
                                      List of installed extensions<br>
   Name    | Version |   Schema   |                             Description
-----------+---------+------------+---------------------------------------------------------------------
 hstore    | 1.3     | public     | data type for storing sets of (key, value) pairs
 pgrouting | 2.1.0   | public     | pgRouting Extension
 plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
 postgis   | 2.2.2   | public     | PostGIS geometry, geography, and raster spatial types and functions
(4 rows)

osm=# select postgis_full_version();
ERROR:  could not load library "/usr/lib/postgresql/9.5/lib/postgis-2.2.so": /usr/lib/postgresql/9.5/lib/postgis-2.2.so: undefined symbol: lwgeom_sfcgal_version
CONTEXT:  SQL statement "SELECT postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 22 at SQL statement

This database had PostGIS working before the upgrade. I tried create extension postgis; on a new database and got the same error. I also tried to remove and install PostGIS again but to no avail.


texts: Grouping values by type and counting them

texts:
I have a set of points in a csv and a shapefile, and I used the buffers of the points to obtain the subset of polygons from the shapefile that intersects the buffers.

Each of the polygons has a specific type, let's say A,B,C,D.

What I need to know is for each point, what are the types of the polygons that intersect its buffer.
Unfortunately, in some cases, a single point has multiple polygons in its buffer that have the same type but I need to count them only once because in the end, I would like to know how many occurrences of each type there are in total.
So, for example, let's say that I have 4 points, each with a subset of polygons

Point 1: A,B,C
Point 2: B,C,C,C,C,D
Point 3: A,A,A,B,B
Point 4: C,C,C,D,D

I would like to edit this data to look like this

Point 1: A,B,C
Point 2: B,C,D
Point 3: A,B
Point 4: C,D

After doing that I would like to count the total types, in order to know that there are in total 2 occurrences of A, 3 of B, 3 of C and 2 of D.
How can I make something like that?


texts: Why is my attribute table only showing one row of values?

texts: I have 68280 features in my QGIS layer which I have loaded from SQL, however when I open my attributes table it only shows 1 'filtered' row. Why? The rest of the values are not showing.


texts: Python/GDAL and accessing raster attribute table in ArcMap

texts:
I am trying to build a raster attibute table using Gdal Python. My script  successfully runs until the end.

I want to read back the raster with attribute table in ArcMap. I am using ArcGIS 10.4.

After adding the raster data in ArcMap, no attribute table shows up.

Maybe I miss some part during my attribute table building process.

Could anyone please take a look at my script?

Script sample:

from osgeo import gdal, ogr
from osgeo import gdalconst
import numpy as np

array=outband.ReadAsArray()

array example:

array=[[0 1 1 2 2 3 4]
       [0 1 2 2 2 3 3]
       [0 1 2 3 3 3 0]]

# creating raster attribute table
ras_at = gdal.RasterAttributeTable()
# creating a value column of unique values in raster
ras_at.CreateColumn("Value", gdalconst.GFT_Integer, gdalconst.GFU_MinMax)

# OBTAINIG VALES for column....
#vals = list(np.unique(array))
vals = np.unique(array).tolist()
vals=[i for i in vals if str(i)!='nan']
for i in range(len(vals)):
        ras_at.SetValueAsDouble(i, 0, float(vals[i]))
print ras_at.GetRowCount()

outband.SetDefaultRAT(ras_at)


texts: How to break (both) lines at their point(s) of intersection in QGIS?

texts:
I'm working with a road network where some of the road segments cross each other but no point is inserted at their intersection. Is there a way to break these line to shorter lines at their points of intersection either completely in QGIS?
Thanks


texts: Resampling a raster from python without using gdalwarp

texts:
I'm trying to resample a GeoTIFF file to match another raster layer using python GDAL package. Most of the ways I found online is to use gdalwarp resample data from the command line. Is there a way to get cell resolution inside of python script and do the resample process inside of the python script? Maybe things like:

disout.SetGeoTransform(diskin.GetGeoTransform())


texts: Selection of names according to their termination

texts: I would like to select cities in my attribute table according to their suffix. For example: select only cities which end with "ton". How can I do this?


texts: Highlighting GeoJSON components based on common feature properties

texts:
I have a GeoJSON map. It's a map of a country, which is made up of states, which are in turn made up of sub-state regions.

I can create a Leaflet map where I can highlight (in this case 'orange') the sub-state regions as the cursor touches them. I would like to simultaneously highlight other sub-state regions (in a different colour) that are in the same state as the initial region (ie. I want to highlight the selected sub-state region one colour, and the remainder of the state another colour).

I think I need to put the new bit of code at the comment 'new bit of code here', but I don't know how to select the other elements in the geojson that ARE NOT the one currently selected, but that still have the feature property STATE_NAME16 == tmp.

geojson = L.geoJson(States_Data, {

    onEachFeature: function (feature, layer) {
        layer.on('mouseover', function () {
          var tmp = feature.properties.STATE_NAME16 ;

          this.setStyle({
            'fillColor': 'orange'
          });

          //[new bit of code here]

        });

    }

}).addTo(map);


texts:
I'm new to GIS programming, and am going through the Esri "Getting Started with arcpy.mp" tutorial.

When I try the following:

lyrFile = arcpy.mp.LayerFile(r"path to a layer file")

I get the following error:

  File "", line 1, in
    File "c:\users\ME\appdata\local\programs\arcgis\pro\Resources\arcpy\arcpy_mp.py", line 773, in init
      self._arc_object = arcgisscripting._mapping.LayerFile(*gp_fixargs((layer_file_path,), True))
  OSError: C:\Users\ME\Documents\ArcGIS\myLayer.lyrx

Typical google search doesn't really bring up much except for Adding feature class to Map in CURRENT project using ArcPy in ArcGIS Pro?

I've tried the alternate methods of adding a Layer file as suggested in the question thread, but get the same OS error.

What is causing this error, so I can figure out how to resolve it?


texts: Perform non-spatial queries on DB tables of a RDBMS connected with arcgis

texts:
Is it possible to use the arcgis infrastructure so as to perform queries on DB tables that do not contain spatial information?

For example, considering I have a RDBMS where I have a table namely "Articles" with no geographic info.
Could I perform a query by article title through arcgis, so as to avoid following different  search/filtering approaches for spatial and non spatial data ?


texts: Daily averages in local time rather than UTC in GEE

texts:
I'm trying to calculate daily averages in local time rather than in UTC for a global sample on Google Earth Engine, but I haven't found a clever way to do this. Does GEE have functions for this?

Here's the code, I'm currently using, which takes daily means, but based on the UTC time stamp that comes with the images:

https://code.earthengine.google.com/74f8b3b27b68578146313aabbf4cb511

function meanByDate(imcol){
  // imcol: An image collection
  // returns: An image collection
  var imlist = imcol.toList(imcol.size())

  var unique_dates = imlist.map(function(im){
    return ee.Image(im).date().format("YYYY-MM-dd")
  }).distinct()

  var mean_imlist = unique_dates.map(function(d){
    d = ee.Date(d)

    var im = imcol
      .filterDate(d, d.advance(1, "day"))
      .mean()

    return im.set(
        "system:time_start", d.millis(),
        "system:id", d.format("YYYY-MM-dd"))
  })

  return ee.ImageCollection(mean_imlist)
}


texts: Is there ArcPy tool for polygon resizing like Scale tool of Advanced Editing toolbar in ArcMap?

texts:
I am writing a python script for ArcGIS 10.3.
I know about Scale tool in ArcGIS interface but I can't find such arcpy command. It exists?

As you can see on the picture the Scale tool works different than Buffer tool - it changes the form of original polygon. So the question is:

Can I use Scale tool (available from ArcGIS interface) using arcpy?


texts: I'm new in PyQgis. I'm looking for a code to move one layer in TOC to a specific position. Is it possible?