texts: Oracle tracing, bind variables, and ArcSDE

texts:
Oracle tracing with TKPROF is the recommended way to troubleshoot data access performance problems with SDE/Oracle. Unfortunately, queries that differ in any way are considered "different" and summarized independently. For our long-running geoprocessing task, millions of queries like this are generated:

SELECT A, B, C FROM TABLE WHERE (OBJECTID = 123);

The TKPROF output for this query shows stats for every single call of this type, because OBJECTID differs in each case. For example:

SELECT A, B, C FROM TABLE WHERE (OBJECTID = 123);

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          3          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.00       0.00          0          3          0           1

...

SELECT A, B, C FROM TABLE WHERE (OBJECTID = 124);

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          3          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.00       0.00          0          3          0           1

etc...

Millions of stats like this are pretty useless. They need to be summarized for every query that follows the pattern SELECT A, B, C FROM TABLE WHERE (OBJECTID = x).

The simple OBJECTID = 123 filter is generated by GetRow().

Here is an example of the C# code driving other problematic queries:

IQueryFilter filter = (IQueryFilter)gdbContext.CreateObject("esriGeodatabase.QueryFilter");
filter.WhereClause = "REF_IN_ID  = " + nodeID + " OR NREF_IN_ID = " + nodeID;
streets.Select(filter, esriSelectionType.esriSelectionTypeSnapshot, esriSelectionOption.esriSelectionOptionNormal, null);

If Oracle bind variables are used, however, the TKPROF output is more helpful. For example:

INSERT INTO TABLE (A, B, C)
VALUES
 ( :a1, :a2, :a3)

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse      687      0.01       0.01          0          0          0           0
Execute    687      0.08       0.10          4        689       4851         687
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total     1374      0.09       0.12          4        689       4851         687

So the question is: is there any way to force ArcSDE/ArcObjects to use bind variables when constructing Oracle queries?

If not, how do you recommend performance tuning for a long-running geoprocessing routine like this?


texts: Is it possible to use custom (non-circle) buffer shapes?

texts: I have a shapefile containing points. I'd like to replace each point by the same shape, centered around the point, like the "Buffer" tool with shapes other than circles. How can I do that?


texts: Creating raster depicting landcover/use change in ArcMap?

texts:
How would I create a conversion matrix in ArcMap 10.2.2 to display the changes between two rasters (Land Use Land Cover Maps)?

I have produced Land Use Cover Change maps from temporal satellite images and I need to do change detection between them. Therefore, I need to create a conversion matrix to display changes in each land cover class, and also to give information regarding direction of change; something detailed that indicates what the changes were.


texts: esri Print dijit fails when using the Export service of my arcgis Server and works when the same is hosted in arcgis online

texts:
I am using the print dijit so as to export a web map that contain a WebTiledLayer.
When I use as of the export servive one that directs to arcgis online it works properly.
On the other hand when I change the url, so as to point to my service, exporting fails, getting a timeout error which says : dojo.io.script error RequestTimeoutError: Timeout exceeded { message="Timeout exceeded"............

My server is arcgis 10.2.2 while the online one is 10.2.1, but I dont think this can be a problem
     I

  <script>
  var app = {};
  app.map = null; app.toolbar = null; app.tool = null; app.symbols = null; app.printer = null;
  require([
  "esri/layers/WebTiledLayer",
    "esri/map", "esri/dijit/Print",
    "dojo/dom", "dijit/form/Button",
  ], function(

  WebTiledLayer,
    Map, Print,
     dom,
     Button
  ) {
    app.map = new Map("map", {
      center: [0, 0],
      zoom: 3
    });
    // print dijit
    app.printer = new Print({
      map: app.map,
      url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
      //url: "http://myserver:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
    },
    dom.byId("printButton"));
    app.printer.startup();
    var tiles="http://www.mytiles.int/cpdbmap/graybasemap/{z}/{x}/{y}.png" ;
    var tiledLayer = new esri.layers.WebTiledLayer(tiles.replace('{z}/{x}/{y}','${level}/${col}/${row}'), {
                    id: "anID"
                });
     app.map.addLayer(tiledLayer);
  });
</script>


texts: Loading and appending new data (in x,y format) using QGIS

texts:
I have a daily task where I need to loads and append 25 points into the same  QGIS layer. Can anybody guide me, how to achieve this task?

Currently it loads and replace the data in the existing layer but I want to append it.

In ArcMap, this tool is called Load, but I need it in QGIS.


texts:
I'm trying to create some NETCDF4 CF compliant files from some code that generates GDAL compatible files. I was wondering whether there is a simple translation from GDAL (or proj4) projection information and geotransform and what netcdf/CF expects.

I am using Python, GDAL (1.11.2), and the python NetCDF4 bindings, and it is safe to assume that I have an e.g. Proj4 string and a GDAL GeoTransform array available. The projections can range from the standard no projection WGS84 kind of data, to local a bunch of local, equal area types (e.g. UTM, or MODIS sinusoidal).


texts: Is it possible to open a Python file on ArcGIS and use ArcGIS information (from attribute tables) in routines of this Python file? If it´s possible, how can I do?


texts:
I have multiple polygons that have zero to 4 points (sampling sites with a list of species) in them. I need all the information from these sampling sites ONCE per catchment. So instead of up to 4 times the same species I need ONE list of species per polygon. My only idea is to aggregate or merge the points per polygon (no idea how, the points dont have a common field I could use), then export it to Access, erase repetitive species and then import it back to GIS. Maybe there is an easier way.

I am using ArcGIS 10.4.

EDIT:
With spatial join, I added a column to my points shape with the ID of the polygon. That means if 2 sampling sites (points) are in one polygon, they now have the same polygon-ID. In one column I have the species names, with one line per species. That means that for each polygon there are multiple lines (as many as different species) but for the ones where more than 1 sampling site are located, some species are double or three of four times in this list. That I have to change.


texts: How to check if a FeatureCollection is contained in another FeatureCollection?

texts:
I want to use the list of the LMIC countries (Low and medium incomes country) to check if a given AOI is inside this list.
I have created a FeatureCollection (users/bornToBeAlive/lmic) that is listing all these countries.
I wanted to test assertion using a contains method on the geometry of both the aoi and the lmic list.
Problem when I run it (https://code.earthengine.google.com/762caa3fc44d220247e8ffea32762b15):
var lmic = ee.FeatureCollection('users/bornToBeAlive/lmic')
var in_geom = ee.Geometry.BBox(
    -102.73006885614397,
    22.35983420356853,
    -100.44491260614397,
    24.85613968556801
)
lmic.geometry().contains(in_geom) //expected True

I get the following error:

Collection.geometry: Geometry has too many edges (3378987 > 2000000).

I would like to know how I can perform this kind of test?
Note
I have already tested to do it feature by feature but it doesn't serve my purpose as it throw False if the aoi is overlapping on 2 countries (from LMIC list).


texts: Eccodes grib_copy - How to identify the levels and parameters?

texts:
I would like to generate a grib from a full GFS grib2 having, for example, only the U and V component for 850 hPa. To do so, I've seen I could use the eccodes library or the command line grib_copy but I don't find how to filter the parameters. Usually in GDAL I use the band numbers but with eccodes I've no idea where to start.
Do you have any reference that tells me how to get the parameters? Or maybe another way to do it?
In the grib_copy documentation I couldn't find (https://confluence.ecmwf.int/display/ECC/grib_copy)


texts: Using ModelBuilder with Field Calculator gives SyntaxError?

texts:
I am brand new to coding, have no background at all. Basically I have about 200 tables with the same info listed under slightly different attribute table headings and I am trying to rename them to match so I can merge them all and move to ArcSDE eventually.  I had issues trying it with a few tables(8 total) as a shorter trial run in model builder because the names "REC", "REC_SS" and REC_" did not all exist in just those few files but do in the larger schema of 200. Now I am getting a general error in GIS of 999999 and an error invalid syntax error 000539 but my code is reading fine in a trial python site.

Here is my code and I attached a screen shot too.

This is my code block:

def customReplace(fieldValue):
    repList = ("REC")
    repValue = "REC_CODE"
    for item in repList:
       if item in fieldValue:
         fieldValue = fieldValue.replace(item, repValue)
    return fieldValue

My field expression is:

customReplace ("REC_CODE")


texts: Simultaneously adding multiple search results from Catalog into ArcMap

texts:
System spec: ArcInfo 10.1

I have performed a search on an indexed file geodatabase, looking for feature classes with the word "building" in their name.

I either need to add all of these to a blank map, or copy/export them all to a new location.
I was hoping that after performing the search I would be able to select all of the returned results and add them to the map, but it appears that I have to add them one at a time.  There's thousands of feature classes returned, so adding them one by one isn't really an option.

Am I missing something really simple? Or is there a better way to do this?


texts: How do I add projection to this NetCDF file? (Satellite)

texts:
I have been working with satellite data from the GOES-16 satellite for quite some time now. A sample .nc file for this data is  located at this NOAA AWS link

I use gdalwarp to transform it for Mapbox use (GeoTIFF) and it works great.

I recently started working on some new data from the same satellite, but the projection data seems to not be applied. This is because the data is cutting edge and is generated by a Python script that does not project the data the same way as the AWS files are.

Below is a link to dropbox to the .nc file I am working on now :

https://www.dropbox.com/s/f53fkqqyamd1rb9/glm.nc?dl=0

When I run gdalinfo on the new data, I see this :

Driver: netCDF/Network Common Data Format
Files: glm.nc
Size is 1499, 2499
Metadata:
goes_imager_projection#grid_mapping_name=geostationary
goes_imager_projection#inverse_flattening=298.2572221
goes_imager_projection#latitude_of_projection_origin=0
goes_imager_projection#longitude_of_projection_origin=-75
goes_imager_projection#long_name=GOES-R ABI fixed grid projection
goes_imager_projection#perspective_point_height=35786023
goes_imager_projection#semi_major_axis=6378137
goes_imager_projection#semi_minor_axis=6356752.31414
goes_imager_projection#sweep_angle_axis=x
NETCDF_DIM_EXTRA={ntimes}
NETCDF_DIM_ntimes_DEF={1,5}
NETCDF_DIM_ntimes_VALUES=36920
total_energy#grid_mapping=goes_imager_projection
total_energy#long_name=Total radiant energy
total_energy#missing_value=-9999
total_energy#units=J per flash
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 2499.0)
Upper Right ( 1499.0,    0.0)
Lower Right ( 1499.0, 2499.0)
Center      (  749.5, 1249.5)
Band 1 Block=1499x1 Type=Float32, ColorInterp=Undefined
NoData Value=-9999
Unit Type: J per flash
Metadata:
grid_mapping=goes_imager_projection
long_name=Total radiant energy
missing_value=-9999
NETCDF_DIM_ntimes=36920
NETCDF_VARNAME=total_energy
units=J per flash

How do I convert the projection into the same one from the AWS data? (first link).

I found a Python script online which I have put up on pastebin (https://pastebin.com/P9edec4H)  that seems to have all of the projection data needed. However after trying to get GDAL working in Python for 2 hours I had to give up due to package conflicts. (I use the command line executables normally)

I have tried all sorts of commands (trying to add the proj string, etc) but honestly it is a bit embarrassing if I had to post them all here because I don't exactly know what I am doing.

Does anyone have any idea?


texts: CartoDB (PostGIS) near function (distance) points to polygons

texts:
I have a CartoDB map here:

Link: https://dms2203.cartodb.com/viz/78db6c02-3148-11e5-a42f-0e018d66dc29/public_map

I'm trying to find the distance of the points to the polygon. If the points are inside, they should have a value of 0. Basically, I'm looking for Near (Analysis) from ArcGIS equiv. in PostGIS http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001q000000

Could someone help me craft out the SQL? I'm trying to learn to do it in PostGIS but figure it's easier to test out the SQL statement in CartoDB.

I've referred to this: http://postgis.net/docs/ST_Distance.html but have had trouble with the syntax on my end.

The points are in a layer called:
points_near

The polygon is in a layer called:
polygon_near


texts:
I have a problem with " qgis web client" I can not find the option setting center of maps and change the zoom ?? I was looking at globaloptions but I managed to ; /
Regards


texts: Utitlsing QGIS and Stata's spwmatrix command

texts:
At present I’m working on a paper which analyses the impact diversity can have on employment amongst Irish regions. Given the data which this study uses are based on administrative boundaries, we wish to employ a spatial model.
The data is panel in nature with a T = 6 and n = 27.

Originally, I was utilising the user written command xsmle provided by Belotti et al. (2016) and the model of choice was a Spatial Durbin Model.
However, these set of commands are limited to a finite number of spatial panel models.

For instance, I would like to estimate a Spatial Durbin Error Model.
What I would like to do is create spatially lagged independent variables (using spalgvar) , and then include these variables into an Spatial Error Model to estimate a Spatial Durbin Error Model.

I’m aware that  the spwmatrix command was updated with the xtw(#) option in order to allow users to generate spatial weights for panel data.
I’m running into some issues in trying to specify my weights matrix with the spwmatrix command.

I’ve attached the code sample for ease

As you can see I run into no difficulties with the spmat command however, I’m unclear how to carry out an identical specification for the spwmatrix command (note I would require to specify a panel as my data is panel).

* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28)
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1
0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0
0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0
0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1
0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0
1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1
0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0
1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0
0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0
end
*Creating a matrix with spmat
putmata W = (v*), replace
m rowsum(W)
spmat dta v v*, replace normalize(row)
spmat summarize v, links
*How to create the matrixh with spwmatrix?
spwmatrix socio v*, wname(r) row wtype(socecon) xtw(6)
///error too many variables specified

Any help would be most welcome.


texts: Reprojecting kml in NAD27, 83 or WGS84 using QGis

texts:
I have downloaded a kml file from Google containing location of shops. The coordinates in that file are in lat/long. I have other shp files containing roads and territories.

I am trying to have all those files in  the same projection and since I need to work with buffers and distances, I figured NAD27 (EPSG: 26718) or WGS84 (EPSG:4326) were good choices (units in meters).

However, using QGis, I have tried to reproject the kml file with no success. Even though I can see that they have the same CSR in the metadatas, the kml file do not overlap with the other two shp files.
For example, with NAD27 Zone 18 N set as the CSR, the kml file coordinates range from xMin,yMin 362234.57,45.4667 : xMax,yMax 362234.77,45.5717 while the shp file range from xMin,yMin 3271320.50,5039271.30 : xMax,yMax 305262.50,5064239.70.

Sooo would anyone give me a much needed helping hand?


texts: How to snap already digitized polygons in different layers using QGIS?

texts:
As a newbie, I have digitized a lot of polygons without snapping them.

Is there any way that I can add snapping to them aftervards? They are in different layers?


texts: Points layer distance from the start of line layer in QGIS

texts:
I tried to find out and read multiple similar questions but not able to get answer to my question.
I have two layers; points (various location data) and lines (roads). My aim is to calculate all points distance from the start of the road layer and populate this in points layer attribute (snapshot attached). Points are little away from the road line. I checked LRS but I did not find there. I am using QGIS 2.18.


texts: Installing Open Modeller plug-in for QGIS 1.7.4?

texts:
How do I install the plug-in of Open Modeller in QGIS 1.7.4?

It is not in the list of plug-in in the spanish version of QGIS.


texts: Where can I find the source code of the "QGIS Python Plugins Repository"?

texts:
Along the lines of this (unanswered) question, where can I find the source code of the QGIS Python Plugins Repository website - or the source code of the software driving this infrastructure?

The QGIS website itself is a static website. The QGIS Web Client 2 also does not appear to be what I am looking for - please correct me if I am wrong. I am basically looking for the QGIS counterpart to Warehouse.


texts: Save Multiple Selection from Attribute Table

texts:
I am working with a shapefile that has all the address points for a municipality - it has over 500,000 features.  I would like to search the attribute table for specific addresses and save those somehow so I can sort and only show the ones I want - likely around 1000.

After searching for one property I can move it to the top of the list, but when I search for the next and move it to the top, it replaces my first result.  How can I flag or select a series of search results and then only save those in my attribute table?

P.S. I am using QGIS v. 2.4

Thanks!


texts:
I have problem with importing "osgeo" module in Ubuntu 10.04; I have installed GDAL 1.7 from source ( 1)./configure 2)make) however, still in Python I can't import osgeo module. I appreciate any hints.

