texts: Using libraries other than PyQGIS to develop plugin for QGIS?

texts:
I develop a plugin for QGIS. Before to integreted it in the QGIS I developped it with GIS library (Fiona, shapely, geopandas, ...) and it work well. Now I try to build it with plugin_builder of QGIS. The problem is I try to use my functions that I created with the previous libraries, but it seems like PyQGIS (QGIS) didn't recongnize them.

Is it possible to work with the GIS libraries to open, write a vector and make some processes in QGIS environment?


texts:
I would like to know the precision for an ArcGIS raster stored within a file geodatabase (FGDBR format); I can't seem to find this information anywhere in their documentation (apologies if I have missed the obvious...).  By precision, I mean the number of decimal places that are used to store the value for each grid-cell (not the coordinate values for spatial referencing).  I know this is 6 for the GRID format, but can't find the equivalent info for the FGDBR format.

The reason for asking is that I get different results for exactly the same processing when I use FGDBR vs. file stored GRID raster datasets.  I am interested in the cumulative sum over the entire raster grid; there is a difference of approx. 0.5% between the two methods (i.e. a result of 5301.316 when the analysis is carried out in a GDB, compared with 5323.825 in a file storage system).

EDIT: In addition, students have reported getting vastly different answers when using 64 vs 32 bit machines; I don't have the values for these though.  I will add when I can repeat the results myself.


texts: Calculating travel time OD matrix in QGIS

texts: How to calculate travel time OD-matrix in QGIS. I mean shortest DRIVING distance(or time) between many origins to many destinations (I do NOT mean direct distance tools).


texts:
I need to move/edit few labels in a job.
How can I work on it?

I am using QGIS 1.7.4 and the label option in the toolbar (not the layer options)


texts:
Warning: Google translator:
how to make the cluster display on top simple features

http://jsfiddle.net/3dv1wdho/16/

it is necessary that the cluster was on top

    var count = 20000;
var features = new Array(count);
var e = 4500000;
for (var i = 0; i < count; ++i) {
  var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
  features[i] = new ol.Feature(new ol.geom.Point(coordinates));
}

var source = new ol.source.Vector({
  features: features
});

var clusterSource = new ol.source.Cluster({
  distance: 40,
  source: source
});

var styleCache = {};
var defaultStyle = [new ol.style.Style({
                    image: new ol.style.Icon(({
                        anchor: [0.7, 47],
                        anchorXUnits: 'fraction',
                        anchorYUnits: 'pixels',
                        src: 'http://tennisterin.com/images/gmap/maps-point.png'
                    }))
})];
var threshold = 1;
var clusters = new ol.layer.Vector({
  source: clusterSource,
  style: function(feature, resolution) {
    var size = feature.get('features').length;
    if (size > threshold) {
      var style = styleCache[size];
      if (!style) {
        style = [new ol.style.Style({
          image: new ol.style.Circle({
            radius: 10,
            stroke: new ol.style.Stroke({
              color: '#fff'
            }),
            fill: new ol.style.Fill({
              color: '#3399CC'
            })
          }),
          text: new ol.style.Text({
            text: size.toString(),
            fill: new ol.style.Fill({
              color: '#fff'
            })
          })
        })];
        styleCache[size] = style;
      }
    } else {
      return defaultStyle;
    }
    return style;
  }
});

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

var raw = new ol.layer.Vector({
  source: source
});