Basically, I am trying to make the converter script of jvectormap script into work and osgeo module is a prerequisite module.

update 1 ./configure --with-python gives me the following

GDAL is now configured for i686-pc-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -g -O2
  C++ compiler:              g++ -g -O2

  LIBTOOL support:           yes

  LIBZ support:              external
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  NetCDF support:            yes
  LIBPNG support:            external
  LIBTIFF support:           external (BigTIFF=no)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           external
  8/12 bit JPEG TIFF:        no
  LIBGIF support:            external
  OGDI support:              no
  HDF4 support:              yes
  HDF5 support:              yes
  Kakadu support:            no
  JasPer support:            yes (GeoJP2=yes)
  ECW support:               no
  MrSID support:             no
  MSG support:               no
  GRIB support:              yes
  EPSILON support:           no
  cURL support (wms/wcs/...):yes
  PostgreSQL support:        yes
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          yes
  NAS support:               no
  Expat support:             yes
  ODBC support:              yes
  PGeo support:              yes
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  DODS support:              no
  SQLite support:            yes
  SpatiaLite support:        no
  DWGdirect support          no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  VFK support:               yes

  SWIG Bindings:          python

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    no
  hide internal symbols:     no

update 2

after importing gdal, I am getting the following complains:

>>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or directory

I tried to see where the package is install :

$ /sbin/ldconfig -p | grep gdal
    libgdal1.7.0.so.1 (libc6) => /usr/lib/libgdal1.7.0.so.1
    libgdal1.6.0.so.1 (libc6) => /usr/lib/libgdal1.6.0.so.1
    libgdal1.6.0.so (libc6) => /usr/lib/libgdal1.6.0.so


texts: Capitalizing The First Letter Of Each Word In Attribute Field

texts:
Does anyone know of a way to capitalize the first letter of each word in a field in an attribute table?  I am doing this in QGIS.  I know of field calculations to change all the words to Lower or Upper, but I would like to be able to have the first letter Capitalized of each word, and the remaining letters lower cased.  I know how to do this manually, but I am looking for an automated way.  Similar to the Proper command in Excel.

Thanks...


texts:
i have one file, with 32000 record ,its polygons for city ,when i want to merge some polygons for get one rooftop polygon from many polygons  ,this new polygon remove or it's have unwanted lines between the old polygons ,
how i can to merge polygons for get aggregate polygon ?
i need edit by hand not tools ,

thanks ;


texts: MODIS getHdf : Error in .local(product, ...) : Problems with online connections try a little later

texts:
I have a big problem today, i have this error while i'm executing my script :

Error in .local(product, ...) :    Problems with online connections try a little later

My script :

b1 <- getHdf(product = "MOD09GA", begin = "2018.03.01", end = "2018.03.02", tileH = 22, tileV = 02)

It worked well on sunday but today i get this error. I changed nothing in my environment.

Does someone has the same error for today ?

Or is it my environment fault ?

I tried others products but I have got an other error (for MOD11C3) :

Error in if (FtpDayDirs[1] == FALSE) { : valeur manquante là où TRUE / FALSE est requis

It is in french, but it tells me that there is a missing value where TRUE or FALSE is required. Maybe this product is deprecated for these days.


texts: Calling function for minimum zoom in OpenLayers 3

texts:
I'm developing a project in which OSM (OpenStreetMap) is default base map. There is one satellite image which is loaded after selecting it from layer list. I have assigned minzoom and maxzoom. Now I want when layer reach to minzoom that time satellite image will disappear and OSM layer appears as background layer. I have to call a function for this.

function zoomlevel()
    {
        if(maxZoom==18)
        {
            base_layer_definition_array.push(new ol.layer.Tile({
                  title: 'Satellite Image',
                group: "background",
                visible: false,
                crossOrigin: 'anonymous',
                source: new ol.source.XYZ({
                    urls:[
                        'http://localhost/tileserver/sate.png'
                    ],
                    minZoom: 0,
                    maxZoom: 21,
                    tilePixelRatio: 1
                })
            }));
        }
    }


texts: Creating UI download button in Google Earth Engine APP

texts:
I want to create a button that download images without clicking the RUN button on the task tab. I want to do this for a GEE App, where is no possible for the user to go to the task tab and click Run.
Is this possible?
See my button so far:
function downloadImg() {
  // Get start and end dates from button selections
  var startDate = startYear.getValue() + "-" + month[startMonth.getValue()][0];
  var endDate = endYear.getValue() + "-" + month[endMonth.getValue()][0];
  // Filter the collection by dates selected.
  var filterCollection = wetlands.filterDate(startDate, endDate)
                        .filterBounds(getSelectedFeatures());
  // Create mosaic
  var mosaicImage = filterCollection.max().clip(getSelectedFeatures());

  // Export the image to Drive.
  Export.image.toDrive({
  image: mosaicImage.toByte(),
  description: 'Wetland_Mosaic',
  scale: 1.8,
  region: getSelectedFeatures(),
  maxPixels: 1e13,
  fileFormat: 'GeoTIFF'
  });
}

// Download button
var downloadButton = ui.Button({
  label: 'Download', style: {padding:'0px 0px 0px 10px'}
})
downloadButton.onClick(downloadImg)


texts: Filter QGIS layout legend item style by expression for min, max, median values

texts:
Summary:
In the [print] Layout Composer in QGIS 3.18.1 I am trying to filter the legend styles displayed for an item that is a polygon layer styled by the "categorised renderer" by the min, max and median values displayed within the current view of the linked map in the layout.
What I have:
Generated from the "categorised renderer" there is a different shade of purple for each season since ~1950 for each polygon in the layer.
When I use the "only show items inside linked map" checkbox in the legend there is now a subset of the ~70 years coloured purples since 1950 that are within/intersect the linked layout map.
However there are still say 20 entries, which makes for an overly large legend.

What I want:
I want to just show in the legend the min, max and median year entries as a subset of those within the linked map (not the entire layer) so that the result is just 3 lines in the legend (or 3 shades of purple labelled with the oldest, most recent and middle of the subset season).

What I've tried:
I know how to use the "Filter Expression" button (bottom right of the Legend Items list) to filter for some expressions, but not for the one desired and described above.
For example I can use right("SEASON" ,1) IN ('0','2','4','6','8') to only return entries that end in those numbers, and it works.
I can also see that if I use minimum("SEASON") the "Preview" returns the oldest record in the dataset, but because the oldest record is not within my current linked layout map, nothing is shown in the legend.
I suspect I need an expression that applies something like minimum("SEASON") to just those polygons that intersect my linked map, so I can use something like: "SEASON" = minimum("SEASON") OR "SEASON" = maximum("SEASON") OR "SEASON" = median("SEASON")
Is this the case, is it possible, what is the correct expression, or is there another or better way I should do this?


texts: Cannot import Grass in Console of Qgis (1.9.0 Master)

texts:
I can't import Grass in Console of Qgis (1.9.0 Master). I am guessing it is because of some Grass environment variables which are not set up correctly. However I don't understand why it is working when I start my script directly from the script editor (new feature in QGIS 1.9 it seems). How come environment variables could be set up differently for the console and for the editor?

Thanks in advance for any explanation and help with this. I would like my script start from the console (with command execfile)

  import grass.script as grass

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:/Program Files (x86)/QGIS Weekly/apps/qgis-dev/./python\qgis\utils.py", line 453, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named script


texts: QGIS 1.8 fails to add vector data layer from directory

texts:
I 'm running QGIS 1.8 on Windows 7 and trying to add vector data from an ESRI gdb directory. It worked before on another machine, after following the instructions on this thread:

File Geodatabase (*.gdb) support in QGIS?

I followed the same instructions again and while I receive a 'select vector layers to add' window showing the list of layers, after the selection the application crashes. I just take a 'qgis.exe has stopped working' message.

Any ideas?


texts:
I'm setting up a custom tile server using OpenstreetMaps and Mapnik. I've been able to successfully setup the server and serve tiles using it. I'm using the OSM-Bright style right now.

I would like to use the MapBox Streets style or a custom style built on MapBox Studio with this server. I tried uploading the custom style to the server and pointed the XML directive in renderd.conf to the project.xml in my style. I cleared the cache and restarted renderd and apache but the new style does not render. There are no errors or warnings in the log.

Is there something I might be missing or a tutorial somewhere which I can follow to do this?


texts: Listing IDs of polygons within another polygon in the Attribute table

texts:
I have two polygon shapefiles in QGIS.
I would like to have the polygon "ID"s of 'B' listed in the attribute table of 'A' for the case that they overlap.
As a demonstration:

I tried combinations of spatial queries, intersects and spatial joins but I won't find an answer. Spatial join only allows statistical summaries of attributes (sum, average, mean).
I also tried using the model builder but didn't find the right arrangement of tools.


texts: Difference between large Rasterlayer and formal class Raster Layer in R?

texts:
I currently possess two rasters with the EXACT SAME resolution and extent, and yet they show different number of rows when loaded into the global environment in R.

In addition, before these rasters were made a dataframe in R by using the asctodataframe() function in R, they were initially stacked and the PCA was calculated using the rasterPCA() function, and then, I obtained the rasters in the snapshot shown below.

However, the individual rasters were loaded as a large Rasterlayer and a formal class raster layer. What is the difference between the two? And is this difference causing a change in the number of rows when loaded into R.

Snapshot of Individual rasters:

For more info: please see Same extent and resolution of rasters, but different number of cells

library(raster)
library(RStoolbox)

###################################
##Loading the Present day variables and then creating a raster stack, followed by a PCA
##################################

bio3 <- raster("C:\\Users\\rameshv\\4_ForR\\bio3")
bio4 <- raster("C:\\Users\\rameshv\\4_ForR\\bio4")
bio5 <- raster("C:\\Users\\rameshv\\\4_ForR\\bio5")

pres_stack <- stack(bio3, bio4,bio5)

pre_pca <-  rasterPCA(pres_stack, nComp = 2) #Choosing the first two axes

#Note: YOU NEED TO CALL the right element, else it will not writeRaster
writeRaster(pre_pca$map,"C:\\Users\\rameshv\\Downloads\\5_PCAforR\\PC.asc", format="ascii", bylayer=T)

#################################
##Loading the LGM variables and then creating a raster stack, followed by a PCA

lg3 <- raster("C:\\Users\\rameshv\\4_ForR\\cclgmbi3")
lg4 <- raster("C:\\Users\\rameshv\\4_ForR\\cclgmbi4")
lg5 <- raster("C:\\Users\\rameshv\\4_ForR\\cclgmbi5")

lg_stack <- stack(lg3,lg4,lg5)

lg_pca <- rasterPCA(lg_stack, nComp = 2) #Choosing the first two axes

#Note: YOU NEED TO CALL the right element, else it will not writeRaster
writeRaster(lg_pca$map,"C:\\Users\\rameshv\\5_PCAforR\\PC.asc", format="ascii", bylayer=T)

#########Now I have two rasters that are PC1 and PC2 of the variables    chosen and shall run the multivariate code provided by Hamann et al., 2015

library(SDMTools)     # install package to read and write ESRI ASCII grids
library(yaImpute)     # install package for k-nearest neighbour (kNN) search

lg1 <- asc2dataframe("C:\\Users\\rameshv\\5_PCAforR\\PC_1.asc")
lg2 <- asc2dataframe("C:\\Users\\rameshv\\5_PCAforR\\PC_2.asc")
present1  <- asc2dataframe("C:\\Users\\rameshv\\5_PCAforR\\PC_1.asc")
present2  <- asc2dataframe("C:\\Users\\rameshv\\5_PCAforR\\PC_2.asc")

> str(lg1)
 'data.frame':   44352 obs. of  3 variables:
  $ y    : num  2209806 2209806 2209806 2209806 2209806 ...
  $ x    : num  -5265209 -5260209 -5250209 -5245209 -5240209 ...
  $ var.1: num  -260 -252 -214 -198 -187 ...
   - attr(*, "filenames")=List of 2
  ..$      : chr "C:\\Users\\rameshv\\Downloads\\Climate Stability\\Data_LGM_Present\\LGM\\5_PCAforR\\PC_1.asc"
  ..$ names: chr "var.1"

  > str(present1)
   'data.frame':   44340 obs. of  3 variables:
    $ y    : num  2209806 2209806 2209806 2209806 2209806 ...
    $ x    : num  -5265209 -5260209 -5250209 -5245209 -5240209 ...
    $ var.1: num  -38.26 -32.95 -8.26 3.47 9.82 ...
    - attr(*, "filenames")=List of 2
    ..$      : chr "C:\\Users\\rameshv\\Downloads\\Climate Stability\\Data_LGM_Present\\Present\\5_PCAforR\\PC_1.asc"
    ..$ names: chr "var.1"


texts: Color balance and publish large amount of high resolution imagery in geoserver

texts:
I have a large amount of RapidEye images (+300 Gb) that I want to use as a basemap for a online application. So far I've managed to serve them as an ImagePyramid in geoserver following the steps shown in a presentation called "Geoserver on steroids". The problem is that I haven't been able to do a proper color balance so when looking at the entire dataset, the mosaic looks very poor but as I zoom in, it gets better (pictures bellow).

My process is:

Convert all images to 8bits, epsg 4326, cubic interpolation using gdal
Generate a gdal virtual raster with all the images (gdalbuildvrt)
Generate the image pyramid (gdal_retile with compression and geotiff tilling) and publish on geoserver (using histogram stretch in the layer style)

Any tips on how to improve the process and get better color balance?


texts:
The two shapefiles (shp) are not aligning like they should (note the img). The layer and the two shp files have all the same coordinates - NAD_1983_StatePlane_North_Dakota_North_FIPS_3301_Feet

The surface shp came with the defined coordinates so I imported those coords into the post plot which had "undefined" coords. They did not align. I checked the layer coords and they were the same as the surface shp.

I deleted the coords from the post plot shp file which originally had "undefined coords" and started from square one with the post plot shp coords. I re-imported the coords and I get the same results. I used ArcCatalog to put in the coordinates. I have Arcview 9.3

What am I missing or not doing?  I've always been able to fix this issue except on this occasion.


texts: Removing non-alphanumeric characters from string in MapBasic?

texts:
I have a user-entered string which I am using as a search term. I would like to display the results in a table named "SearchResults_"+SearchString. However the string could feasibly contain characters that can't be used for table names - spaces would be the most common and there are plenty of other strange characters in place names.

I would like to strip all special, non-alphanumeric characters from a string.

As far as I can see there aren't any built-in functions that would achieve this.

I can loop through the characters easily enough but comparing each one to a white-list is proving harder than I expected. I could do it with a epic if/else statement but that's just dirty! VB.net has IsLetterOrDigit() which would be nice. PHP has ctype_alnum(). In Python I'd just check it against a white-list string.

Any ideas?


texts: How to specify bands to process rasters with gdal.Warp in Python?

texts:
I use Python to write scripts based on gdal library.

I want to specify which bands do I need to process with gdal.Warp and I use gdal.WarpOptions() parameter as mentioned in API. But my PyCharm IDE says that there is no such option!

How to specify which band to process using gdal.Warp?

PyCharm's gdal.WarpOptions() pop-up menu:


texts: Combining classified data from QGIS with respective map from Google Earth Engine

texts: I imported from GEE into QGIS a Sentinel 2 map, I used QGIS to classify it in a new layer, I then extracted he classification layer as a .tif file. How do I combine the classified data with the map from GEE so that I can train it in ML model using Python?


texts:
I m using ArcGIS 10.4.1 and Network Analyst extension, in the network dataset properties-> Attributes. I created an attribute called PromoteStops1, next in Script Evaluators, I used the following script to force VRP solver to travel entire streets segments. (The basic idea is that if a street has deliveries you it better not to leave that street until there are no more deliveries). The deliveries have service time so this script works as follows;

restricted = False
a = Turn.Angle
If a >= 45 Then
    If fromEdge.AttributeValueByName("ServiceTim")= 0.5 And toEdge.AttributeValueByName("ServiceTim") = 0.5 Then
        restricted = True
    End If
End If

(ServiceTim is the field name in road's shapefile attributes table).

When I try to solve the VRP I get the following message;

Error: The evaluator failed to return a value. [Attribute: PromoteStops1,

Source: FT_Attica_Roads_Final_Clip1_Spa, OID = 4002, EID = 3406]

Error: Network element evaluator error. [Script Control Error -2147352319]

Is there anything wrong with the variable names?


texts: Can I multiply fractions in map algebra?

texts:
I have a couple of rasters that show % of success in different things. I want to calculate the overall probability of success. The numerical values are integers so they represent the percentage. This means that my calulation should be:

newRaster = (Raster("t35_sealrisk2")/100) * (Raster("t34_res_risk4")/100)

The problem is that this produces only 0 or 1. I have also tried outputting one of the rasters divided by 100 and it is also 0 or 100. It seems that at no stage in the calculation does it handle the numbers as franctions - if I multiply everything by 100 I still only get 0 and 100.

If this a problem with map algebra that it cannot handle fractions, or is it because my inputs are integers it will consider everything as an integer?


texts: How to write a CSV from Python console in QGIS?

texts:
I am trying to write out a CSV file from a vector layer made up of points using the python console in QGIS. I've tried the following command:

QgsVectorFileWriter.writeAsVectorFormat(layer_Map, Folder + "my_shapes.csv", "CP1250", None, "delimitedtext")

but it does not like the delimitedtext parameter (if I use ESRI Shapefile it works fine). I have not been able to determine what other options can be used instead of ESRI Shapefile.

I find the Quantum GIS API documentation to be quite confusing, but I hope I will get used to it soon.

Thanks in advance for any help.


texts: Searching for a feature across multiple shapefiles in QGIS

texts: There an extremely useful search tool in ArcGIS that searches everything in the project - is it possible to do this in QGIS,  i.e. searching the whole project for a feature.


texts: I have two vector layers and I am looking for a tool for spatial distribution of the polygons. polygon 1 is the frame, polygon 2 are objects with different size and distribution. I need an index value for each polygon 1 for statistic calculate neighborhood relationships or spatial distribution of polygon 2. I'm not sure what kind of value it could be, maybe someone have ideas.


texts: ArcGIS Pro Kernel Density takes too long

texts:
I’ve been facing an issue with the Kernel Density tool. I’m trying to make density change maps for different crime types. I'm running ArcGIS Pro version 2.6.3.
I’ve done this in the past without a problem (same computer, same type of data). The Kernel Density tool usually just takes a few seconds to run (even with several hundred or thousand points).
Right now, I’m trying to run the tool on 442 points, and it is taking forever. It finished running after 2 hours and is hung up with the tool reading 100%.
Any idea why the tool is doing this?


texts: Grass tools for watershed determination are not working well in QGIS

texts:
We have been using r.watershed QGIS-Grass tools for several months now without any problem, even with different QGIS versions.

However, recently the tools are getting us results with a bigger pixel size, even when get the old QGIS version and the same input data that before were working well.

Can anyone help us with this issue?


texts: Is there a function in PyQGIS (QGIS 3.10) similar to the ''slice" function in ArcPy?

texts:
I am working on a script that automatically generates heatmaps from point data. I am aware of the heatmap/KDE tool already existing in PyQGIS (I am working in QGIS 3.10). What I want to do after computing the heatmap is to reclassify the data into five different classes like so:

Instead of this:

To do so, a reclassify is required. This is doable with the reclassify tool in QGIS, however, you must insert the reclass values yourself. This is not desirable when creating a 'one size fits all' script, as one would need to generate the min and max values and intervals for each class over and over again. In ArcPy, the slice tool can 'slice' the heatmap into different sections according to for example the 'natural breaks' standard.
Is there a good way to do so in PyQGIS?
Note: The points where the heatmap is created with include values, which should be taken into account when creating the heatmap.
ps. I got it to work with quantiles with the help of numpy. The result looks like this:
import numpy as np
from osgeo import gdal, gdal_array

dataset = gdal.Open("path/to/rasterlayer.sdat")
array = dataset.ReadAsArray()

output = np.zeros_like(array).astype(np.uint8)

percentile_80 = np.percentile(array, 80)
percentile_60 = np.percentile(array, 60)
percentile_40 = np.percentile(array, 40)
percentile_20 = np.percentile(array, 20)
percentile_0 = np.percentile(array, 0)

output = np.where((array > percentile_0), 1, output)
output = np.where((array > percentile_20), 2, output)
output = np.where((array > percentile_40), 3, output)
output = np.where((array > percentile_60), 4, output)
output = np.where((array > percentile_80), 5, output)

outname = ("path/to/rasterlayer_percentiles.tif")
gdal_array.SaveArray(output, outname, "gtiff", prototype=dataset)

Would there be a similar way to do this, but then with natural breaks?


texts: Error When Generating INSERT Statements for Geometry Field SQL Server

texts:
I am populating a column of linestrings from a list of points in sql with which I use to create insert statements to populate an ID and a geometry field in a table.  This creates a temporary dataset using "with as" clauses, resulting in something like this:

CLEAN_WKT

ID  WKT_LINE
1   'LINESTRING(56.750011 -168.150044, 56.833377 -168.083310)'
2   'LINESTRING(54.766722 -165.050055, 54.766788 -165.083311)'
3   'LINESTRING(56.683333 -170.066766, 56.866799 -170.300012)'

   INSERT INTO TEMP(ID, GEOM)
    SELECT ID, geometry::STGeomFromText(WKT_LINE, 0) FROM CLEAN_WKT;

This returns the error:  The label 'LINESTRING(56.75000 in the input well-known text (WKT) is not valid.

I can confirm that the linestring is created correctly, since I am able to print the resulting statement and execute it successfully.

Resulting SQL statement:

geometry::STGeomFromText('LINESTRING(56.750011 -168.150022, 56.833333 -168.083322)',0)

Manually created insert statement from generated SQL (see above).

INSERT INTO TEMP(ID, GEOM)
SELECT '1',geometry::STGeomFromText('LINESTRING(56.750011 -168.150022, 56.833333 -168.083322)', 0);

Anybody know what the problem might be?


texts: Finding number of point features located within a polygon layer using L.esri.query

texts:
I am new to JavaScript and Leaflet, so please bear with me. I am working on a Leaflet map in which I am calling in two separate REST layers, a point layer (heritage trees) and polygon layer (neighborhoods), using L.esri.featureLayer. What I would like to do is add functionality to the neighborhood polygon layer in which a popup is displayed with the number of heritage trees that are located within a given neighborhood when it is clicked by the user. Because I am already using the L.esri plugin, I'm trying to do this using the L.esri.query functionality, but can't figure out how to get it to work. Here is the JavaScript I have so far:

//Define neighborhoods feature layer
var nbohoods = L.esri.featureLayer({
url:'https://www.portlandmaps.com/arcgis/rest/services/Public/COP_OpenData/MapServer/3',
minZoom: 12,
opacity: 20,
onEachFeature: function(layer){
    //define trees as query layer
    var trees = L.esri.query({
        url: 'https://www.portlandmaps.com/arcgis/rest/services/Public/COP_OpenData/MapServer/26',
        }).within(nbohoods);
    }
});

nbohoods.bindPopup(function (layer) {
    return L.Util.template("
Neighborhood Name:  {MAPLABEL}
", layer.feature.properties
                      );
});

I know I'm not referencing the results of the function in the popup at the end (I don't know how) and I'm also not sure how to access the geometry of the nbohoods variable. Any ideas for how I can get this to work?


texts: Line Layer from Point to Point CSV file using QGIS?

texts:
My question is probably a basic QGIS question but I could not find something that would work for me.

I have a file of the following format:

where each from/to is a point that is already inserted to QGIS (point layer)

How do I insert the lines' data from the CSV file to QGIS?


texts: Unable to add any tool to Model - drag and drop only adds the Default Geodatabase - ArcMap 10.7

texts:
I am probably missing something silly, but I cannot add any tool to the my newly created model (or to any old ones) in ArcMap 10.7.

If I try to drag and drop any tool, the default .gdb appears in the model - see pic - and I cannot seem to be able to add anything else but more version of the geodatabase.

I set the .gdb that contains the toolbox and the relevant model as default, and ticked "store relative path names option in the model property and "current workspace" in model properties>environments.

I also noticed that drag and drop for older model produces the same issue (it only copies the current default geodatabase) and the only "workaround" is to copy the tools from other models and paste them in the model of interest to then edit them.

This is the first time I am creating a model from scratch and not just editing it, so I am not sure if and why it was working before.

Steps to create a new model:
1.Open ExploreGasModel.mxd
2.Open catalog window and navigate to the relevant folder
3.Set FtCollins.gdb  as default
4.Right click default geodatabase and create new toolbox
5.Right click new toolbox and create new model
6.In new model>Model properties> Store relative path names ticked
and Model properties>Environments>Workspace> current workspace ticked
7.Save model
8.Open search bar and type buffer
9.Drag and drop buffer (analysis) tool, but instead FtCollins.gdb appears. Dragging different tools will create FtCollins.gdb(2), (3), etc.

Steps on an already existing model:

1.Open work_env.mxd
2.Edit an already existing model from Catalogue window.
3.In model>Model properties> Store relative path names ticked
and Model properties>Environments>Workspace> current workspace ticked
4.Drag and drop "make a new feature layer" in the existing model only adds "Default.gdb" to the model.

Adding the tools from ArcToolbox (and not the tools as from the search tab) works normally. Is this a bug?


texts: Is Modis Daily LST Data the mean of all day's LST or it is on satellite path time?

texts:
I am looking for MODIS LST product which is exactly on the same time that satellite paths from a location, I have searched and found MOD11A1 but It seems that it is mean LST of Day.

Is there any product which is the same time of observing land with satellite?

To be more clear I know that there is a modis product Mod11A1 this product is daily LST product but I don't know if it is LST of exact satellite path time (Lst on 10:30 local time) or it is a mean of all day time?

update

The answer is Yes, The Mod11A1 is exactly the LST data on time of flight and it is not all days mean value.


texts: ArcMap generated "*.sr.lock" files interrupt Append function

texts:
Whenever I try to append several shapefile tables in ArcMap I receive a "read-only" error associated to the recipient file. Several 'sr.lock" files are generated associated to this failure and I cannot find how to eliminate them from the archives. Already tried turning off virus scan but still having the same problem.

Any ideas?

I am using ArcMap 10.2.2 and trying to append 3 assessor's parcel shapefiles (with previously merged data) to one parcel shapefile, also with previously merged data. All merged data and field formats are the same for the four files. There are approx 200,000 observations per shapefile.

The shapefile tables maintain reference to the previously merged data using long field titles on some of the fields.


texts: Splitting/Deleting/Hiding Sections of Map In ArcMap Layout View For Printing?

texts:
I have a map of a large area, in that area, I have parcels.

I want to split the map, basically in half at a certain parcel, but I can't find a way to "Cut" or "Delete" the other half of the map that I don't need, in Layout View, for my final, printed map.

I can clip at the data frame level, but the parcels are a layer within another layer, so it would cut part of that larger container off, and I don't want to to do this.

Clipping all the layers individually would cause me to lose all my symbology.

Is there really no way to choose very specific parts of the map to appear in the layout view for printing other than manipulating the layers (and therefore the data and the symbology) in the data view?


texts: Creating single null value for raster borders

texts:
We receive raster mosaics of aerial imagery from a supplier and the border contains large black areas which commonly have a range of black or near black values.  We've been asked to clean these border areas up so that anything that isn't part of the main image has a null value, not 255 or 254 or 0 or whatever.

Does anyone know of a good tool to do this?  We can crop the images but being able to quickly convert this range of extraneous pixels to null would be good.  This is complicated by the fact that there will be a few null values inside the image, for example in areas of deep shadow, which ideally should display as black.

Any thoughts?


texts: Failed to execute floating raster to integer raster

texts: im facing a problem in converting Floating to Integer Raster by using"spatial analyst tools (arc toolbox) > math > Int" . However, it shows warning of "error ERROR 999998: Unexpected Error. Failed to execute (Int)." * as shown in the attached file * . i've used both raster calculator method and spatial analyst tools in arctoolbox but still failed. how to overcome this problem ?


texts: Automatic pyqgis categorized renderer classification

texts:
I have some layers in my project and I would like to alter their styles, since ranges of values for underlying columns have changed.

Normally it would require to enter each layer style settings separately and trigger "Remove All", and "Classify" button, however I would like to execute it from the code.

I found such method for graduated symbol:

renderer.updateClasses(layer,0,bins)

,however I'm having trouble to find corresponding method for categorized symbol class

Is there any way to do this from pyqgis without the need to specify the layer style from the scratch (create category, label etc.) ?
Some equivalent of "Classify" button from below screenshot:


texts: How can you change the bubbles size on Torque in CartoDB

texts: Is there any way to change the size of the bubbles on Torque (min-max)?


texts: Converting MGRS Coordiantes To DD or UTM gives ERROR 999999?

texts:
I am trying to convert MGRS coordinates to something that I can add into ArcGIS 10.2

I have a DBF file with MGRS coordinates that look like this: 11UNG37756325
They are in a text field and I am trying to use the Convert Coordinate Notation (Data Management) tool to convert them into either DD or UTM so I can use the "Add XY Data" function in ArcGIS.

I set my tool up as such

Input Table: My dbf table

Input Coordinate System: I left to default (GCS_WGS_1984) But also tried with                                                         (WGS_1984_UTM_Zone_11N)

Output Coordinate System: Left to defaut (GCS_WGS_1984) But also tried with (WGS_1984_UTM_Zone_11N)

Input Coordinate Format: MRGS

X Field: My text field with the MRGS coordinate writen as 11UNG37756325

Output Coordinate Format: UTM_ZONES, but I also tried DD_2

When I run, I get unknown error that looks like this

"Messages
Executing: ConvertCoordinateNotation UTM11 I:\Workspaces\James\AlainTasks\140612_EWCCarbonStock\Data\Databases\NSDBFromAl\Testing\UTM11_Convert.shp MGRS MGRS MGRS UTM_ZONES # "PROJCS['WGS_1984_UTM_Zone_11N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision" PROJCS['WGS_1984_UTM_Zone_11N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]
Start Time: Fri Dec 12 09:47:50 2014

ERROR 999999: Error executing function.

cannot convert mgrs to xy coordinate

Failed to execute (ConvertCoordinateNotation).

Failed at Fri Dec 12 09:47:51 2014 (Elapsed Time: 1.17 seconds)"

I don't know if there is a problem in my input format of the MRGS coordinates or if my input or output coordinate systems are inappropriate.


texts: Change ellipsoid reference for altitude in a DEM

texts:
I have DEM data stored as RGF93 (Lambert-93) for lat/lon and NGF-IGN69 for altitude. I'm trying to change the reference ellipsoid for the elevation data (ultimately to NTF, but WGS84 would be fine to understand).
I achieved to reproject the file using QGis or GDAL, but I can't find a way to change the altitude values. Shouldn't gdalwarp do the trick ?

Here's an example of a command I used :

gdalwarp
-s_srs "+proj=lcc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.500000000 +lon_0=3.000000000 +lat_1=44.000000000 +lat_2=49.000000000 +x_0=700000.000 +y_0=6600000.000 +units=m +no_defs"
-t_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 +unit=m"
input.tif output

What did I miss ?


texts: Writing world file when exporting TIFF using ArcPy Mapping?

texts:
According to documentation, the options are:
Syntax

  ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width},
  {df_export_height}, {resolution}, {world_file}, {color_mode},
  {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields:
    Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?


texts: Selecting weights while transferring from shapefile to network

texts:
I have a shapefile representing roads (LineStrings) and I need to transfer it to a networkx type (with the lengths as weights) so I can do some network analysis.

I have used the s2g library to do so and it worked well; but the generated shapegraph has random weights that do not correspond at all with the lengths of the roads (not even the same order of magnitude).
I've never used this library before and did not find an answer in the source doc.

Does anyone know how to choose the weights (or how they are generated) using the s2g transform ?

If you know of any other way to get a networkx (or igraph) network from shapefiles that would be of great help.  tried the read_shp method from networkx but it only links the edges of the lines and I lose the shape of the roads:


texts: Looping through all raster cell values using GDAL via Python?

texts:
I'm trying to identify null/0 values in each of my raster bands. How can I loop through all the values of each band? I've tried this code, straight from the gdal/python cookbook website but this just gives stats for each band as a whole and for some reason it actually doesn't print a minimum value of 0 even though my raster does have 0 values, it shows a minimum value of 1.

I want to print every single cell value. Is there a way to do this?

from osgeo import gdal
import sys

src_ds = gdal.Open( "INPUT.tif" )

print "[ RASTER BAND COUNT ]: ", src_ds.RasterCount
for band in range( src_ds.RasterCount ):
    band += 1
    print "[ GETTING BAND ]: ", band
    srcband = src_ds.GetRasterBand(band)

    stats = srcband.GetStatistics( True, True )

    print "[ STATS ] =  Minimum=%.3f, Maximum=%.3f, Mean=%.3f, StdDev=%.3f" % ( \
            stats[0], stats[1], stats[2], stats[3] )


texts:
I just read the problems similar to mine on this forum, but no solution helped me.

To put it simply, I use ST_Touches in an algo in PHP that allows me to test if two points touch.
Here is the query:

SELECT *
FROM t_node1, t_node2
WHERE st_touches (t_node1.geom, t_node2.geom)

The problem is that there is a tolerance and therefore my results are not accurate.

Is there a way to remove this tolerance?


texts: Seeking list of Geoprocessing tools that take advantage of 64 bits?

texts:
I am looking for a list of ArcPy tools that will actually utilize 64 bit structure.

I know some of the tools will just run a 32 bit version inside a 64 bit program.

I could have sworn I have seen the list before but I can't find it anywhere.

No matter what 64 bit is the way to go.

I am not looking to build a list of tools here as answers.


texts: How to build custom CRS to export QGIS to Google Fusion Table

texts:
I want to export my layer from QGIS as a CSV to import it into google fusion tables.  The problem is the qgis export for the geography column is in the wrong format for what google wants.

QGIS exports the column like this:

POLYGON ((-89.286886718442915 43.036071759682343 0,-89.286884882780711 43.03590714097303 0  [...etc...]  ))

But the format Google Fusion Table wants is:

<Polygon><outerBoundaryIs><LinearRing><coordinates>-89.29512225140348,43.03848368749686,0 -89.29421212623849,43.03849391491957,0 [...etc.]   </coordinates></LinearRing></outerBoundaryIs></Polygon>

Is there a way to build a custom CRS to export the data in that format?
Alternatively, maybe I need some REGEX to swap out the beginning/ending text and also replace the "," and " " for each line?

Not sure what the best way forward is.


texts: Loading a layer into the same position as an existing layer in QGIS

texts:
I understand that it is not possible to directly reload a shapefile layer in QGIS using the reload method in Python, since this method is not implemented for shapefile data providers. Thus, the workaround is to unload the layer and then reload the layer.

However, if one does this naively, the new layer will show up at the top of the map legend, rather than at the position that the original layer occupied. Is there a straightforward way to save the position of the old layer and then reload a new layer at that same position?


texts: QGIS - Parallel Lines - Count length of one

texts:
I have a large layer of lines (telecommunication duct) with in parts several parallel lines that are close to each other (cause they lay in the same trench). I would like to count the length of the trench. But so far I only managed to count the sum of lines in QGIS 3.2

The number of parallel lines varies. So in some parts, there is only one line, in others 2 up to 8 parallel lines (duct in one trench).

My following example is a section with 4 parallel lines.

Example (simplified): 500 meter trench but over 200 meter lay 4 parallel duct (lines) - so I get 200 meter * 4 = 800 + 300 meter = 1.100 meter instead of 500

What have I tried so far

Buffer the lines and then: Vector -> Join attributes by location

    Result: I got a Polygon but instead of counting 4 intersections it showed 7 or 8 -> I assume that cause the buffered lines overlap each other

Snap the geometries in a layer

    Result: I chose a small tolerance and the 4 lines are perfectly aligned (they overlap perfectly). But when I sum up the length (with GroupStats) the length is 4 times the length (it counts every line)

I also tried to join the overlapping lines with Merge lines

    Result: Error, it seems that qgis doesn't want to merge snapped lines


texts: Select all points within a a geojson polygon from Mysql


texts: OSRM foot / walking profile avoiding trunk roads

texts:
I have setup OSRM backend and frontend using profiles/foot.lua aka walking profile. The routing works well untill a trunk road (OSM tag: highway=trunk) comes along or between the origin and destination points. When that happens, I get this:

When giving walking directions, OSRM seems to be avoiding trunk roads like the plague. Now it may be the case in some countries that pedestrians aren't allowed on trunk roads, but I can assure you it's not the case for the places that I want to cover. How does one convince one's local OSRM instance that trunk roads are ok for pedestrians?
FYI: I've built OSRM from source following their github wiki pages. No docker.


texts: I get the concept of what a WFS is supposed to accomplish and how it does it however I can't seem to find any clear insight into how it handles feature metadata. GeoJSON has a properties attribute for any extra data you want to include with the feature is there something similar with WFS?


texts: How to convert these mapping coordinates

texts:
I have an older database at work and I've been asked to map the
recorded GPS coordinates for each record.  Unfortunately, I can't
figure out the map coordinates that were recorded.

As an example, 1301 Calle Oriente in Milpitas California shows as:

06158991  and 01987998

If I look at google maps, 1301 Calle Oriente is 37.446687, -121.886884

Is there a website that I convert 06158991 and 01987998 to a map like
google maps?  Is this a valid mapping coordinate format?  If so,
please let me know what format this is.


texts: LiDAR data should be classified according to the source/vendor (ELVIS Australian source) but it is not when put into ArcGIS Pro

texts:
ELVIS states the following for areas with point clouds available:

The C0 LAS data set contains point data in LAS 1.2 format sourced from
a Leica-Geosystems Airborne Digital Sensor(ADS). The processed data
has been manually edited to achieve ICSM standard level 3 whereby the
ground class contains minimal non-ground points such as vegetation,
water, bridges, temporary features, jetties etc. This data has a
vertical accuracy of (+/-) 0.9 metre on bare open ground (95%
Confidence Interval 1.96xRMSE) and horizontal accuracy of (+/-)1.25
metre (95% Confidence Interval 1.96xRMSE) on bare open ground. For
more information on the data accuracy, refer to the lineage provided
in the data history

However, when I import the LAS files into ArcGIS Pro all points are in the unassigned category, all points are marked as the 1st return and no flags are assigned but intensity values seem to be present. For my needs I only require classification of ground and non ground points which 'should' be there. Unfortunately the data contains a significant amount of negative blunders (underground points) meaning the automated classification tools such as 'classify ground' (I believe this tool heavily favours minimum elevation points) results in hillshades that have a less than optimal appearance in areas where vegetation was (image below. Bottom half is where vegetation was and top part is cleared land).
I have tried MCC-lidar but found another post saying it has trouble with 'underground points.' I have used all interpolation methods in ArcGIS Pro (spline, kriging, IDW...etc) to try and deal with this but the results don't work at the resolution I need (average point spacing is about 0.432 so a 1.5 or 2 m resolution should be achievable.)
Any suggestions either for getting the classification to show up or classifying it manually?


texts: Carto.js - Change infowindow field on click event

texts:
How can I get fields in an infowindow to change when I click on something?

For example, if this is my infowindow code:
cartodb.vis.Vis.addInfowindow(map, layer.getSubLayer(0), ['abbrev'])
How can I change the column abbrev to cartodb_id when I click on a button, and have the new field appear in the infowindow when clicking on a map feature. I think it should be easy, but so far I haven't found a way to do this successfully.

Here's a jsfiddle I'm experimenting with:

https://jsfiddle.net/Sidders/cb40w5ku/9/


texts: Drawing arbitrary shapes on a layer using Geoserver for WMS

texts:
We are using Geoserver 2.8.1 with Leaflet to do some basic map manipulation on the client-side. One requirement is the ability to render an image based off of the map to be used in other places (say dump into a spreadsheet). So far, this hasn't been an issue since we use the WMS GetMap service to request a png using the appropriate parameters to re-create an image of what the user sees on the leaflet map.

My issue comes when drawing a circle to represent data that is present inside a particular radius. Using leaflet, this is not a problem. My problem comes when attempting to draw this circle using Geoserver. Say I have a layer named US_Layer. Is it possible for me to somehow draw shapes on the fly on top of this layer using Geoserver? If I have the GeoJSON info for this circle, is there a way for me to pass this information to Geoserver so that it can then place it on a given layer for it to be rendered using the WMS GetMap service?


texts: How should I organize multiple X and Y coordinates in my data file?

texts:
I want to keep an Excel sheet containing flight records. Then I want to use QGIS to plot the coordinates. I would like to keep all data for each flight on one line. Is this possible?
When I add a CSV layer it will only allow me to plot X and Y coordinates. Which in the case of my data is my origin airport. It will not plot the destination coordinates unless I put that data on a separate row using the same X and Y plots. What is the best way for me to organize my data?


texts: Batch arcpy.CopyRaster after arcpy.ASCIItoRaster

texts:
I'm new to arcpy and am having trouble running CopyRaster. Do I need a separate for loop for this process like I have below?

import os,arcpy, glob

filepath = r"C:\VMshared\small_example_valley2\snowdepthtest"

outFolder = r"C:\VMshared\small_example_valley2\snowdepthout"

ascList = glob.glob(filepath + "/*.asc")

print ascList

rasterpath = r"C:\VMshared\small_example_valley2\snowdepthout"

LastOutFolder = r"C:\VMshared\small_example_valley2\snowrast"

rasterList = glob.glob(rasterpath + "/*.tif")
print rasterList

for ascFile in ascList:

    outRaster = outFolder + "/" + os.path.split(ascFile)[1][:-3] + "tif"
    print outRaster

    arcpy.ASCIIToRaster_conversion(ascFile, outRaster, "FLOAT")

for rasterFile in rasterList:

    LastOutRaster = LastOutFolder + "/" + os.path.split(rasterFile)[1][:-3] + "tif"
    arcpy.CopyRaster_management(r"C:\VMshared\small_example_valley2\snowdepthout",r"C:\VMshared\small_example_valley2\snowrast","DEFAULTS","","","NONE","NONE","16_BIT_UNSIGNED")

Edit:

After modifying the script, I get the following error:

  ERROR 000876: Output raster:
  C:\VMshared\small_example_valley2\snowdepthtest\snowdepthN0001.asc's
  extension is invalid for the output raster format.

import os,arcpy, glob

filepath = r"C:\VMshared\small_example_valley2\snowdepthtest"
outFolder = r"C:\VMshared\small_example_valley2\snowdepthout"
ascList = glob.glob(filepath + "/*.asc")

rasterpath = r"C:\VMshared\small_example_valley2\snowdepthout"

OutFolderTwo = r"C:\VMshared\small_example_valley2\snowrast"

rasterList = glob.glob(rasterpath + "/*.asc")
print rasterList

for ascFile in ascList:
    outRaster = os.path.join(outFolder, ascFile)
    arcpy.ASCIIToRaster_conversion(ascFile, outRaster, "FLOAT")

rasterList = glob.glob(outFolder + "/*.tif")

for rasterFile in rasterList:

    OutRasterTwo = os.path.join(OutFolderTwo, rasterFile)
    arcpy.CopyRaster_management(rasterFile, OutRasterTwo, "DEFAULTS","","","NONE","NONE","16_BIT_UNSIGNED")


texts: Creating a program for batch snapping polylines and polygons

texts:
I currently work with large sums of lines data. I am editing them using different GIS software. I've realized that I can detect node problems in arcmap10.1.

I would like to know if it's possible to programmatically snap the detected dangling nodes and other issues. I have Microsoft Visual Studio 2010 (C#) installed with ArcObjects, but I am struggling with the code to develop such a stand-alone program.

This would make my work so much easier in the future as I have to manually snap these detected dangling nodes.


texts: Leaflet Marker Cluster and Labels white hallow

texts:
As you can see on my map. I have Clustered Markers and Individuals markers with some kind of white hallow around that I want to remove.

This is my CSS file for the style

.marker-cluster {
    background-clip: padding-box;
    border-radius: 1px;
    }
.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;

    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
    }