var map = new ol.Map({
  layers: [raster, clusters],
  renderer: 'canvas',
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

with increasing green icon is superimposed on top of the cluster, it is necessary on the contrary to the cluster was on top of a green icons.
how to do it?


texts: How to remove features from geojson by mouse selection?

texts:
There are these unnecessary lines in my geojson:

You see, not all the borderline was deleted when I merged two countries.

Is there any way to quickly select and remove the features in a practical manner, because there's more than one case like this I'm dealing with.

Thanks in advance.

EDIT: Deleted some of them by using Edit>"Remove Ring".

But there are still some which cannot be removed by this tool.
Is there such plugin available, that will remove lines that are irrelevant with the polygon?


texts: ArcGIS 10's Editor and Snapping toolbars question (snapping polyline to another polyline)

texts:
Have attempted this about 20 different ways using Editor / Snapping Toolbars and ET GeoWizards but still cannot find solution. Screen shot is attached.
Need to snap the green polyline to the red polyline at specified location and back to beginning of red polyline.


texts: Error adding ArcGIS MapServer Layer to QGIS 3.6?

texts:
I have QGIS 2.18 and QGIS 3.6 installed on my machine (running Windows 10) and I am able to add ArcGIS MapServer Layers to my project in QGIS 2.18 without problems, but in QGIS 3.6, using the same services used in QGIS 2.18, it returns an error:

  Failed to retrieve service capabilities.
  Network error: The proxy type is invalid for this operation

I'm using the Add ArcGIS MapServer Layer... tool to add the map service to the project.

Here's a printscreen of the creation of the connection to the ArcGIS MapService:

After clicking in the Connect button, it returns the following message:


texts: Problem about converting raster to polyline and calculating total length

texts:
I have raster file of line segment. I need to convert it to line and get the distance of that line. How can i do using Python and ArcGIS 10? I have tried with GIS tools Convert Raster to Polyline but the line segment is not straight and it is divided into no of segments, isn't it possible to get single line segment.

I have attached herewith pictures. My problem is to find out the width of dam. For that I have drawn cross section at a regular interval along the stream. I have also shown how I will find out the width.. If you have any suggestion please provide me. And talking about my problem, after raster analysis of taking the difference of two raster. I have a raster segment shown in right side of picture. I tried to Convert Raster to Polyline but line is not straight and break into several segment. I need to have one line segment which is straight.


texts:
I am trying to process some bioclimatic raster files, such as can be downloaded from http://www.worldclim.org/current (bioclim set). They seem to have nodata values set to -3.4e+38 according to QGIS (looking at the output of gdalinfo, it's -3.39999999999999996e+38).

It seems that gdal tools aren't able to deal with this nodata value, and qgis doesn't seem to be able to recognise it either. In the layer styling, there's an entry for -3.4e+38 set to 100% transparent, but it still displays such values, even though the "Identify features" picker shows them as having value -3.4e+38.

I have tried creating a vrt to convert the nodata values to -9999 instead, but that hasn't worked either.

How can I process such files to have usable nodata values?


texts: why can't i export geometry data from a shapefile?

texts: I saved the layer using "vector save as" box but even when adding GEOMETRY=AS_XY in the layer box, the csv only showed the id and no gemetry data.


texts:
There are many algorithms for binary map overlay operation in vector data format which take two layers of map and produce resultant layer i.e overlaid layer as output.
I am wondering whether there are any algorithms which take more than two layers say 3 layers simultaneously and produce the overlay result?


texts: How can I delete dangling paths after merging features

texts:
In my previous question I've asked how to can I merge different polygons while converting to GeoJSON and TopoJSON.

After a day of researching I've realized that, rather trying to do it command line, I should use some editor which can handle Shapefile data. So, I've choose QGIS.

I've toggled to edit mode, chose all areas needed and called "merge selected features". After the merge I'm getting something like this:

I'm expecting to get all countries in Africa joined into one region.
But, as you can see, I'm getting some dangling paths.
My question is - what I'm doing wrong, how I can avoid such dangling paths or get rid of them after the merge? Since selecting all this nodes via "Node tool" does not help much.


texts: Using custom road network in OSRM map matching request

texts:
For a project I'm using OSRM to map match a series of GPS measurements to a custom road network. My goal is to provide insight in where but more importantly how many times the vehicle has visited each road segment in the road network. My desired output is (1) an attribute table of the road network with an extra column that shows the number of times the vehicle drove through the street, (2) a map visualisation of the flow of traffic through the network, with the width of each line segment representing the amount of traffic (i.e. based on the visit frequency values in the attribute table). Something like this:

I have been able to convert a custom road network in shapefile format to .osm data using ogr2osm and succesfully map match the GPS points to this network. Using the option annotations=nodes in the OSRM request I'm able to get all the node id pairs and geometry from the API response. This would allow me to tabulate and rank the most common segments, and display them visually, no joining to a PBF required. However, the original node id's from the shapefile appear to have lost after the conversion. I was hoping ogr2osm would be able to transfer the node id's from the .shp to the .osm file, as the original shapefile contains a column "source" and a column "target" to indicate the node id's. Instead, new node id's have been chronologically numbered in the .osm file (see below), which makes it useless to count the node id pairs. This makes it impossible to come to the desired output as described above. Does anyone have a solution to retain the original node id's from the original shapefile road network? Or does somebody have a better solution for what I'm trying to achieve?


texts: manually create the shp and properties files for geoserver pyramid file

texts:
I am using geoserver 2.8.2 under ubuntu 14.04 with the pyramid plugins. The pyramid tiles are generated by gdal_retile.py. GeoServer will generate some new shp files and property files when I import into a new data store.

As the permission constrained of my file system, I cannot give write permission to tomcat7.

However, geoserver can import a new data store if the shp files and property files already created.

Could I create these file manually with other scripts?


texts: Issue clipping vector file with QGIS (geoprocessing tools)

texts:
I am trying to clip wind speed data (.shp format) to Canada's provincial boundaries (also .shp format). I am using the clip feature in vector > geoprocessing tools. For some reason the function always stops about three quarters of the way through and never completes the clip. See screenshot: .

Has anyone experienced this before and is anyone aware of any solutions?

Thanks for your help!

Best,

Laura


texts: Mis-aligned layer from United States Geological Survey Web Mapping Service (USGS WMS)

texts:
I have a layer of impervious surfaces in the contiguous US, provided by the US Geological Survey as a WMS. The CRS is set to EPSG 4326, which is what the metadata says it should be. The entire layer is about 13 miles too far to the north. The east-west placement seems to be correct.

This is the service URL: https://smallscale.nationalmap.gov/arcgis/services/ImperviousSurface/MapServer/WMSServer

I'm new at using layers from WMS servers, so hopefully I've just made a basic mistake.

I've tested it with several different layers that I know are correct. Here you can see what it looks like with a Google Hybrid basemap (obtained through QuickMapServices plugin).

On-the-fly reprojection is turned on. The screenshots are from QGIS 2.18, but I have the same issue in QGIS 3.0.

Why is this WMS layer mis-aligned?

UPDATE: I downloaded a different WMS layer from the USGS (USGS Imagery Topo Base Map - Below 18K Scale Dynamic) and it's correctly aligned. This proves that: A) I am capable of correctly loading a WMS layer; and B) not all data from the USGS has this issue.


texts: Why is my area calculation coming out as 0.00?

texts: I have a polygon layer where I am unable to calculate the areas for some reason, and it gives me the result 0.00 for all of the polygons. I have another layer on the same project where this works fine. Any ideas what might be causing this?


texts: Using addLayer and setVisible in OpenLayers

texts:
I've a doubt about use of addLayer and setVisible. I've a sidebar with a checkbox for add or remove some layers.
For example, I have LayerA and LayerB, when I click on LayerA on the sidebar is activated this code:
map.addLayer(LayerA);
LayerA.setVisible(true);
map.removeLayer(LayerB);

And vice versa if I click on LayerB.
Is it correct use both addLayer and setVisible?


texts:
I have a lot of GeoTIFF images. However, as there is a mistake in the GeoTIFF tag, I am considering re-tagging.
Therefore, make GeoTIFF to TIFF after that re-tag from GDAL.

However, I don't know how to convert from GeoTIFF to TIFF.
How can I do this?

I tried using imagemagick's convert once, but it did not become TIFF.

convert input.tiff output.tiff


texts: Loading Vector Layer using python console in qgis

texts:
I am using qgis2.6 version and new to pyQGIS. I tried to load a vector file using python console in qgis. I don't know where I am wrong. The layer was not loaded and does not show any error too. Help would be appreciated.The code which i tried is below.

wb = QgsVectorLayer('C:\Users\new\Desktop\PyQGIS\pyqgis_data\world_borders.shp', 'world_borders', 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(wb)


texts: Is vector tile a feasible option for dynamic data?

texts:
I want to create an application using vector tile. I am using OpenLayers 5 and GeoServer 2.14 for this purpose. My data (stored in PostgreSQL+PostGIS) has around 2.5 lakhs geometry (road network) which is published in geoserver through SQL view.
Geometry of the data is fixed but its attributes related to traffic etc. are changing in every 2 minutes. We want client side rendering that's why we are planning for vector tile options.

My current code for rendering vector tile is:

   function getbbox(tileCoord) {
                var tileGrid = source.getTileGrid();
                var coord = source.getTileGrid().getTileCoordExtent(tileCoord);
                var newCoord = ol.proj.transformExtent([coord[0], coord[1], coord[2], coord[3]], 'EPSG:4326', 'EPSG:3857'); // perform projection transform with given extent.
                return newCoord[0] + ';miny:' + newCoord[1] + ';maxx:' + newCoord[2] + ';maxy:' + newCoord[3];
            }

    var source = new ol.source.VectorTile({
                cacheSize: 0,
                tileUrlFunction: function (tileCoord, pixelRatio,
         projection) {
                    return 'http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=cite:OPE_MAP_SpatelSpeed&STYLE=' +
                        '&TILEMATRIX=' + projection.getCode() + ':' + tileCoord[0] +
                        '&TILEMATRIXSET=' + projection.getCode() +
                         '&FORMAT=application/json;type=geojson' +
                        '&TILECOL=' + tileCoord[1] +
                        '&TILEROW=' + (-(tileCoord[2] + 1)) +
                        '&VIEWPARAMS=ispercent:1;G:A0FF0B;minx:' + getbbox(tileCoord) + ';zoomlevel:' + tileCoord[0] +
                        '&key=' + Math.random()
                },
                format: new ol.format.GeoJSON({}),
                projection: projection,
                tileGrid: new ol.tilegrid.WMTS({
                    tileSize: [256, 256],
                    origin: [-180.0, 90.0],
                    resolutions: resolutions,
                    matrixIds: gridNames
                }),
                wrapX: true
            });

The problem which i am facing is :
1) Calls for vector tiles is very slow, it takes >60 sec for completing request.
2) Once data is loaded, next time it is coming from GeoServer tile cache, thus not reflecting latest traffic data which comes every 2 min.

We are already passing tile bounding box as viewparams(minx, miny, maxx, maxy) to PostgreSQL query to fetch data for that particular region only for better performance.

Does it is a good option to go for vector tiles for dynamic data? Or there is any way to improve the performance?


texts: How can I collect training samples using ee.Image.sampleRegions() and an existing raster layer in Google Earth Engine?

texts: I would like to sample training data from some raster data source (e.g. Sentinel-2) based on labels extracted from an already available dataset (e.g. some binary layer or classification map) in Google Earth Engine. While it might seem straight-forward to use ee.Image.sampleRegions(), this is apparently not the case. The reason being that the first input argument ee.Image.sampleRegions() is a FeatureCollection with one or more geometries defining the areas to sample from. If your input is an already existing classification layer, this won't work from scratch. Thus, the question possibly narrows down to how one can create a FeatureCollection where each class of the already available raster layer corresponds to one Feature, and how this can be integrated with ee.Image.sampleRegions().


texts: QGIS-3 does not recognize "-3.40282e+38" float raster values as NoData

texts:
I have DEMs with "-3.40282e+38" values that are supposed to be the NoData values. However, if the rasters are loaded into QGIS (3.4.11), the value can not get assigned with "add additional no data value" via the transparency tab.

When this value is assigned with gdal_translate -a_nodata -3.40282e+38 input.tif output.tif the output.tif shows this value as NoData but QGIS still does not recognize it.
However, if the NoData value is computed in the tif properties in ArcCatalog and then exportet as a new tif, the assigned NoData value of the exported tif is recognized in QGIS.

How can I assign such large float values as NoData in QGIS (or GDAL)?

I am using QGIS 3.4.11 LTR on a Linux Mint 19.2 operating system.
Edit: GDAL version 2.2.3 is used


texts: QGIS get id of vertices of polyline (or polygon)

texts:
I need to know the ID (or name) of vertices of a polyline (or polygon) to build someting like this image.

As the tread below I already used @geometry_point_num command to have vertex's ID but it return only the number of the vertex on screen and the's unusefell for me that I have some km long polyline.
How to get or assign vertex id to polygon vertices and use these as vertex label using pyqgis?
That's no good because I need to take absolute ID of vertex like I can show on vertex editing

In that way I can extract as label text the angle value of the id vertex.
For have the angle value I use something like that:

I suppose that using the function editor I can get it but I don't now python and QGIS lybrary.
I also considered to extract the vertex points or subdivide my polyline to lines but the's unusefull for my scope.


texts: Create line label with automatic (justified) letter spacing in QGIS?

texts:
I've digitized a curved line, and label "MONGOLIA" (SCREENSHOT 1)is on the line.

ps: I have around 50 'names' to do it like that.

what I want now is: to perfectly align the labels as 'Align justify' like in Microsoft Word (SCREENSHOT 2) (perfectly align the text to both the left and right margins),

SO if I solve "Align justify" then I don't need to fix the distance for each letter manually(by giving parameter for them all one by one),

Is it actually do it in QGIS? (in maybe Layer properties> label ??)


texts:
When I am trying to run example of gdaltransform I am getting error:

> gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370 177502 311865
ERROR 4: `177502' does not exist in the file system,
and is not recognised as a supported dataset name.

But it's copy-past example, and it should work. What I am doing wrong?


texts: Does the mean of latitude and longitude make sense?

texts:
The problem setting:

I have a time series of geolocation data, namely latitude and longitude.

I want to downsampling the time series and don't know if taking mean value of latitude and longitude make sense at all geographically.

Or should I take the most frequent values within the time window.

I have very little knowledge about GIS and learning now.


texts: Does IDistanceOP.EucDistanceFull require a projected coordinate system?

texts:
I have designed an implementation of ArcObjects' IDistanceOP.EucDistanceFull. It takes its input as a feature class and converts it to a GeoDataset with which EucDistanceFull can work with. It works fine with feature classes in projected coordinate systems, but doesn't execute property on feature classes with unknown or geographic coordinate systems (It will output a blank or black raster).

What could be the issue here? I don't see anywhere in the library documentation that states that EucDistanceFull requires projected coordinate systems.


texts: Can't order/sort String columns in ArcMap attribute table

texts:
I am new to this site as a registered user and new to GIS in general, and it has proven quite useful to me.

I have a very annoying problem with the attribute table being filled by an ArcMap extension, every column of type String cannot be ordered/sorted at all. The table is supposed to display DateTimes, and it was chosen to convert them to Strings. I tried to change one of these fields to "esriFieldTypeDate" and it worked, meaning the dates are correctly sorted.

Unfortunately, none of the columns using Strings (esriFieldTypeString) can be sorted. If the initial order by IDs is changed by a new ordre on another column, and then I try to sort a String column, it gets back to this initial order. by IDs.

I have no control on the sorting operation, just data being initialized when creating a solver, and then given a value, as follows.

Here is the initialization on creating a new solver:

        fields = new Fields() as IFieldsEdit;

        // Arrival time
        field = new Field() as IFieldEdit;
        field.Name_2 = UnlocalisableResources.arrivalTimeField;
        field.AliasName_2 = MobiAnalyst.arrivalTimeField;
        field.Type_2 = esriFieldType.esriFieldTypeString;
        fields.AddField(field);

        classDefinition.Fields = fields;

And here is where the field value is set:

        dateTime = new DateTime();
        dateTime += TimeSpan.FromMinutes(arrivalTime);
        linesFeatureBuffer.set_Value((int)arrivalTimeFieldIndex, dateTime.ToLongTimeString());

Since I found absolutely nothing about this particular problem on various forums, I was asking myself if it may be a simple formatting or encoding problem on the Strings, or anything else someone would know about ?


texts: Join polygons by location PostgreSQL/PostGIS

texts:
I have two shapefiles - test7 and MD_Overlay

test7 has about 600,000 records with over one hundred attributes (about ~2GB) , so performing spatial joins in QGIS is very inefficient. I would like to find out the equivalent SQL command of QGIS Join attributes by location in PostGIS.  My aim is to add the columns of MD_Overlay to test7 and to keep  both  matching and non-matching records.

This would be a polygons in polygons operation. (So a polygon in test7 would have to be fully within a polygon in MD_Overlay in order to be joined)

I have done much research but cannot find a solution.  Any advice?


texts: Identifying overlap between linestrings efficiently in PostGIS

texts:
My goal is to clip one linestring table to a buffered version of another linestring table, and I want to make sure I'm doing it the most efficient way possible.
The steps are

One table is acting as the mask, the other as the table to be clipped
Identify rows that intersect between the clipping dataset and the mask which is buffered into a polygon
Group the mask rows by the clipping rows they intersect, and merge them into a single linestring group
Clip the original table to the buffered and merged mask

This is all done in one call, but I break it out into three variable (I'm using python f strings so you can just replace the variables with the call they represent)
# Identify all rows that intersect
overlap_query= f"""SELECT B.id as uid, A.geometry as geometry
from mask B, to_be_clipped A
WHERE st_isvalid(A.geometry) AND st_intersects(ST_Buffer(A.geometry, 15), B.geometry) = true"""

# Group the mask rows by the rows they intersect, collect them and merge them
grouped_query = f"""WITH overlap as ({overlap_query})
SELECT uid, ST_LineMerge(st_collectionhomogenize(st_collect(geometry))) as geometry
FROM overlap GROUP BY uid"""

# Clip the original dataset to the grouped and buffered mask
query = f"""CREATE TABLE clipped AS
with grouped as ({grouped_query})
SELECT D.uid, st_intersection(st_buffer(C.geometry, 15), D.geometry) as geometry
FROM grouped C, to_be_clipped D
WHERE C.uid = D.id"""

The final call looks like this:
CREATE TABLE clipped AS  with grouped as
  (WITH overlap as
    (SELECT B.id as uid, A.geometry as geometry  from mask B, to_be_clipped A  WHERE st_isvalid(A.geometry) AND st_intersects(ST_Buffer(A.geometry, 15), B.geometry) = true)

  SELECT uid, ST_LineMerge(st_collectionhomogenize(st_collect(geometry))) as geometry  FROM overlap GROUP BY uid)

SELECT D.uid, st_intersection(st_buffer(C.geometry, 15), D.geometry) as geometry FROM grouped C, to_be_clipped D WHERE C.uid = D.id;

How can I do this better?
With a few million rows in each table, this takes about 30 minutes.


texts: How do I exclude certain districts from an R `tmap` city plot using `osmdata`?

texts:
I am trying to plot only District (quan) 1 of Ho Chi Minh city, and the wards (phuong) within it, in an aesthetically pleasing way.  Despite reading the osmdata vignette and help, I can't work out how to exclude the surrounding wards and districts.

(Ideally I would also like to know how to leave the external ward boundaries in, but without text labels.)

Sorry if this is a dumb question, I'm new to mapping. My code and resulting map so far is below:

library(tidyverse)
library(extrafont)
library(osmdata)
library(sf)
library(tmap)

bb <- getbb('District 1, Ho Chi Minh City')

quans <- opq(bbox = bb) %>%
  add_osm_feature(key = 'admin_level', value = '6') %>%
  osmdata_sf # %>% trim_osmdata(bb)

quansPoly <- quans$osm_multipolygons
quansPoly_Q1 <- quansPoly[1,] # Manual district extraction; should be unnecessary!

phuongs <- opq(bbox = bb) %>%
  add_osm_feature(key = 'admin_level', value = '8') %>%
  osmdata_sf # %>% trim_osmdata(bb)

phuongsPoly <- phuongs$osm_multipolygons

tm_shape(quansPoly_Q1) +
  tm_borders(col = 'red', lwd = 3, alpha = 0.1) +
tm_shape(phuongsPoly) +
  tm_polygons(title = 'Municipalities', lwd = 3, border.alpha = .2, alpha = 0.1) +
    tm_text(text = "name.zh", fontfamily = "Han-Nom Kai", size = 1.2, col = "black") +
    tm_style("watercolor") +
    tm_layout(legend.outside = TRUE, legend.show = T, legend.width = .2, legend.height = .2, legend.text.size = .9, legend.title.fontfamily = "Garamond Premier Pro Semibold Italic Caption", legend.position = c(.8, .1), frame.lwd = 3, bg.color = "papayawhip", frame.double.line = T, title = "HCMC, District I", fontfamily = "Garamond Premier Pro Bold Caption", title.size = 1.5, title.position = c(.03, .95)) +
  tm_shape(phuongsPoly) +
      tm_text(text = "name", fontfamily = "Garamond Premier Pro Semibold Italic Caption", size = .8, ymod = 1.1) +
  tm_shape(quansPoly_Q1) +
  tm_borders(col = 'red', lwd = 3, alpha = 0.4) +
  tm_grid(projection = 'longlat', n.x = 5) + tm_scale_bar() +
  tm_compass(position = c('right', 'top'))


texts: Plot the Shortest Paths in a Grid without any clash at a point of time

texts:
The efficient algorithm needs to be done and proved for the best solution for the given problem:

User inputs: (#) Size of the NxN Grid. (N); (#) No. of Paths: Z; (#) Source and Destination Coordinates of each of the individual Z paths.

Given: (#) Each path comprises of the cells which are ADJACENT to each other and NOT diagonal. (#) Time taken to cross each cell is EQUAL and is an unit time. (#) Travelling starts from the respective source coordinates of each path in the grid SIMULTANEOUSLY. (#) Paths may intersect, BUT after say 'x'th unit time no two paths must intersect in one particular cell at a time. If such case arises, then one of the paths need to bypass into a new path taking alternate adjacent cell just before the clashing cell.

Output: Z no. of paths which are SHORTEST possible without clash.

[Say there are two paths (Z=2), say X to Y and W to Z. While travelling, both X and W start simultaneously from their respective source coordinates, going to their respective destinations Y and Z such that they should take the SHORTEST possible path, AND after 'x'th unit time, they must not CLASH (when both the paths have traveled exactly (x-1) no. of cells and clashing into the 'x'th cell) into one single cell. If that happens, one of the path needs to be bypassed towards its destination keeping in mind without clash, shortest possible path. And this has to be implemented for Z no. of lines starting simultaneously in the grid.]


texts: Is it possible to locate a specific marker point on a raster using python and use that location for georeferencing

texts:
I have several scans of the same map, which I would like to georeference. I can not use arcpy.WarpFromFile_management(...) as the rasters are slightly different due to scanning.

Is there a possibility to automatically (using python) recognise marker point on the map, which are than used as controll points for georeferencing? As the map is black and white the points could be of a specific colour to be easily identified. I am using ArcGIS 10.3 basic w/o and extensions. Any ideas?


texts:
In ArcGIS for desktop I'm trying to create a TIN from an Orthophoto that has control points, the photo is high quality and has a huge amount of control points.

I'm just having issues creating the TIN properly.

I've been using the raster to TIN tool. When I'm creating the TIN is there certain limits I should apply to the Z factor, and those other options?


texts: How to solve jpeg2000, jp2. crash & errors on arcgis 9.3.1 windows 7 64-bit

texts:
I have several problems at work. One is that jpeg2000 crashes ArcMap but mostly ArcCatalog when trying to read them. This is only occurs on machines with Windows 7 64-bit (we don't have Windows 7 32-bit).

What can cause this? I have deleted templates, re-installed, everything in my power. But there is obviously some compatibility issue, because it works great on Windows XP.


texts: Emulating "Swiss style" shaded relief with ArcGIS tools?

texts: Is there a way to create a Swiss style (or other hand-shaded-like styles) shaded relief from a dem using ArcGIS tools alone?


texts: Concatenating numbers and adding in leading zeros?

texts: I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01.  Getting to 1.9.1 is easy but can anyone help out with how to formulate it so that each value has two places (i.e. add in those zeroes).  I used to do this in Excel but can't figure out how to work in ArcMap 10.


texts:
I work for a department that get's a regular City Council District Shapefile showing the boundaries of each Councilors District. In our SDE we have a Council_District table with an exact duplicate of the previous City Council District Shapefile.

In SDE we have added other fields, links to websites for each councilor, etc. We utilize Flex Maps to make these maps public.

Everytime a new updated shapefile comes out, we copy over the Shapefile and write-over the SDE version with the new data. Then we have to re-create the added fields and their data.

This requires that we shut down every web map using this file which can disrupt both in-house and external users and is not efficient at all.

We are currently running version 9 servers, we will be updating to 10.1 in January. We will NOT be updating to 10.2 (yet!) due to data issues from our data providers.

Question(s)

Is there any way to just update the SDE from the Shapefile to avoid thisor do we always have to shut down webmap services?


texts: FeatureLayer fullExtent is being constricted by Dojo ContentPane side panel

texts:
I have an ArcGIS JavaScript application which displays one single FeatureLayer on a map which is in a Dojo BorderContainer/ContentPane template similar to the one shown here.  I am trying to initialize the map to the fullExtent of the single FeatureLayer.  I accomplish this like so:

map.on("layers-add-result", function(evt){
    map.setExtent(evt.layers[0].layer.fullExtent)
});

However, I am finding that points on the extremes of the map are cut off.  Specifically, this is a layer of points across the eastern and midwestern United States, but there are a few points in California and one in France.  The points in CA and France are out of the map's extent.

My hunch was that the extent is set assuming there is no ContentPane side panel, then forced into the smaller viewport once the ContentPane is rendered.  I tested this theory by creating a map which spans 100% of the page's width.  Sure enough, the problem went away.

How can I ensure that map.setExtent() takes into account the ContentPane side panels?  I'm already requiring domReady! and calling parser.parse().  Anything else I'm missing?

Edited with more details on 2/24

I forgot to add that I have a FeatureTable which basically serves as the attribute table for the points in the FeatureLayer. I have set the map to zoom back out to the full extent when the FeatureTable selection is cleared. When this zooming out occurs, the map zooms to the correct extents and includes all the points. This bolsters my theory that the initial call to map.setExtent isn't "aware" of the map's smaller viewport when the page initially loads but it is later once the page is fully loaded.


texts: Assign raster values to a grid (polygon) in QGIS

texts: I have a few raster datasets and I created a fishnet (polygon). I tried to add the values which the rasters have in the grid cells to the attribute Table from the polygon.


texts: Setting default zoom level in OpenLayers

texts:
With your help I was able get a shapefile from the CAD file of the previous question.

Now the next step is the display the shapefile in OpenLayers... I wrote the script but the map being displayed in the browser is way too small... I need help setting the default zoom level...

Can someone point me to an "simple" example that explains how to set the default zoom level?

The ones I've found a way to complicated...


texts: Cannot download Landsat 8 images from RGISTools R package

texts:
I've been having a hard time trying to automate some Landsat 8 image download and processing for my project.

At first, I tried to use getSpatialData package to do what I need from R, but it seems the authors aren't maintaining and supporting the library recently.

Now, I'm trying to acomplish my goals by using RGISTools package, but I'm reading the article the authors wrote about the package and testing in real time here in Rstudio and when I try to run some functions like lsDownload(), and it keeps returning an error:

Downloading the images in: C:/PROJETOS_PRINCIPAIS2/AUTOMATE_SATELITE_IMAGE/RGISTools/Teste/landsat8/downloads/Landsat8/raw

Starting Landsat level 1 download process...

Error in charToRaw(enc2utf8(val)) :

  argument must be a character vector of length 1

Here is my code for you to take a look if I'm missing something:
##### Import libraries #####

library(raster)

library(sp)

library(sf)

library(RGISTools)

##### Set the working directory #####

scriptWD <- 'C:/PROJETOS_PRINCIPAIS2/AUTOMATE_SATELITE_IMAGE/RGISTools/Teste'

setwd(scriptWD)

##### Import area of interest #####

hortoMG <- st_read('mogiGuacu.shp')

##### Searching for images #####

search <- lsSearch(AppRoot = scriptWD,

                    product = 'LANDSAT_8_C1',

                    dates = as.Date('2020-07-01') + seq(0, 15, 1),

                    region = hortoMG,

                    cloudCover = c(0, 80),

                    username = '*****',

                    password = '*****')

##### Search Preview #####

lsPreview(searchres = search)

##### Create the wd for landsat images downloads #####

wdLandsat <- file.path(scriptWD, 'landsat8')

wdLandsatDownload <- file.path(wdLandsat, 'downloads')

##### Baixando imagens #####

testDownload <- lsDownload(searchres = search,

                    AppRoot = wdLandsatDownload,

                    lvl = 1,

                    product = 'LANDSAT_8_C1',

                    extract.tif = TRUE,

                    username = '*****',

                    password = '*****',

                    nattempts = 5)

Does any one knows why it's not running as expected?
And does anyone knows any content to study more about this library?


texts:
I use QGIS 3.4.5 and want to create a map from a WMS. The problem is the legend, which is created automatically from the WMS. The quality is very bad and the writing is barely legible.
How can I change the formatting of this WMS legend?
I know how to change the size of the legend, but the quality of the writing is pretty bad, even if I increase the size of the legend

WMS Example:
https://www.wms.nrw.de/geobasis/wms_nw_dnrw250


texts: ogr2ogr: cannot append data to Carto table. Error returned by server : missing data for column "cartodb_id"

texts:
I am trying to import data into CARTO using ogr2ogr.

I can create new tables, but once I try to append new data to this table, I get an error

ogr2ogr \
  --config CARTO_API_KEY xxx \
  -t_srs "EPSG:4326" \
  -nln cartolayer \
  -nlt PROMOTE_TO_MULTI \
  -lco GEOMETRY_NAME=geom \
  -f Carto \
  "Carto:myaccount" \
  mypackage.gpkg \
  -sql 'select * from mylayer' \
  -append

>> Error returned by server : missing data for column "cartodb_id"

Schema of second table in identical to the one imported first.

I am using GDAL 2.4.0 on a Mac


texts:
I was new in GIS and Google Earth Engine, i want to perform band ratio for mapping Ferric and Ferrous using ASTER L1T  Radiance.
I want to use band 2/1, 5/3, and 1/2.
How to perform it in Google Earth Engine?
I was tried but i don't know if this true or not.

var dataset = ee.ImageCollection('ASTER/AST_L1T_003')
  .filterDate('2019-03-01', '2019-03-05')
  .filterBounds(Boundary);
Map.setCenter(107.62160048828126,-7.087318840287035, 12);
  Map.addLayer(dataset, {bands: ['B01', 'B02'], min: 0.0, max: 255.0}, 'ASTER1');
  Map.addLayer(dataset, {bands: ['B05', 'B3N'], min: 0.0, max: 255.0}, 'ASTER2');
  Map.addLayer(dataset, {bands: ['B02', 'B01'], min: 0.0, max: 255.0}, 'ASTER3');
  Map.addLayer(Boundary);


texts: Draw route direction overlay on Google Maps or OpenLayers

texts:
I'd like to display the route direction generated from GraphServer on either Google Map or OpenLayers. The result I want is basically identical to how Google Map shows route directions, by highlighting road segments that incorporate the direction. The only difference is that I use GraphServer instead of Google Maps Directions API to generate route direction.

Probably the most trivial approach is to copy over the result from GraphServer, literally point-by-point from every road segments that are part of the route direction, to create polylines or DirectionsStep in Google Maps. But since this task seems to be something that is used often, I wonder if there is any easier approach. It can be either on Google Maps or OpenLayers, whichever is easier to implement.


texts: Create polygons from location other than centroid (Obscuring specific locations)

texts:
Looking to get some feedback on tools or methodology one might use to denote a sensitive area without disclosing the specific location of a feature.  For instance, how best to make a buffer that's not based on a centroid.

Let's say I have a feature I want to hide but I need to know generally where it is.  Might only have a single point, maybe even a small polygon defining it's boundary.  I might wish to make a polygon buffer several miles wide but I want the specific location of the feature it contains more or less randomized. Inside the poly, somewhere, certainly not right in the middle.


texts: Displaying column statistics on map dynamically from layer table columns in ArcMap?

texts:
I am looking for help to create a dynamic text box that will display statistics of columns for the layer tables. Example: In the map, there is a table that displays the premium information of insureds from a region. I have added labels that display per county premium. But I want to display the total premium somewhere on the map in a text box. It should be dynamic since the values will change in the next quarter.

What I tried:

In the layout view, insert dynamic text. But that is mostly related to the author or title or number of pages.
Use of labels. But that doesn't allow me to add dynamic text.

The format I would like to see:

"Total Premium: $ (some formula that adds premium column)"

A number should appear at the place of formula.

Is it possible in ArcMap?


texts: Add Join Management and UpdateCursor in Arcpy

texts:
How to join multiple table with shapefile, update cursor specific field of the table in shapefile table and remove the join table? I write some script but it not work, please correct my script.

import arcpy
from arcpy import env
env.workspace = r'D:\DATABASE\CORONAVIRUS_UPDATE\Shapefile\COVID-19 April2020.gdb' # Here is all the table.
fc = r'D:\DATABASE\CORONAVIRUS_UPDATE\COVID19_Database.gdb\April_Cases_Deaths_Recovered\Apr_Number_Cases'
def Main_Task():
    for fieldname in field_name:
        tables = arcpy.ListTables()
        for tb in tables:
            field_text = []
            jion_fc = arcpy.AddJoin_management(fc,"Country_Name", tb, "Country__Other", "KEEP_COMMON")
            join_cursor = arcpy.da.SearchCursor(jion_fc,["Country_Name",fieldname,"Total_Cases"])
            for x in join_cursor:
                row[1] = row[2]
                jion_cursor.updateRow(row)
                print tb
            arcpy.RemoveJoin_management(jion_fc)

Note for this script I use two def. One for the fieldname container and second is the main task here I attached. If there is better way for this project?


texts: Which Windows GIS editors support the creation of 3D shapefiles besides ArcGIS with 3D Analyst?

texts:
I need to find and easy and affordable way to generate 3D linear shapefiles in Windows so one of our users can inspect our tool. We incorrectly assumed that he had 3D shapefile source data available or had a way to produce it.

I found an ArcGIS Technical Article on how to convert a 2D shapefile to a 3D shapefile; however, it requires ArcGIS with 3D Analyst. I have ArcGIS available but do not have a 3D Analyst license, so I cannot replicate the steps from the article. The user also has ArcGIS available but I do not know if he has a 3D Analyst license. Regardless, I would like to test the process before sending him the article.

I have previously created 3D shapefiles using the OGR/GDAL C++ API and the OGR/GDAL Python API included in FWTools and OSGeo4W. I considered writing a simple program or Python script that can parse an input text file. The Python solution would require the user to install a Python runtime with GDAL support, so I am hesitant to take that approach.

MapWindow 4.7.5 has a 3D vector to 2D vector option in the GIS Tools | Vector menu, but not the other way around. I just checked and MapWindow is at version 4.8.3, but could not find any reference to 3D shapefiles or vector features in its online documentation.

Is there a Windows GIS editor (besides ArcGIS with 3D Analyst) that supports the creation of 3D shapefiles?


texts: QGIS - make selected hidden objects visible

texts:
Selected objects in QGIS are not visible as selected (i.e. not visible with standard colour yellow) if they are covered by overlaying objects.

This is the case for objects in underlaying layers as well as for underlaying objects within the same layer.

Is there another approach than rule-based symbology to make underlaying selected objects visible? I want to preserve the categorized symbology.

I am using QGIS, version 3.4.15.


texts: Disabling pop up from ArcGIS Portal after configuring attributes

texts:
Is there a way to disable configured pop-ups within ArcGIS Online after adjusting  decimal places to 8 for fields Lat and Long in pop ups?

When I disable pop up using remove pop up option decimal place value changes from '8 decimal places' to default '2 decimal places'.


texts:
I want to compose a CIR image in QGIS. Images are part of sample dataset downloaded from Micasense website.

I built virtual raster out of Red, Green and NIR rasters but the output file color scheme is different from publicly available ones. This is the image I treat as a benchmark:

In my case, combination of NIR, Red and Green generated following results:

Purple color distinguishes ground instead of vegetation what is clearly visible.

I was able to generate something close to benchmark after adding the Blue band which (according to sources I based on) is not necessary. In this case plants are more reddish than purple, but definetely it was a step forward.

Is there any specific order of the bands I need to follow to achieve the required output?

Or maybe - when non satellite data is being used - Blue band should be included as well to obtain CIR imagery like on the benchmark?


texts: How to create an "area of interest" polygon mask?

texts:
I've created a GP tool using ArcGIS that creates an "area of interest" mask from selected features.  Effectively it creates a new donut polygon layer where the hole was the previously selected features.  Can I replicate this task in QGIS?

Example:
For a specific map, I want to highlight a county within the state and mask the rest of the state and features outside the county with a gray, semi-transparent polygon layer above.  Conceptually I would do it similar to this.

User loads state, county, and river layer
User selects county of interest
Run a utility (if it exists) that exports all of the unselected features to a donut shapefile without the originally selected polygon.  If this layer mask was an "in memory" layer only available to QGIS, that would be just fine, too, maybe even better.

Does this type of tool or capability already exists within QGIS or will I have to write this as a custom function?

Here is how I did it in ArcGIS with ModelBuilder and the result I would be looking for, where the yellow layer and river layer exists statewide (all the way across the image), and the gray layer is transparent with a "donut hole", allowing the bright yellow portion to display through and draw the viewers attention the the area of interest:


texts: plot 3D graph based on raster pixel values

texts:
I am new to raster data. I have a raster tif file with population density value in each grid cell. I am interested in plotting a 3D graph based on raster values in ArcGIS or R. The similar graph is like this:

I have no idea how I can create such kind of graph. Do you have any idea?


texts: Generating raster from pixel values using ArcMap

texts:
I have been given a table which is a series of pixel location & values. For example:

   1  2  3
1  1  2  3
2  3  ?  2
3  2  2  1

Obviously the real table is large and also have missing values just like in example.

Pixel row and column number start from top left. Also pixel size is know.

How do I convert it to raster for visualization and analysis purpose using ArcMap 10.6?


texts: Meaning of uncertainty value returned by Soilgrid API

texts:
I am trying to wrap my head around the uncertainty value and quantiles returned by the Soilgrid 2.0 API.  I went through this document, but cannot find a clear answer.
As an example, I issue the following request to find pH of a certain (lat,lon) value:
http://rest.isric.org/soilgrids/v2.0/properties/query?lon=1.587148&lat=43.371551&property=phh2o&depth=0-5cm&value=Q0.5&value=Q0.05&value=Q0.95&value=mean&value=uncertainty

and get as results:
  'values': {'Q0.05': 52,
   'Q0.5': 77,
   'Q0.95': 84,
   'mean': 73,
   'uncertainty': 4}

(deleted the rest of the response since I don't see anything else relevant).
According to the FAQ, the interval [52, 84] contains the true pH value of the soil with 90% probability.
I'm interested in cutoffs at 5.5, 6.5 and 7.5 of the pH values, so this interval is not very informative. I sampled over 2000 points and see that this is the typical case, not an outlier, i.e. these intervals are always very wide.
Am I interpreting this correctly?
On the other hand I see the uncertainty = 4 value included in the response, and had hoped this would somehow offer an alternative, but I can't find what the exact definition of it is.
How is it calculated?
How can I use it?


texts: How to filter multiples features on QGIS Atlas?

texts:
I trying to create an atlas with two different features, but want to show were both have with the same field "ROTA".
I'm trying to use @atlas_featureid = $id on layer 'SetasRotas_dissolve'(line feature).
How could I show the layer 'quadras' the same way, just were the features have the same information?

.


texts: Indexing PostGIS table by tile boundaries

texts:
I have a PostGIS table with 2M rows, all Points. I'm creating tiles from the data, but it's quite slow.

Although I have the normal geometry indexes enabled on the table, I wonder if it's possible to index better according to tile boundaries (which are alwayws the same).

Or is the normal geom_idx taking care of this already?


texts: Enlarge the size of multiple polygons contained in a shapefile QGIS

texts:
I have a shapefile which contains many polygons and because I work on a large geographical extent, I'd like the polygons to be slightly bigger, for presentation purposes. Basically keep their extent and enlarge them by, say, 30% for example. I was thinking of using the SAGA "transform vector layer" tool. However I get lost when I need to put the X and Y coordinates, as shown in the picture below:

I understand that the scale factor will enlarge the polygons by whatever factor I want, but when it comes to the X and Y I wonder what I should put. I can't seem to find the x and y coordinates of my shapefile. I read this post Enlarge a Polygon without changing its shape or position but it gives details for doing so for just on polygon.


texts:
Does anyone know of an effective workflow to convert 3d-enabled shapefiles to X3D format? I have several projects containing anywhere from 10 to 5000 features (building sections) that I would like to convert into X3D format.  The shapefiles in question have topheight and baseheight attribute fields.

I have read these:

How can a 3D model of a building be displayed in a web-browser?

Georeferenced 3D Model Import

I have browsed this list of applications and resources to see what is available for import/export/conversion.  I have experimented with ArcGlobe, exporting my shapes to COLLADA using Layer 3D to Feature Class and Multipatch to Collada.  This tool limited me to exporting building sections or contiguous building sections (whole buildings).  I then used Meshlab to convert COLLADA to 3DX.  The only downfall with this is that I would have to convert thousands of building files to 3DX.

I would be interested in hearing of other workflows for similar situations.


texts:
When I query GeoServer at
http://localhost:8080/geoserver/rest/workspaces/mike/datastores.xml

I get no results, but I definitely have a data store under mike/.
Moreover, the stock geoserver installation came with a workspace called "nurc" with 4 datastores and none of them are listed either. What's the deal?
Viewing isn't a big issue, but when I go to delete a store via rest, it can't seem to find it. Again, the datastore is clearly there per the Geoserver web GUI.


texts: Is it any way to add more that one OpenLayers.DynamicMeasure?

texts:
I would like to make a feature to my webapp, which I could show sum of two(or more) Polygons..
But...
When Im drawing another polygon, earlier one disappeared, when I change

this.layer.addFeatures([this.polygon, this.point], {silent: true});

to

this.layer.addFeatures([this.polygon], {silent: true});

I can add only two, when Im drawing the third one, the first one did I draw disappearing...

when Im adding the second one, dynamicmeasure to first one is disappearing...

Someone has any idea to do that?

Would like to look something like that:


texts: Conflating Two Network Datasets in ArcGIS

texts:
I am looking to merge two network datasets in ArcGIS 10.0. I have an ArcInfo license and have trawled this forum but am looking for some clarification. I want to merge two road networks but only make changes to one of the datasets. The two tools I have been investigating are Integrate and Spatial Adjustment.

From this post:

Advise with 'Integrate' tool in ArcToolbox

It seems that Integrate actually changes both datasets. Is it possible to weight one dataset so high that it does not change?

Secondly, there doesn't seem to be a way to bulk create links to spatial adjust a very very large network. Does anyone have any recommendations?

Thank you all in advance,

Kel


texts: Address searching/geocoding using Leaflet

texts:
I am pretty new to coding.

I have been using Leaflet to create an interactive map, I have managed to pull in some data from a PostGIS database and have points on the map, downloaded some plugins from GitHub which enabled me to change basemap, turn on and off layers etc. So I have some experience of using plugins.

However I want the users to be able to enter an address and the map take them to that address. I have tried a few different ones which I have found around the web but I have struggled to implement it into my map, I got one sort of working, but the address search wasn't the best, mainly going to US addresses, and I need UK.

Anyway, a good address search is probably this one:

https://github.com/smeijer/leaflet-geosearch

But honestly I don't really know where to start. It mentions npm, which I don't properly understand and there is a ton of files.

I just find it all a bit overwhelming, in the Leaflet example is mentions code such as:

import L from 'leaflet';
import { GeoSearchControl, OpenStreetMapProvider } from 'leaflet-geosearch';

const provider = new OpenStreetMapProvider();

const searchControl = new GeoSearchControl({
  provider: provider,
});

const map = new L.Map('map');
map.addControl(searchControl);

Is it just a case of downloading all the files then adding that code into my existing JS code?

I think I have basically tried that and had no luck so I presume the answer is no.


texts: Selecting items from layer not within or touching selected polygon using ArcMap?

texts: Using ArcMap 9.3 I was curious if anybody has a script or vba tool that will select items from a layer that are not within a selected polygon or not touching the selected polygon.


texts: Spread overlapping points with similar but not identical coordinates

texts:
I've been looking for a solution for my problem for quite a while, but never found the answer.I have a lot of data point which are very close to each other, a lot of them have the same coordinates. The latter problem I can solve with the point displacement tool, however I still have remaining overlapping points.

Is there a way to spread the points that are overlapping, that have too close coordinates, but no identical ones with QGIS?


texts: Batch renaming of feature datasets, and feature classes based on new dataset name?

texts:
I need to create a python script (or model) that would first rename all the feature datasets in a gdb.  The feature dataset is in a set format and I need to change the prefix of the dataset.

For example: from "H2611111:xxx" to "gen26_xxx"
- where xxx is the string that I need to keep and prefix of "H2611111" is a constant that I need to replace with "gen26_".

Once this is completed, I would then need to rename each feature class inside each renamed dataset.  The feature classes needs to be prefixed with the newly renamed dataset separated by an underscore.

For example:

in dataset gen26_xxx:

from "test1" to  "gen26_xxx_test1"
from "test2" to  "gen26_xxx_test2"

in dataset gen26_zzz:

from "new1" to  "gen26_zzz_new1"

I am using ArcGIS Desktop 10 and 9.3.1.


texts: Using PyScripter with ArcPy: "import error, no module named _base"

texts:
I'm trying to use ArcPy in PyScripter. I don't have admin privileges on this computer (it's my work computer) so I have to use a portable version of PyScripter. I'm sure my boss would let me install it, but I'd rather not bother her about it unless I have to; I'd like to try to find a workaround first.

Initially, when I typed import arcpy into PyScripter, I was getting the usual no module named arcpy error. Then I followed the instructions listed on this site about accessing ArcPy from a portable edition of PyScripter.

I think I have my Python PATH set up correctly: it includes the paths to ArcGIS\Desktop10.3\arcpy, \bin, and \ArcToolbox\Scripts. But now, when I import arcpy, I'm getting the following error:

Traceback (most recent call last):
  File "<string>", line 301, in runcode
  File "<interactive input>", line 1, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
ImportError: No module named '_base'

I'm wondering if there's some conflict between my PyScript paths, and the paths that ArcMap uses when running python? When I type os.__file_ into the Python interpreter in ArcMap, it reads 'C:\\Python27\\ArcGIS10.3\\Lib\\os.pyc'. Is that not good...?

Most similar threads suggest that I uninstall/reinstall ArcMap to see if that helps, but again, that requires administrative approval and I'd like to hold off on that until I absolutely have to, because I'd like to solve this on my own first. Especially because there's no guarantee that will work.

I'm using ArcGIS Desktop 10.3 Advanced, and PyScripter 2.6.00 x64.


texts: Easiest way to display or draw low-detail maps on a WebApp

texts:
I need to display data sets, e.g. a bunch of point-based JSON files of weather forecasts, on a not-so-detailed map. The map should not be as detailed as a full-blown Google map (with roads, names of cities, rivers, etc). However, altitude contours/shades (e.g. 100m, 500m, 1000m) and 1 level of administrative lines (e.g. state/county) should appear, as well as the labels of those. For example:

The above image and several others like that were manually generated by me on ArcGIS. Now I would like to create a WebApp, where myself or another user can simply upload a JSON file and the points are automatically plotted on a map that looks like the one above. As far as I can see there are 2 ways of displaying a map on a WebApp:

Use existing maps made available by Google, Open Street Maps, etc.
Use a library to draw the map using shape/JSON files (e.g. jVectorMap).

Although 2 sounds more laborious than 1, I'm inclined to going for 2, because everything I've seen from Google or OSM is way too detailed for my needs. I can imagine plotting points and drawing county boundaries from shape/JSON files is relatively trivial with map drawing libraries. What worries me is plotting the elevation contours/shades. So my questions are:

Was it just me not looking properly for available maps? So is it possible to display a map like the one above with the likes of Google or OSM (which will make my life easier)?
If not, and I'll unfortunately have to go with option 2, are there shape/JSON files of elevation contours ready for download on the web?
If not, what JavaScript library can easily interpolate points so I can let the script generate the elevation lines/polygons automatically as it plots the points (the points in my data sets have an elevation attribute)?

I've mentioned JavaScript just because I'm more fluent in it, but I'm not particularly wedded to it. As long as I can run the code on a browser I'm happy!


texts:
What is the Quickest method for determining which postcode is 2 miles north of original postcode?

For instant L17.

I know how to determine the distance between 2 points as below, but the above formulae eludes me.

Code:

    public static final double PI = 3.14159265;
    public static final double deg2radians = PI/180.0;

    double lat1 = latitude1  * deg2radians;
    double lat2 = latitude2  * deg2radians;
    double lon1 = longitude1 * deg2radians;
    double lon2 = longitude2 * deg2radians;

    radd=2*Math.asin(Math.sqrt(Math.pow(Math.sin((lat1-lat2)/2),2.0) +
                  Math.cos(lat1)*Math.cos(lat2)*Math.pow(Math.sin((lon1-lon2)/2)
,2.0)));


texts: QGIS: Values in the wrong columns after a refactor field

texts:
Currently I am still in the process of building a model with a refactor field algorithm. Even though I have perfectly set up how to convert my data into the right expression however the data's is getting in the WRONG column.
Here is a screenshot about how the date looks like.

Keep in mind I am keeping the columns the same name and here are the formula's.

Nothing seems off so far but when I open the new made layer....

As you noticed the value's are not in the right column, even though the formula is correct? What is going on here?
Edit 2: For now I got around this by Splitting my table of the shapefile up into multiple pieces, then make those pieces go through the each seperate process. And then rejoining them by attribute based on a primary key. established in the beginning. So for now the cause seems to be that are just too many columns in the shapefile. Why this is, someone should explain it to me.


texts: How to delete nodes that are unnecessary

texts:
I got a OSMNX graph, and put edges and nodes in two separated GeoDataFrames.
Now I want to delete the nodes that dont intersect with the edges, or nodes that are not very, very close to the edges.
I have the following:
nodes = gpd.read_file(NODES, encoding = 'utf-8')
streets = gpd.read_file(STREETS, encoding = 'utf-8')

EPS = 1e-12
streets_unary_union = streets['geometry'].unary_union

nodes['intersects'] = nodes['geometry'].apply(lambda x: x.intersects(streets_unary_union) or streets_unary_union.distance(x) < EPS)

This simply takes all the streets, and make an unique geometry, then compare every node with this unique geometry. So if a node and the geometry are intersecting or they are very close, I will keep whith that node.
The problem with this is takes TOO long (2 hours approximately) to eliminate maybe 100 or 200 nodes from a set of 15k nodes and 23k edges aprox. I am pretty sure that there is a solution to make this faster.


texts: Where can I download OpenStreetMap data by geographic region?

texts: I want to use OpenStreetMap data for an ArcEngine application I'm working on, and I need the data to be stored locally. I don't want to download the entire planet.osm file, but rather by state, county, region, etc. Are there any resources where I can download OSM data by geographical region?


texts: Leaflet points off from correct spot on map

texts:
I am working on updating our map from OpenLayers 2 to Leaflet. I have my own set of tiles that are working correctly on OL2 but on leaflet any point I draw seems to be incorrect (further south and east than it should be). The projection is EPSG:4326. Since the points aren’t drastically far off from the actual point I am not sure what is going wrong. I used https://epsg.io/map#srs=4326 to find the static lat long.

Through trial and error I noticed that the closer to the northwest corner of the map I got the amount the point was off was smaller. I also was able to “solve” the problem by updating the tile size from 512 to 512.58 even though the images are 512px.

I put a code example up on glitch since there is a large amount of code:
https://glitch.com/edit/#!/jagged-cricket
client.js holds the pertinent code. At the top of the file you can toggle comments for the two declarations tileSize to see the difference.

I am trying to figure out why the GPS points are incorrect and what I can do to fix it.


texts:
This is something that I'm almost ashamed to ask but I can't seem to get it to work for the life of me.

I have a road layer with segments, each segment has a Road ID and a segment type.

I would like to join all the segments together, for each Road ID into one linestring but only when they are the same type and are touching (all the lines are snaped together).

Road ID - Type
   1       L
   1       L
   1       T
   1       L


texts: I'm trying to use historical dates to build a torque map on Cartodb.com, with data going back to 8000 BC. But the date format doesn't seem to convert anything bellow 0100 01 01 (1st Jan 100 AD), and I'm not even sure how to specify negative dates.


texts: Generate rectangular fishnet or vector (grid cells) shapefile in R?

texts:
I would like to create a polygon of 20 x 10 degree graticules from 180, -180 to 90, -90 degrees.

To do this in QGIS, I followed:
Vector creation tools > Create grid
[Grid extent: -180, 180, -90, 90]
 [Horizontal spacing: 20, vertical spacing: 10]
And selected 'rectangular polygon' rather than 'rectangular grid'.

I got the purple grid/vector which was 18 rectangles across (360/20) in the picture below.

Purple: grid produced by QGIS, 18 rectangles across; Black: grid by code below, 19 rectangles across.

I then tried to replicate this grid using R. Similar to Generating grid shapefile in R?, (however, covering the whole extent of long and lat, and resulting in a rectangular grid).

I used:

    r <- raster(extent(matrix( c(-180, -90, 180,  90), nrow=2)), nrow=20, ncol=10,
            crs = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
r[] <- 1:ncell(r)
summary(r)
print(r)
plot(r)

I also need the product as a polygon class and not spatial lines or grid.

    r2 = as(r, "SpatialPolygonsDataFrame")
    class(r2)
    writeOGR(r2, dsn=getwd(), layer="trial", driver="ESRI Shapefile",
    overwrite_layer=T)

I shouldn't end up with 19 rectangles across if this code was using degrees, so I am not sure how that code works, or where I have gone wrong.

I also need this as a polygon, not lines, so tried:

grid_20_line = SpatialLines2PolySet(grid_20)
grid_20_poly = PolySet2SpatialPolygons(grid_20_line)

Many square vector's (such as 10 x 10 degree cells) like this can be downloaded, but I would like to know the options for making rectangles in R for specific degrees.

And to do this in QGIS is very simple, so I am curious if there is an R solution.


texts:
i have downloaded MODIS Data for fog estimation for the whole month of December 2014 from laads website.
The files i received are 90 for mod09 and 180 for mod03 for the same period. how do i relate which Geo-location file (mod03) is related to its mod09 file? can anyone tell? i have been trying to run a batch process using MRTSwath tool for which i have to create a parameter file for all the files. i have tried to select Geo-location file but i am  unable to relate which mod03 goes with which mod09.


texts:
A newbie to python here. Ive been trying to query all layers on a mxd and have sucessfully implemented a script by advice on here. What I need to do now is to firstly make the query a parameter that the user inputs (always from the same field) and also an option to clear the sql query from the layers.

Currently I have:

import arcpy

#Variables to form query syntax
#field in Attribute table
field = 'Source'
queryField = '"%s"' % field.strip()   #add double quotes field (for query syntax)
#value in specified field
value = "'Integrated Geological Map'"
#concatenate query syntax
queryStr = str(queryField) + "=" + str(value)
#--------------------------------------------
mxd = arcpy.mapping.MapDocument("CURRENT")

for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.supports("DEFINITIONQUERY"):
        lyr.definitionQuery = queryStr
arcpy.RefreshActiveView()
del mxd


texts: Is MongoDB more suitable than PostGIS as backend for geo-enabled Django website?

texts:
I am trying to select a backend for a geo enabled website written in Django.

Is MongoDB an easy possibility or stick with PostGIS?

What are the key considerations to choose one or the other if yes?

I can't find information on the web to help with this question.


texts:
I have a tag bit of a problem I made a 3d model of a city (about 21000 models) and using the city engine web scene viewer from Esri is slow and eats up a lot of resources unfortunately (and I'm talking about the solid non textured models and I'm not not adding the layers from my analysis) so I can't use the platform to make a smooth presentation, so I was wondering if there is any way to convert my 3D model to a stand alone application that can be run directly from my PC.

I looked into maybe finding a way to move my model to a Java platform and unfortunately I couldn't find any "stupid proof" software because to my great shame I am a potato when it comes down writing Java programs.


texts: OS VectorMap Local Layer Definition Files

texts:
Would anybody be so kind enough to share their QGIS QML-File for the following OS VectorMap Local layers? SLD file formats would work as well. Alternativly, where do you buy your OS VML data from? The site I got mine don't have the files I need yet.

Boundary_Line
Building_Area
Building_Line
Building_Text
Countour_Line
Height_Point
Height_Text
Landform_Area
Landform_Line
Misc_Text
Point_Misc
Road_Line
Road_Text
RoadCLine
Settlement_Area
Settlement_Line
Vegetation_Area
Water_Area
Water_Line
Water_Point
Water_Text
Woodland_Area


texts: Raster reprojection code not working in PyQGIS

texts:
I swear this used to work. I don't get any errors which is the confusing part- it just regurgitates the same layer in its original projection (in this case epsg 32630).
Version of Q is 3.10 A corunya.
raster = "raster.tif" #replace with a tif of your own not in 27700
crs = 27700 #british national grid

#reproj raster layer
processing.run("gdal:warpreproject",
{'INPUT': path + raster,
'SOURCE_CRS':None,
'TARGET_CRS':QgsCoordinateReferenceSystem("'" + 'EPSG:' + "'" + str(crs) + "'"),
'RESAMPLING':0,
'NODATA':None,
'TARGET_RESOLUTION':None,
'OPTIONS':'',
'DATA_TYPE':0,
'TARGET_EXTENT':None,
'TARGET_EXTENT_CRS':None,
'MULTITHREADING':False,
'EXTRA':'',
'OUTPUT':path + raster})
rasterMap = iface.addRasterLayer(path + raster, "raster")

Can you help me?


texts: Vector objects "merged" in PDF with QGIS

texts:
When I create a PDF file with QGis and open it in Adobe Illustrator, I cannot select the polygons one by one but only all together... See picture below

With a PDF exported with another GIS software, in Adobe Illustrator, I can select the polygons one by one (so a publishing compagny can change the colors of each polygons)... See picture below

Is there a way to export PDF with QGis in order to be able to select the polygons one by one with Adobe Illustrator (or other publishing software...) ?


texts: Editing dynamic text in ArcGIS Pro to get 100k Grid zone labels?

texts:
While making maps with MGRS I need to have a label in each corner of the map frame with the 100k grid square labels.

So far i have updated them manually, but after i've started using ArcGIS Pro i found that it is possible to extract Mapframe coordinates like "Upper left".

The syntax looks like this:
<dyn type="mapFrame" name="Map Frame" property="upperLeft" units="dms" decimalPlaces="0"/>

By pure curiosity i replaced "dms" with "mgrs", and it gave me a MGRS Grid without decimals.

<dyn type="mapFrame" name="Map Frame" property="upperLeft" units="mgrs" decimalPlaces="0"/>

Resulting in: 32VMH

Basically i would like to know to know if it is possible to remove the Grid zone designator "32V" so i end up only having "MH" left.


texts: Looking for a website to produce a file using UTM or LL or LL to UTM or general

texts:
Is there a website that allows me to upload my GPS file from UTM to lat and long to produce a new output file? I am looking for one to run a batch a list of UTM or LL to convert them in either way.

I am aware of know how to do perfrom this in ArcMap, but what if you wanted  them in a hurry like doing that for ArcGIS Explorer online.


texts: writeLAS writes corrupted file: 'end-of-file' after 10468 of 10474 points

texts:
I am seeing strange write behavior with lidR. The outputs from lidR are compressed to fall on a single line. I vaguely recall discussing this with JR before, but cannot recall a solution.

#ok
las0=lidR::readLAS("c:\\temp\\tile1.las")
lidR::plot(las0)

#not ok
lidR::writeLAS(las0,"c:\\temp\\tile_lidR.las")
las1=lidR::readLAS("c:\\temp\\tile_lidR.las")
#> ERROR: 'end-of-file' after 10468 of 10474 points
#> Warning messages:
#> 1: There are 113 points flagged 'withheld'.
#> 2: There are 113 points flagged 'synthetic'.
lidR::plot(las1)

And here are the summaries if I look at the file meta info in R:

> summary(las0)
class        : LAS (LASF v1.3)
point format : 2
memory       : 872.4 Kb
extent       :1007414, 1007736, 823583.8, 823586.9 (xmin, xmax, ymin, ymax)
coord. ref.  : NA
area         : 500.825 units²
points       : 10.5 thoushand points
density      : 20.91 points/units²
names        : X Y Z Intensity ReturnNumber NumberOfReturns ScanDirectionFlag EdgeOfFlightline Classification Synthetic_flag Keypoint_flag Withheld_flag ScanAngleRank UserData PointSourceID R G B
File signature:           LASF
File source ID:           0
Global encoding:
 - GPS Time Type: GPS Week Time
 - Synthetic Return Numbers: no
 - Well Know Text: CRS is GeoTIFF
 - Aggregate Model: false
Project ID - GUID:        00000000-0000-0000-0000-000000000000
Version:                  1.3
System identifier:        Trimble
Generating software:      Inpho
File creation d/y:        254/2015
header size:              375
Offset to point data:     375
Num. var. length record:  0
Point data format:        2
Point data record length: 26
Num. of point records:    10474
Num. of points by return: 10474 0 0 0 0
Scale factor X Y Z:       0.001 0.001 0.001
Offset X Y Z:             1007436 823586 775
min X Y Z:                1007414 823583.8 722.348
max X Y Z:                1007736 823586.9 821.588
Variable length records:  void

> summary(las1)
class        : LAS (LASF v1.3)
point format : 2
memory       : 871.9 Kb
extent       :1007502, 1007829, 823586, 824962.3 (xmin, xmax, ymin, ymax)
coord. ref.  : NA
area         : 180387.3 units²
points       : 10.5 thoushand points
density      : 0.06 points/units²
names        : X Y Z Intensity ReturnNumber NumberOfReturns ScanDirectionFlag EdgeOfFlightline Classification Synthetic_flag Keypoint_flag Withheld_flag ScanAngleRank UserData PointSourceID R G B
File signature:           LASF
File source ID:           0
Global encoding:
 - GPS Time Type: GPS Week Time
 - Synthetic Return Numbers: no
 - Well Know Text: CRS is GeoTIFF
 - Aggregate Model: false
Project ID - GUID:        00000000-0000-0000-0000-000000000000
Version:                  1.3
System identifier:
Generating software:      rlas R package
File creation d/y:        0/2015
header size:              375
Offset to point data:     375
Num. var. length record:  0
Point data format:        2
Point data record length: 26
Num. of point records:    10468
Num. of points by return: 1209 1185 1327 1223 1385
Scale factor X Y Z:       0.001 0.001 0.001
Offset X Y Z:             1007436 823586 775
min X Y Z:                1007502 823586 -2146709
max X Y Z:                1007829 824962.3 2148193
Variable length records:  void

The las file can be found here

@JR reminded me that the lastools documentation also addresses this case (even the number of bytes) explicitly. I just navigated to the correct directory and overwrote all of the header fields using the command below for the lasinfo tool. I decided to just hardcode changes to the las file headers so that I don't forget and run into this with the same files again.

Martin's code below is updated to use wildcard:

    lasinfo -i *.las -set_header_size 235

His code also came with the warning:

CAREFUL! sets the header size field of the LAS header to 235 without checking
whether this will corrupt the file.


texts: Split features maintaining ordnance survey map details in QGIS

texts:
I'm trying to split a polygon drawn over an ordnance survey map area that represents the total land of a farm, in order to create smaller polygons that represent individual fields. I wish to create the smaller polygons based on the exact field boundaries shown on the ordnance survey map.
When I select the polygon to split, it turns solid yellow, and I can no longer see the features on the map underneath. Is there are way to adjust the opacity of selected polygon in order to be able to cut along the ordnance survey map lines?
I'm aware the vector layer opacity can be altered via right click > properties > symbology. But when highlighting the polygon with the Select Features tool, to be cut using Split Features, it turns solid yellow.


texts:
IMap map = axMapControl1.ActiveView.FocusMap;
        IFeatureSelection fSelection = map.get_Layer(0) as IFeatureSelection;

        ISelectionSet selSet = fSelection.SelectionSet;

        ICursor cursor;
        selSet.Search(null, true, out cursor);

        IFeature feat = ((IFeatureCursor)cursor).NextFeature();

Now i want to create buffer to my cursor.
How can i do it?


texts:
First, I would like to apologize for the mistakes. My English is not very good. I read a lot but I don´t find the answer.
I'm trying to put a scalebar in a very simple map but the measurement is not correct. I'm going to describe the process (spanis version 2.10.1):

1) I open QGis -> project -> properties

2) General -> measurement tool WGS84 (SRC transformation connected)

3)SRC on the fly activated (SRC 3857 and also tried with 4326 similar results)

4) New Shapefile -> line shapefile -> I create a line of 10.000 m length (measured with the qgis measurement tool)

5) Print composer -> new map -> escale ej 1:10.000 -> add scale bar.

6) Export to PDF

7)I print the map (from PDF to printer with pdf not scaled) and the scale with the scalebar and is not correct


texts: Adding 3rd party grass script into qgis processing toolbox on Mac?

texts:
I am trying to integrate this script http://www.mergili.at/randomwalk.php into QGIS on Mac, but I am having a few problems.

I have already seen How to add my own GRASS algorithms to Processing?

But the answer is not really useful, as that is not dealing with my problem on Mac.

I have also seen this post in the OSGeo mailinglist, and in fact the problem seems similar:

http://osgeo-org.1560.x6.nabble.com/Adding-grass-commands-to-the-processing-toolbox-td5196428.html

However, as the author says in the second email, he did find a solution for mac but not for windows.

Having considered all that, my question is:

how do you install an external script like randomwalk on QGIS for mac?

In particular, what are the specific steps one has to follow?

1) on Mac, in which folder should I copy the script I want to integrate?
Somewhere in the application folder? somewhere in the user/.qgis2/ folder?
Note that I use a version of QGIS installed from binary, and I use GRASS 7, the version integrated in the app folder.

2) on Mac, where should I put the .txt description file?
In /Applications/QGIS.app/Contents/Resources/python/plugins/processing/algs/grass7/description/ or somewhere else?

3) on Mac, where should I put the html file of the algoritm?

4) the zip file of the algoritm contains the following files:

r.randomwalk.cdf.r

r.randomwalk.main.c

r.randomwalk.map.r

r.randomwalk.mult.py

r.randomwalk.multval.r

r.randomwalk.py

r.randomwalk.roc.r

which one should I put where in QGIS on mac? Especially which one should I put in the folder of 1) here above?


texts:
I have installed GeoServer as part of the OpenGeo package. I am trying to create my own application but I am having problems. At first I couldn't save over my html files. Using Notepad2 I can now overwrite my files but the changes do not appear when looking with a browser.

I am guessing this is because the files are being cached somewhere on the server (not in the browser - I've checked that). This could make sense for a live project but is very frustrating for development. Is there some way to bypass the cache?

Also - and this might sound a little dumb - GeoServer is the component that's serving up the HTML files, right? It's the only server in the bundle but the only information I can find about it is about serving up geographical data (which is obviously its main feature).


texts: Import csv file and use "toggle editing" and "field calculator" without Saving it as a Shapefile.

texts:
I am importing a .csv file in QGIS and I have also made the *.csvt file where I have specified my data types. I still cannot use "Toggle editing" and "field calculator".Whether I must save it as a shapefile and import it again?
Is there any way to work with the .csv file without saving  it as a shapefile and import it again?


texts: Cartographic Representations Load Rather Than Feature Symbology

texts:
We use ArcSDE to allow multiple users (both in my office and elsewhere) to access feature classes that my office maintains. We also use cartographic representations for many of our feature classes.

For some reason, those feature classes which have cartographic representations will always load the representation as the default symbolization when they're imported into ArcMap (rather than feature symbology).

This is a problem for GIS users outside our office. When they bring in our feature classes without using a layer file, they see our representations, which are not an accurate representation of the spatial location of the data, rather than the feature symbology. This can throw them off.

Is there any way to make the features load with default symbology rather than with their representations?


texts: Calculating zonal statistics for each polygon in shapefile using GEE

texts: I have shapefile of counties and want to calculate mean NDVI for each. I know reducing connected components and ee.reducer.mean can be helpful in GEE but it wants it as CSV for further analysis in R pl.


texts: Getting values of GeoJSON after is loaded in OpenLayers6 with DragAndDrop

texts:
I am using the DragAndDrop functionality of OpenLayers6 in order to load GeoJSON  data in the browser. Once I load the data, I get the map.

Now I am interested in using the same functionality for filling up also other elements in the page (e.g. charts).

Below part of the code:

var my_DragAndDrop = map.addInteraction(new DragAndDrop({
  source: source,
  formatConstructors: [GeoJSON]
}));

//! [json data outside the map]
source.on('addfeature', function(evt) {
    console.log(source)
});

I am trying to acquire the JSON values after the map is loaded. I am not sure, which event listener to use but it seems like that addfeature does the trick. Do you know what would be the proper way to retrieve the JSON values inside this event listener?

UPDATE

Based on Mike's comments I have managed to retrieve the geoJSON for the layer as below

var listenerKey = source.on('change', function(e) {
  values = new GeoJSON().writeFeatures(source.getFeatures());
  console.log(JSON.parse(values));
});

However this code returns all the geojson along with the coordinates etc. How can I retrieve only the properties of the geojson? For example something like:

var id = source.getFeatures('id');


texts: MySQL 8 MBRIntersects 10 times slower than PostGIS equivalent

texts:
I'm trying to migrate a PostGIS database to MySQL 8 and am having a big performance hit when it comes to MBRIntersects.

Using Mapbox to render vector tiles, I need to extract geometry intersecting some specific bounding box from a total of 80k features.

In PostGIS, using the query below I get a total execution time of ~230ms (~30ms for subsequent queries, since the results are probably cached)

 SELECT gid, ST_AsGeoJson(geom)
 FROM table
 WHERE geom && ST_MakeBox2D(ST_MakePoint(), ST_MakePoint())::geometry;

However, in MySQL 8, using the query below I get a total execution time of ~620ms and no caching appears to be taking place as subsequent queries take the same amount of time.

SELECT gid, ST_AsGeoJson(geom)
FROM table
WHERE MBRIntersects(ST_PolygonFromText(), ST_SRID(geom, 0));

An EXPLAIN of the query above doesn't show any indexes being used. The table was created as described below:

CREATE TABLE IF NOT EXISTS table (
    gid INT PRIMARY KEY AUTO_INCREMENT
);
ALTER TABLE table
ADD COLUMN geom MultiPolygon NOT NULL SRID 4326,
ADD SPATIAL INDEX(geom);

As a bonus, the PostGIS query returns 3 rows, as opposed to MySQL's which returns only 2.

Is there anything I'm doing wrong? Is there a better way to query for map tiles?


texts: Creating Polygon Shapefile from list of X,Y coordinates using Python?

texts:
I have a list of X,Y coordinates from a csv file, that represent a polygon. I´m trying to create a Polygon-Shapefile from this list. I´ve been trying around and found a possbility to write the list to a Point-Shapefile.

Unfortunately that is not enough for me. Is there any way to get the coordinates in a Polygon-shapefile straight away?

Following Brad´s suggestions I tried the following code:

for i in list:
    w = shapefile.Writer(shapefile.POLYGON)
    w.poly(parts=[list])
    w.field('F_FLD','C','40')
    w.field('S_FLD','C','40')
    w.record('First','Polygon')
    w.save('C:/Users/.../Desktop/Shape')

Unfortunately I´m getting an error message:

ShapefileException: Failed to write shapefile bounding box. Floats required.

Looks like there is a problem saving the shapefile to disk.
This seems to be a similar question, but I couldn´t work out, how to get it going in my case.


texts: How to filter the MouseWheel event in a QGIS C++ plugin?

texts:
I’m developing a C++ plugin for Qgis and I want to filter/override the mouse-wheel event.
I created a “maptool” to select a polygon feature on a vector layer, the feature has two attributes : an id & an integer H.
I want to override the mouse wheel event so that once I select a polygon, the wheel will allow me to change (increment/decrement) the value of attribute H and not zoom/unzoom the mapcanvas!
I created and “eventFilter” on my plugin’s base class which I install on the mapcanvas (QgsMapCanvas::installEventFilter()) once my maptool is activated, works fine to filter a key press for example but when it comes to the mouse-wheel it seems that it bypasses the eventFilter and does the usual zoom/unzoom action !!

Any ideas on how to solve this problem?

Thank you !


texts:
I am learning how to use QGIS on v.2.4. When opening an attibute table, it does not have any clear "look for" search bar as seen in older versions in screenshots and videos. There is now a (SQL?) query builder that takes much longer to operate than a simple search bar.

How to efficiently search within an attribute table with QGIS 2.4+ ?


texts: How to trace a line layer (road network) through points?

texts:
I have a road network (purple), Point files (green) and a beginning point (yellow).

I want to trace the point files based on the road network.  Think of the points as telephone poles, but what I want is a map showing telephone lines (line shapefile).  There is a numbering scheme for the "telephone poles" but it isn't great and for this instance I would just as well assume they are not numbered.

Does anyone have a solution? One that looks pretty good is just buffering the points and then clipping the road network from the buffers.  But I want something more complete.  It needs to be automated since there are 12,000 of the "telephone poles"


texts: Finding orientation -direction of polygon

texts: I have one polygon layer and another is point layer,I want to find out orientation automatically of line of polygon which is parallel to the street and  closest to the point.i am using QGIS 2.0 .is it any  plugin to find out this? Without scripting it can be done?


texts:
I've been working in a Named Map (NM) that uses a different marker over a point of coordinates in Carto.

Everything works as it should, except the cursor. I can click and hover with it and works as desired, but I cannot change the type when it is over the feature.

I tried with @javisantana code but it doesn't work with my NM. Maybe the size of the feature is very small and that could be the reason. If so, how can I make it bigger so the cursor change every time the cursor hover it? Or, how can I do so the cursor change when it is over the marker?

The code is the following:

NM CSS:

#layer[tipo_finca='casa_verde']{
    marker-file:url(http://wonderland/static/images/casa_verde.png);
    marker-allow-overlap:true;
}
#layer[tipo_finca='casa_rojo']{
    marker-file:url(http://wonderland/static/images/casa_rojo.png);
    marker-allow-overlap:true;
}
#layer[tipo_finca='edif_verde']{
    marker-file:url(http://wonderland/static/images/edif_verde.png);
    marker-allow-overlap:true;
}
#layer[tipo_finca='edif_rojo']{
    marker-file:url(http://wonderland/static/images/edif_rojo.png);
    marker-allow-overlap:true;
}
#layer[zoom>14]{
    marker-width:8
}
#layer[zoom>16]{
    marker-width:10
}
#layer[zoom>17]{
    marker-width:12
}
#layer[zoom>18]{
    marker-width:16
}

NM call:

function addCursorInteraction(layer) {
    var hovers = [];

    layer.bind('featureOver', function(e, latlon, pxPos, data, layer) {
        hovers[layer] = 1;
        if(_.any(hovers)) {
            $('#map').css('cursor', 'pointer');
        }
    });

    layer.bind('featureOut', function(m, layer) {
        hovers[layer] = 0;
        if(!_.any(hovers)) {
            $('#map').css('cursor', '');
        }
    });
}

function createNamedLayer(layerName, endName, interaction=true, interactivity="", options={}){
    var named_map_options = {
            name: 'generico_'+endName,
            layers: [{
                layer_name: layerName,
                interactivity: interactivity
                }],
            params: options
            };
    cartodb.createLayer(window.map, {
        user_name: carto_username,
        type: 'namedmap',
        named_map: named_map_options,
        })
        .addTo(window.map)
        .done(function(layer) {
            window.layersOn[layerName+'Layer'] = layer;
            layer.on('error', function(err) {
                console.log('An error ocurred after : ' + err);
            });
            if (interaction && endName=='fincas'){
                layer.getSubLayer(0).setInteraction(interaction);
                addCursorInteraction(layer);
                layer.getSubLayer(0).on('featureOver', function(e, latlng, pos, data) {
                    $(".external-popup").html(createPopUp(data));
                });
                layer.getSubLayer(0).on('featureClick', function(e, latlng, pos, data) {
                    toggleLayer(data.idtramo,'fincas_tramo', false, "", options={'idtramo': data.idtramo});
                });
            }
        }).on('error', function(err) {
            console.log("An error occurred: " + err);
        });
}


texts: How do I change default raster properties 'min/max values' settings from "Estimate (faster)" to "Actual (slower)"?

texts: I'm tired of updating it manually for each raster. The exact issue is listed as "solved" and "Should be fixed in QGIS 3" in this bug report, but I cannot find the correct settings to change: https://issues.qgis.org/issues/11974


texts: How do I transfer attributes from one raster into the attributes of another point shapefile?

texts:
I am trying to assess the accuracy of multiple classifications using the "Create Accuracy Assessment Points" tool in ArcGIS Pro 2.4.2. I classified each image using 3 different classification algorithms into "leaves", "soil", and "shadows." I have plots like the ones pictured below, to which 500 points were randomly assigned. I then went through and labeled the feature that each point fell on (without looking at the classified image) and labeled the points as either "leaves", "shadows", or "soil."

I should say that the "Create Accuracy Assessment Points" tool picks one of the classified rasters and puts points on the raster, which I then hid from view and used the original RGB image to label my ground-reference points. Therefore, after ground-referencing, you will have two columns in the attributes table: The classified points and the ground-reference points. You can then compute an error matrix to assess the accuracy of your classification. Here's classified raster 1, so that I can more clearly explain what is happening:

Let's say I want to use these same points to label the other classified rasters, so that I don't have to re-label them for a different image. I want my ground-reference labels to carry over to the next raster, while generating a new set of labels for where the points fall on the other rasters. How can I do this?


texts: View has no records when viewed in ArcCatalog

texts:
I have created a database view in an Oracle-backed Enterprise Geodatabase. I can see data in both of them when I view them using SQL Developer. However, when I look at the view in ArcCatalog (version 10.8), there are no records.
I have attempted to create this view in both SQL Developer using the CREATE VIEW command (and registering with the database), as well as creating it in ArcCatalog directly.
The view, which shows which fields have domains for all feature classes and tables, has the following definition:
SELECT
i.Name AS "Object",
EXTRACTVALUE (xVal.COLUMN_VALUE, 'GPFieldInfoEx/Name') AS "Field",
EXTRACTVALUE (xVal.COLUMN_VALUE, 'GPFieldInfoEx/DomainName') AS "Domain"
FROM SDE.GDB_ITEMS_VW  i JOIN SDE.GDB_ITEMTYPES it ON i.Type = it.UUID,
TABLE (XMLSEQUENCE (XMLType (Definition).EXTRACT('//GPFieldInfoEx'))) xVal
WHERE i.NAME IS NOT NULL AND i.NAME LIKE 'AMIS%' AND EXTRACTVALUE (xVal.COLUMN_VALUE,
'GPFieldInfoEx/DomainName') IS NOT NULL
ORDER BY "Object", "Field"

Results when viewing in SQL Developer:

Results when viewing attribute table in ArcGIS:

The user that created the view has read privileges to the SDE tables that are being queried in the SELECT statement. I'm connecting to the database in ArcGIS using that same user account.
Why can't I see the results in ArcGIS?


texts: Create an SDO_GEOMETRY view from a non-spatial table?

texts:
Let's say I have an Oracle database table with latitudes and longitudes. I don't have access to modify the schema of this table, or even create tables. However, I can create views and indexes on those views. I purpose the following problem:

Can I create a view that takes in two fields, and creates an SDO_GEOMETRY (point in this case) "on the fly", or does the field have to be based upon an already existing column?


texts: Measuring distances between simultaneous points

texts:
I am working with GPS data and so I have UTM's with DATE/Time information.  I have 2 groups of species (moose and wolves).  I want to join the information from moose to wolves that match in time.  So, location 1 from moose 1 was at 2007-03-26 14:33:49 to all wolves that were recorded at approximately the same time.  Approximately is key - it means I will have to have a time window or buffer to look for all wolf locations that were within 30 minute buffer around that time.

I'm looking for a script or tool that will set a window buffer +/-X min and will be able to "batch" process.  Ive at least 30 moose and 30 wolves - so doing the matching one pair at a time is not helpful.  Once Ive got the date/time matched, I then want to calculate the distance between the XY locations of moose and wolf and the difference in time.  I would like an output like:

individualmooseID | mooseDate | mooseX | mooseY | individualwolfID | wolfDate | wolfX | wolfY | Distance(m) | TimeDiff (min)

The mooseID may match up to several DIFFERENT wolfIDs for the same time period.  Any suggestions would be appreciated.  I have written a code for R but it is not working see my question: https://stackoverflow.com/q/15646365/675742 and I will have to bring the data into ArcGIS at some point so if I can skip R and do it all in ArcGIS then GREAT!


texts: Multi-part Geometrical Intersection error

texts:
I am working with intersection of polygon and line segments (continued from a previous question).

When a Line intersects with a Polygon, the result is a LineString;
When a LineRing intersects with a Line, the result is a MultiPoint.

While in most cases, the intersection is only in two points, the case I have encountered is multiple intersections (in figure).

The indicated yellow lines are the ones that intersect only at two points, and thus result in no errors. But when the program begins intersection of the LineString and LinearRing where there is multiple intersections, the following error shows up.

NotImplementedError: Multi-part geometries do not themselves provide the array interface

Would there be any way to work around this? I am not at liberty to share the code, but any specific, additional information can be provided.

To provide some additional context, I am appending each intersection resultant MultiPoint and MultiLineString to a 'list' of previous results, respectively. So while the previous results were only a pair of XY coordinates, multiple intersections give multiple results. The line of code that results in the error is when I try to convert the 'list' of LineString (intersection) results to a MultiLineString using MultiLineString()

For instance, multi_line is the list of intersections resulting from line.intersection(polygon). This list needs to written to a MultiLineString for creating a new shapefile.

MultipleLine = MultiLineString(multi_line)


texts: How can one obtain one-sided buffer (left/right) of a line geometry in GEE? I haven't found any specific function to do that.