.marker-cluster span {
    line-height: 30px;
    }

How do I revove this hallow?


texts: How do I get Table from Vector layers for use with joinattributestable

texts:
I am attempting to run:

processing.runandload('qgis:joinattributestable', layer1, layer2, 'id', 'id', None)

To join my tables and output to a temporary viewing layer.

layer1 and layer2 are both Spatialite imports. They are vector type objects within QGIS.

joinattributestable specifies the following inputs:

ALGORITHM: Join attributes table
    INPUT_LAYER <ParameterVector>
    INPUT_LAYER_2 <ParameterTable>
    TABLE_FIELD <parameters from INPUT_LAYER>
    TABLE_FIELD_2 <parameters from INPUT_LAYER_2>
    OUTPUT_LAYER <OutputVector>

How can I get ParameterTable from my Vector object?


texts: Creating polyline output from overlapping polylines in ArcGIS

texts:
I am trying to create a polyline shapefile from two overlapping polylines that contains only the different line segments between the two original polyline files. The two files are nearly identical except one file contains line segments that the other does not. I want to be able to preserve those differing line segments in a new shapefile.
I have tried merging the two files and then use the desired polyline file as a clipping mask but it has not produced the desired results. Clipping seems to remove the desired data rather than preserve it.
The above picture shows brown polylines that are desired. The brown polylines also include line segments that lie directly beneath the black polylines. Essentially I want a shapefile of the difference between these two polyline files.
Any ideas?


texts: Where can I find historic maps of city size?

texts:
I'm interested in examining basic dimensions of city size, primarily area (though population would also be of interest) from the earliest possible records. It does not matter where the city is in the world - though ideally there would be several measures through time.

I realize that the much of this will not be digitized which is ok; I'm just looking for any sources.


texts: ArcObjects 9.2 SDK: How to intersect two SelectionSets (in-memory pointers) and return a FeatureClass?

texts:
[Update]

Since posting this question, I've come to the conclusion I'm not fighting flaws in the BasicGeoprocessor object, but more likely having issues with poor object lifecycle management on my part (there is some helpful info cited by @blah238 in this thread).

I accepted @Jakub's answer to close the question so it won't appear in the unanswered questions list perpetually. However, at present I believe there's nothing wrong with my BasicGeoprocessor implementation, and the issue is related to hanging references elsewhere in my code.

[Edited]

I maintain a small ArcObjects solution using the 9.2 SDK that is plagued by inconsistent failures in its BasicGeoprocessor.Intersect() implementation. It  seems to be failing more frequently than it succeeds. While it succeeds on every first run, it tends to fail on subsequent attempts. Although, sometimes it still works on the second run, so it's been difficult to truly isolate the cause of errors.

 I'd certainly rather use this approach and apply the Geoprocessor, but it can only do wholesale intersections at the shapefile level, and I only want to intersect two in-memory SelectionSet objects. Could the ITopologicalOperator do this? In the past I've been unable to make it work on real-world data, and it seems some others have too.

Here's the relevant block of code calling the BasicGeoprocessor. It's argument variables are explained in the comments, and if you follow the link above, you can see the example it's patterned after. I suspect my references to either parcelTable, soilTable, and/or parcelFCursor may be lingering between calls, creating the errors.

'perform intersection
Dim BGP As IBasicGeoprocessor
BGP = New BasicGeoprocessor
BGP.SpatialReference = parcelFeature.Shape.SpatialReference

Try
    'THE VARS ARE AS FOLLOWS. THEY ALWAYS LOOK GOOD IN THE DEBUGGER:
    ' parcelTable and soilTable are ITable
    ' True (useSelectedInput argument)
    ' True (useSelectedOverlay argument)
    ' 0.0# (the mythical Tolerance value, I've also tried 0.0, and 0)
    ' pFCN (IFeatureClassName)

    intersectFC = BGP.Intersect(parcelTable, True, soilTable, True, 0.0#, pFCN)

Catch ex As Exception

    MsgBox("unable to intersect input data")
    Exit Sub

End Try

'(blah238's answer, first link above, suggests this is **NOT** the way to do this)
'Clean up. This chunk shows all the variables preceding the Try block, too.
parcelLayer    = Nothing 'IFeatureLayer
parcelFC       = Nothing 'IFeatureClass
parcelFeatSel  = Nothing 'IFeatureSelection
parcelSelSet   = Nothing 'ISelectionSet
parcelFCursor  = Nothing 'IFeatureCursor
parcelFeature  = Nothing 'IFeature
parcelTable    = Nothing 'ITable          <--- I think this one is the culpret.
parcelSF       = Nothing 'ISpatialFilter
soilLayer      = Nothing 'FeatureLayer
soilFC         = Nothing 'IFeatureClass
soilSelSet     = Nothing 'ISelectionSet
soilTable      = Nothing 'ITable          <--- and or this one.
pWSN           = Nothing 'IWorkSpaceName
pFCN           = Nothing 'IFeatureClassName
pDSN           = Nothing 'IDataSetName
intersectFC    = Nothing 'IFeatureClass
BGP            = Nothing 'IBasicGeoprocessor

I'd love to know what other folks are doing to perform in-memory intersection on SelectionSet objects or if anything stands out as obviously wrong here. As always, thanks so much for any assistance and insights you have.


texts:
I have a df with spatial points that I've converted into a spatial object (dai18) and I want to select only the points that are inside a polygon (peri_A).

I think my coordinate system is incorrect, because it gives me only NA when I apply this command:

points_withinA <- over(dai18 , peri_A, fn = NULL)

These are the ways in which I've pre-treated the data:

dai18<-SpatialPointsDataFrame(dai18[,c("latitud","longitud")], data=dai18,
                                  proj4string = CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))

peri_A <- readOGR("./centroH/Perimetro_A_region.shp", layer = ogrListLayers("./centroH/Perimetro_A_region.shp"))
peri_A<-spTransform(peri_A, "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")


texts: Selecting Graphic Symbol On Click Android

texts:
I'm using the arcGIS Android API with Android Studio, and I would like to know how to select a graphic symbol when a user taps on it. I have a graphics layer and I've added a couple picture marker symbols to it. I simply want to show a symbol as being selected when a user taps on it.

Creating the graphics:

graphicAirport_IAD = new Graphic(projIAD, pmsAirport);
graphicAirport_DCA = new Graphic(projDCA, pmsAirport);
graphicAirport_BWI = new Graphic(projBWI, pmsAirport);

Adding the graphics to map view:

mMapView.addLayer(gAirport);
gAirport.addGraphic(graphicAirport_IAD);
gAirport.addGraphic(graphicAirport_DCA);
gAirport.addGraphic(graphicAirport_BWI);

The graphics all show up fine. Again, I would just like to be able to select them when they're tapped on (respectively) by a user.


texts: Results are not showing after installing

texts:
I have installed the Nominatim on openSUSE

i got the 2.3 version

wget http://www.nominatim.org/release/Nominatim-2.3.0.tar.bz2

and i have build the source as below

cd Nominatim
 ./configure
 make

and i want to test so not downloaded all the wiki and UK codes
just started with india pbf file

by importing

./utils/setup.php --osm-file india.pbf --all 2>&1 | tee setup.log

and i setup the website

./utils/setup.php --create-website /var/www/nominatim

restarted apache server

everything is fine till here, while testing when i request

http://nominatim.mydomain.com/search.php?q=Bangalore&format=xml&polygon=1&addressdetails=1

no results is showing.

i am not able to find the log.

even enabled log in setting.php as below

@define('CONST_Debug', true);
@define('CONST_Log_DB', true);
@define('CONST_Log_File', true);
@define('CONST_Log_File_SearchLog', '/var/log/nominatim-search.log');
@define('CONST_Log_File_ReverseLog', '/var/log/nominatim-reverse.log');

Help me where i can find what is going wrong


texts: CartoDB.js/Leaflet map - how can I click between multipolygons cleanly?

texts:
Here's my map:
https://jsfiddle.net/Sidders/4exf969e/3/

I want to apply a click and hover effect to the polygons. So a polygon/multipolygon highlights on hover, and is selected with one click. The hover effect resets on 'mouseOut', and the select effect resets when another polygon/multipolygon is selected.

However, when I click between multipolygons (e.g. see the islands around Scotland) they don't fully 'reset' and some polygons stay highlighted. It becomes a mess, and I think it's because e.layer does not work with multipolygons.

How do I amend my code so I can cleanly select and click between multipolygons on my map?


texts: QGIS automated export to image of multiple layersets

texts:
I have one project that contains layers in QGIS.
Every layer is a quarterly update of my fairway showing the fairwayprofile and aids-to-navigation of the whole of my administration area.

My current workflow.

Choose area of interest.
make sure every layer has the same symbology
selecting the first layer (say 2008-Q4)
exporting it as a image on 300dpi JPEG
selecting the next layer, export and repeat until all layers are exported
make video to show the movement of my fairwayprofile.

example video: (still bit rough, work in progress)
https://vimeo.com/344980749

This is "do-able" cause on this detail I only have an update every quarter. But in high-detail I have hundreds of layers that i want to use for making a similar video. Is there a way to automate the process or does anybody have knowledge of a plugin?

(automate process: selecting layer, exporting layer, selecting layer, exporting layer, etc)


texts: Assign predefined legend style to raster layer via qml in QGIS

texts:
I work with rasterized extracts of CORINE data (V 18.5 gdb) in QGis. My layers however are not depicted in the colours that are standard for CORINE, but in different shades of red. From EEA i downloaded the correct colour map for QGis as qml.

http://www.eea.europa.eu/data-and-maps/data/corine-land-cover-2006-raster#tab-additional-information

I tried to add it via properties/style/style/load style and nothing happened. Then I used the MultiQml plugin, now the whole map appears white. However, when i click on the map with identifier the correct numbers are shown and in the style properties the correct legend is displayed. I remember that I had a similar problem with styles in QGis some time ago, but dont remember how i solved it. I checked the original corine data raster data to compare the style and registered that CORINE rasters have only one band, while mine have 3. Might this be the source of the problem?


texts: Ordering Cartodb torque visualization over Google Maps heatmap layer

texts:
I am attempting to create a map with two layers: a CartoDB Torque visualization on top and a Google heatmap layer underneath.  So far I have only been able to get them to draw in the opposite order I'm going for.  I have tried calling a setTimeout on cartodb.createLayer and reordering when the layers are created.  Can this ordering be done via either the Google Maps API or CartoDB?  Below is the relevant code.

heatmapData = [lots of new google.maps.LatLng()]

var heatmap = new google.maps.visualization.HeatmapLayer({
    data: heatmapData,
    opacity: 0.5,
    gradient: g,
    radius: 12
    });

heatmap.setMap(map);

cartodb.createLayer(map, 'http://catalina.cartodb.com/api/v2/viz/2ed4ec6e-5f84-11e4-ab03-0e853d047bba/viz.json')
    .addTo(map, 0)
    .on('done', function(layer) {
        //do nothing
    })
    .on('error', function(err) {
        alert("some error occurred: " + err);
    });

Full code available on http://catalinagis.org/bison2


texts: How can I interact with ArcObjects from a windows service?  It appears that I can't work with an AxMapControl object from a console or service, because it complains about the activeX state.  How does one interact with ArcObjects from a service?


texts: Algorithm to convert DN values to Radiance

texts:
Which algorithm should I use to convert DN(Digital Number) values to radiance. There are many different algorithm that I found, there are 3 for now (based on youtube, article, usgs website).
My aim is to extract LST from Band 10 of Landsat 8 OLI/TIRS.
Below are the list of formula that I found:

This are the results of min max value for each algorithm:


texts: Distortion in NetCDF served to Leaflet with Geoserver

texts:
I'm attempting to serve netCDFs to a Leaflet map using Geoserver (2.12.1) and its NetCDF extension. I can set up the layers and get Leaflet to receive tiles over WCS 1.0.0 without a problem, but the tiles appear to distort as I scroll the map westward:

One possible reason is that, as in this question, these NetCDFs use longitude 0:+360, rather than -180:+180. (EDIT: I've confirmed that the distortion only occurs when tiles with X < 0 are requested.) I've tried a few solutions to preprocess the files to -180:+180, but they don't appear to change the output to Leaflet, even if I can verify the changed longitude in something like ncview.

Can anyone help me figure out what the problem is here (whether it's the longitude or something else)? Ideally, I'd like Geoserver to process the files as they are, as they're CF-compliant and I'd prefer to put less preprocessing on the folks who'll be giving me these files in the future if possible. Is there a version of EPSG:4326 that can handle this shifted longitude, or is there an option in Geoserver that can handle it? or is the problem something else entirely?


texts:
I want to run standalone python script in Docker with QGIS and Ubuntu Xenial and there is problem with GUI.

When QgsApplication is qgs = QgsApplication([],True, None) the error is cannot connect to x server. If I set QgsApplication to False qgs = QgsApplication([],False, None),the error is QPixmap: Cannot create a QPixmap when no GUI is being used.

This is my initialization of the script

#!/usr/bin/env python
#import libraries
import sys, os
import qgis
from qgis.core import *
from PyQt4.QtCore import QFileInfo

# supply path to qgis install location
QgsApplication.setPrefixPath("/usr", True)

# create a reference to the QgsApplication
qgs = QgsApplication([],True, None) #preco hadze False chybu, ked nechcem vyuzit GUI ?
#app.setPrefixPath("/usr", True)

# load providers
qgs.initQgis()

# import processing and set system path to processing
sys.path.append('/usr/share/qgis/python/plugins')
from processing.core.Processing import Processing
Processing.initialize()
from processing.tools import *

How to initialize script to get it running ? I do not need GUI.


texts: Standardised Spatial Information System Vocabulary

texts:
I've had some musing about this for some time and thought I'd ask the forum.

Are there any resources out there that provide a standard, comprehensive dictionary of acronyms, terms and keywords for the Spatial Industry?

I've seen the Spatial Industry make leaps and bounds into other sectors outside of it's geology/geography roots, and with this terms such as GIS (geographic information system), Coordinate System, I believe are beginning to lose their potency in definition and are more historical terms due to the introduction of spatial technology to an increasing audience of users, developers and enthusiasts.

The most common example I come across, is the term Coordinate System.  Typically used to defined a projected and geographic coordinate system to the uninitiated, it can become confusing or add ambiguity to an answer if the merits or differences between coordinate systems is being discussed.

As a result I prefer to use the term Spatial Reference System and offer the sub categories of projected reference system and geographic reference system.  Essentially, I'd prefer to align myself with a set of agreed terms that can be addressed.  If such a reference exists.


texts: Converting abbreviation street type names to full names using dictionary for Python script tool?

texts:
I have a data table with a column 'STREET_TYPE' which are street types (RD, LN, ST, AVE etc.). I want to make a custom tool in ArcMap's toolbox that will expand these abbreviations to their full names using a dictionary. It needs to be able look up the values while ignoring the case sensitivity from the dictionary. In other words, it shouldn't matter if it's upper case or not. I want the end result to be in title case.

Around the same time I want to clean up the data by stripping any whitespaces. Including stripping the empty fields.

How can I do this?

Here is the best I got so far.

import arcpy

# set parameters
f1 = arcpy.GetParameterAsText(0)
f2 = arcpy.GetParameterAsText(1)

# variables
fc = f1
field = f2

    d = {
    'aly' : 'Alley',
    'ave' : 'Avenue',
    'blv' : 'Boulevard',
    'blvd' : 'Boulevard',
    'cir' : 'Circle',
    'ct' : 'Court',
    'cv' : 'Cove',
    'cyn' : 'Canyon',
    'dr' : 'Drive',
    'expy' : 'Expressway',
    'hwy' : 'Highway',
    'ln' : 'Lane',
    'pkwy' : 'Parkway',
    'pl' : 'Place',
    'pt' : 'Point',
    'rd' : 'Road',
    'sq' : 'Square',
    'st' : 'Street',
    'ter' : 'Terrace',
    'tr' : 'Trail',
    'trl' : 'Trail',
    'wy' : 'Way'
    }

with arcpy.da.UpdateCursor(fc, field) as cursor:
    for row in cursor:
        if row[0] != None: # searches only non-null fields
            row[0] = d[row[0]].title()
            cursor.updateRow(row)

Edit: I changed the dictionary keys to lower cases.
Error I got with this is.
\StreetSuffix.py", line 39, in <module> row[0] = d[row[0]].title() KeyError: u'LN'

With row[0] = d[row[0].strip().lower()].title() instead I got this error.
\StreetSuffix.py", line 39, in <module> row[0] = d[row[0].strip().lower()].title() KeyError: u'lane'
The first row was changed to "Lane" but nothing else

Edit 2: I changed the last part to.

    ...
    'tr' : 'Trail',
    'trl' : 'Trail',
    'wy' : 'Way',
    ' ' : None,
    }

with arcpy.da.UpdateCursor(fc, field) as cursor:
    for row in cursor:
        key = row[0].strip().lower()
        if key and key in d:  #  Check key is non-NULL and is in dictionary
            row[0] = d[key]
            cursor.updateRow(row)

I get this error \StreetSuffix.py", line 38, in <module>
    for row in cursor:
RuntimeError: The row contains a bad value. [STREET_TYPE]

When I close the tool and review the table I get this error and the all table data is gone.

Edit 3: The length is 5 is why I'm probably getting an error. Copy the data to a new column first then run the tool works.


texts: Representing Polygon Complexity as readable attribute

texts:
I'm using QGIS and I have polygons such as this

I would like to generate a feature table with the point in each polygon, and a sort of 'encoding' of the corresponding polygon.
I would like to represent each of the polygons as a feature using their shape complexities. I read a paper which uses an approach they referred to as 'vertex coding' and described as 'a chain coding approach to encode the shape of the building plan outline as a sequence of segment lengths, where each segment, or wall, denotes a significant change of direction.' This means the vertex code for a single polygon with 5 sides could be l1-l2-l3-l4-l5 where l1:l5 are the lengths of each side of the polygon.
I had found a Plugin "PolygonComplexity", but it is written for an older version of QGIS.


texts: Why does QGIS / MMQGIS / Geocoding always show a connection error to Google Maps although I want to use Nominatim?

texts:
I am currently trying to geocode addresses from a CSV file using QGIS (2.18.22) via MMQGIS (2018.1.2) and the Nominatim Geocoder.

Unfortunately there is always a strange error.

Why does Nominatim try to contact the Google Maps API? How do I solve this problem?


texts: categorial clusters with colors not preserved at any scale

texts:
I am using @cluster_color expression and @cluster_size expression to built a categorical map with QGIS.

I don't really understand why clusters doesn't preserve categories at all scales. Everything is "middle age" (red) at regional scale.


texts: QGIS - Field Calculator: scale_linear gives unexpected result

texts:
When I try to use scale_linear, its output isn't as I expected. My values are from 1 to 16, so I set domain_min = 1 and domain_max = 16. I want to interpolate to interval from 1 to 4 so I set range_min = 1 and range_max = 4.

This is what Field Calculator returned:

scale_linear("id", 1, 16, 1, 4)

id -> scale_id
1 -> 1
2 -> 1
3 -> 1
4 -> 2
5 -> 2
6 -> 2
7 -> 2
8 -> 2
9 -> 3
10 -> 3
11 -> 3
12 -> 3
13 -> 3
14 -> 4
15 -> 4
16 -> 4

Screenshot:

I'd expect 4 -> 1 and 13 -> 4. Calculator Why doesn't scale_linear return 1 for values from 1 to 4 and so on?

Also, I noted that 3 / 4 is 1 (integer, precision 10). Maybe it is related with above problem?


texts:
I'm pulling forest data from OSM through overpass API to QGIS 3.8. Then I have a new layer with a simple fill (filled with color).

I would like to use the same symbols as in OSM instead of simple colors, example attached. Any ideas on how to achieve that?


texts: Rearranging attribute order for export to Excel

texts: I am using QGIS 3.12. I want to rearrange the order of the fields. I know I can organize the columns in the attribute table, but the problem is that when I export to Excel it comes out in the old arrangement. I need to change the order here:


texts: MapFish installation "setuptools failed with error code 1"

texts:
I am trying to install mapfish on windows7. When i run the commands then it gives error

" -- always-copy -U setuptools failed with error code 1.

I am getting following errors when installing mapfish.


texts: How to identify a GeoJSON LineString self-intersection?

texts:
I am working on a (hobby) project where I am processing gps data (GeoJSON LineStrings) in which this often occurs. I am looking for a solution using JavaScript because I would like to do this client-side.

I am already using leafletjs and turfjs but to my knowledge they both are missing this feature.

note: I opened an issue (as feature request to extend turf.kinks so it covers LineString as well) with the hope turf will cover this gap one day -> https://github.com/Turfjs/turf/issues/528


texts: Adding custom icons to L.markerClusterGroup?

texts:
I am new to leaflet and javascript and would like to add custom icons to the code below but am not sure where exactly to put the code and what stuff to move around... I am looking at the Leaflet.markerCluster example. I am using the same CSS portion as from the custom icon example as:

Here's the rest of my code:

var markerClusters = L.markerClusterGroup();

iconCreateFunction: function (cluster) {
    var markers = cluster.getAllChildMarkers();
    for (var i = 0; i < markers.length; ++i) {
        var n = 0;
        var popup = markers[i].name +
            '
' + markers[i].city +
            '
IATA/FAA: ' + markers[i].iata_faa +
            '
ICAO: ' + markers[i].icao +
            '
Altitude: ' + Math.round(markers[i].alt * 0.3048) + ' m' +
            '
Timezone: ' + markers[i].tz;

        var m = L.marker([markers[i].lat, markers[i].lng]).bindPopup(popup);

        markerClusters.addLayer(m);
    }
    return L.divIcon({
        html: n,
        className: 'mycluster',
        iconSize: L.point(40,
            40)
    });
}

map.addLayer(markerClusters);


texts: Multiple buffer ring area analysis using ArcGIS Pro

texts:
I have some sites what I've created multi ring buffers for in one shape file, each ring is 50m from the center up to 1000m. The file is one shapefile with many polygons and each ring is the full size (no dissolve).

I have three different polygon shapefiles that I want to overlay and find the area of each circle they take.

So for example I want to know the area of canopy cover(green layer) over the 500m circle for site 1. but for every circle

I tried doing an intersect of the two layers but it comes back with a lock error and an empty attribute table.


texts: Openlayers WMS getFeatureInfo get features with geometry attribute

texts:
I am displaying map using WMSlayer and implemented WMSGetFeatureInfo control on wms layer. Tap on a location and get the features  using WMS getFeatureInfo service. This service is returning me all the features are located at given Point successfully with feature attributes.

My Requirement

Along with the Feature attributes, i need to have the feature geometry information too, which not geting as part of feature information from service.

So is there any way to capture the geometry information from OpenLayers GetFeatureInfo control?

Or

Is that a limitation in WMS GetFeatureInfo service?


texts:
I am trying to run a 3.6.1 Python script and one of the libs I need to import is the osgeo. I've already downloaded the GDAL library because I use QGIS. I also have ArcGIS installed on this machine which has Python 2.7.1 installed with it.

When I try to run the script, I get the following error:

Traceback (most recent call last):
  File "C:\Users\username\Desktop\PostgreAccess.py", line 3, in <module>
    from osgeo import ogr
ModuleNotFoundError: No module named 'osgeo'

I don't understand why I'm getting this error. I've already tried adding a new environment variable, restarting my machine, re-downloading the GDAL for Windows. Any suggestions for troubleshooting?

I'm on Windows 10.