texts: Python 2.7, PgAdmin III & BASH 4.3.48: Error Invalid Provider when calling py script in bash script

texts:
I am working in Ubuntu 16.04 LTS

This is my bash script;

# Binarize raster for later polygon creation

path=/home/rose/Desktop/test/DSM_BM24_2017_1000_4735.tif
pathdir=$(echo $path | cut -d "/" -f 1,2,3,4,5)

gdal_calc.py -A $path --outfile=$pathdir/binary.tif --NoDataValue=-9999 --calc "1 * (A != -9999)"

# Polygonize raster

binary=$pathdir/binary.tif
b=$(basename $binary)
basebinary=$(echo $b | cut -d "." -f 1)

gdal_polygonize.py $binary $pathdir/polygon$basebinary.shp polygon$basebinary

# Make EPSG:2193 projection file for polygon

ogr2ogr -a_srs EPSG:2193 -f "ESRI Shapefile" /home/rose/Desktop/test/finalpolygonbinary.shp /home/rose/Desktop/test/polygonbinary.shp

# Define variable to import to py and postgis script 'pypostgis'

polygon='$pathdir/finalpolygon$basebinary.shp'

# Call python script

python pypostgis.py $polygon

This is my python script that is being called in my bash script, which grabs the polygon shapefile and imports it into a table in PgAdmin III;

import psycopg2
import os
import sys
from qgis.core import QgsVectorLayer, QgsVectorLayerImport
from qgis.core import QgsDataSourceURI, QgsVectorLayer

# import layer into database shp2pgs function

def shp2pgs(layer):
    conn = psycopg2.connect("dbname='rosespace' host='localhost' port = '5432' user='rose' password='postgres' ")
    cursor = conn.cursor()
    uri = "dbname='rosespace' host='localhost' port=5432 user='rose' password='postgres' table=\"public\".\"%s\" (geom) sql=" %layer.name().lower()
    importvector = QgsVectorLayerImport.importLayer(layer, uri, "postgres", layer.crs(), False, False)
    print importvector

# Import and use $polygon variable from bash script for layer, which will eventually be called by the function above

shapefile = sys.argv[1]
print shapefile

basename_shp = (os.path.splitext(os.path.basename(shapefile))[0]).lower()
layer = QgsVectorLayer(shapefile, basename_shp, 'ogr')

#Call function with shapefile variable - layer, originally from above bash script

shp2pgs(layer)

When I ran the bash script, this was the output of print importvector;

print importvector
(9, u'Unable to load postgres provider')

Would any of you happen to know what this error is pointing to / means and if there is a solution?

I'm guessing it's something to do with my imported variable from bash - sys.argv[1] but I've checked it, and it is a string type. I have also put quotes around the variable and it still didn't work.

I have also checked the python script substituting sys.argv[1] with a normal string filepath and it worked perfectly within python console in QGIS 2.18.

Update
In my bash script I have also put double quotes around each variable expansion, ran the script and had the same error message come through.


texts: label vector line with multiple attributes in QGIS

texts: I have a line with two 2 attributes. I would like to display both information along with the line in frequent interval, one info above the line and the other is below the line. I am working in QGIS 1.8.0-Lisboa software.


texts: Showing users current location with Leaflet

texts:
I am currently trying to show the users current location like the way google maps shows you as a blue dot when you are viewing it. I have got this code from a similar enough question however I keep getting the error as follows:

  map.html:120 Uncaught SyntaxError: Unexpected end of input.

This shows for my closing script tag.

This is my code:

<!DOCTYPE html>

  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css" />

© MapTiler © OpenStreetMap contributors


texts: How to obtain an euclidean distance raster from a vector file in QGIS?

texts:
I'm trying to obtain a raster of Euclidean Distances from a vector layer I have of a river in Spain. I did it very easily with ArcMap using Euclidean Distance, but I don't know how to do it in QGIS.

I just want to obtain a raster with all the distances from the river so I can then reclassify it, so it would look like this one I already created with ArcMap.


texts: Why can't I open PostGIS layers in QGIS?

texts:
I've set up a table in PostGIS using OSM data (converted using osm2pgsql). I know this database is good, because I'm able to import it and work with it in TileMill, but whenever I try to interact with any of the layers in QGIS (1.8.0, OSX), the Add button is greyed out (even if I put in a query).
I've tested the connection and when I test my queries it shows that lots of rows were returned, so (again), the data's clearly there—I just can't open it up.
CLARIFICATION: It's also worth noting that QGIS is able to see the database just fine. I can build queries and read out data in the Add PostGIS layer interface and everything comes back correctly. The only thing I can't do in the Add PostGIS Layer interface is add the layer.
CLARIFICATION 2 (from the comments): postgis_version returns 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1. The extensions active on the database are plpgsql (1.0), postgis (2.0.3), and postgis_topology (2.0.3). PostgreSQL and PostGIS were installed using Homebrew.
The table does (now) have a primary key, but QGIS doesn't appear to find it.


texts:
I am trying to split a SHP file using all the attributes in the column header SUBURB. Below is an example of the attribute table sitting behind the SHP file:

Name          Suburb
ABC           BAY
BCV           BAY
ABS           ISLE
CSD           DUNE
QWE           ISLE
DSA           BAY
AG            DUNE
UY            WELL
UYA           ISLE

I want to be able to specify in the ogr2ogr script that it should split the SHP file based on 'BAY', 'ISLE', 'DUNE'..... without having to specify each one of them manually.

I have tested the -where tag but unable to get it to split on all the items contained in the header SUBURB. I am new to ogr2ogr so still learning.

Also if this is possible how do I ensure the output SHP files contain the respective SUBURB name?

I am using a windows 8 machine.

The code that I'm using is

ogr2ogr -f "ESRI Shapefile" -where "SUBURB = 'WELL'" D:\Mapdata\Spatial_Data\SHP_Files\Output D:\Mapdata\Spatial_Data\SHP_Files\Input.shp

This code creates the shapefile with features where the SUBURB is 'WELL'. I don't know how to modify this script to get it to create separate shapefiles with respective names for all the SUBURBS.


texts: Showing which way line features are oriented in QGIS?

texts:
I'm working on QGIS on a street shp file which has Left From, Left To, Right From, Right To fields fields, building a geocoder.

I need to know which way these features are oriented, which I think is the same as knowing which of the two (or more) points that make the lines comes first.

Is there a way to automatically rotate a triangle marker on the marker line style so that it shows how the line is oriented?


texts: Identifying shadow on Landsat image by Hillshade Tool in ArcGIS Spatial Analyst?

texts:
I would like to automaticaly identify shadows on Landsat scene in mountaineus area using Hillshade Tool (ArcGIS 10.1). I have

1 Landsat image from one date
DEM (SRTM) from the same area

To create Hillshade raster (ArcGIS-> Tools-> Spatial analysis -> Surface -> Hillshade) I have to insert DEM and two characteristics of actual sun position:

I have to input Azimuth and Altitude, relevant to actual sun position. In ESRI (http://resources.arcgis.com/en/help/main/10.1/index.html#//009z000000z2000000) help I can find this information:

The azimuth is the angular direction of the sun, measured from north
in clockwise degrees from 0 to 360. An azimuth of 90º is east. The
default azimuth is 315º (NW).
The altitude is the slope or angle of
the illumination source above the horizon. The units are in degrees,
from 0 (on the horizon) to 90 (overhead). The default is 45 degrees.

In different help (http://landtrustgis.org/technology/advanced/shaded%20relief) I can find information that I have to "Play with these values until you find a combination that yields reasonable, legible, and attractive results (a good starting point is altitude=45, azimuth=315)."

My question is, if it is possible to use Hillshade tool to exclude hillshades from Landsat scene?

For my Landsat image I have a specific DOY (Day of Year), can´t I directly convert this DOY information in Azimuth and Altitude values?

I suppose these values are relevant to the time of day but I think I can find this information somewhere on NASA web site (hour of Landsat data acquisition, not only the date).

Find shadows on Landsat image using DEM hillshade (by ArcGIS Hillshade Tool)


texts: Making lines from nodes using OpenStreetMap and PostGIS (+ TileMill)

texts:
using openstreetmap data (in a postgis database), I would like to highlight all roads with a certain surface tag in tilemill.

I can query for the tag, doing

SELECT * FROM planet_osm_ways WHERE 'cobblestone'=any(tags)

which returns id, nodes, tags:

24204652    {262087470,262087665,262087666} {highway,residential,maxspeed,30,name,Landréstraße,postal_code,12621,surface,cobblestone}
...

I'm not sure how to proceed though, as tilemill expects geometry. I suppose, I somehow have to look up each id in nodes and combine everything to lines(?).

update:

I think I managed to make linestrings from node coordinates, doing

SELECT way_id, st_makeline(coord) AS way
    INTO __test
    FROM (SELECT b.id AS way_id, ST_SetSRID(st_makepoint(lon, lat), 3857) AS coord
        FROM (SELECT id, unnest(nodes) AS node_id FROM planet_osm_ways WHERE 'cobblestone'=any(tags)) a
        INNER JOIN planet_osm_nodes b
            ON a.node_id=b.id
        ORDER BY way_id
    ) c
    GROUP BY way_id

but in tilemill nothing shows up.

update 2:

after adjusting the layer settings in tilemill, I'm getting an error now:

Detected out of bounds geographic extent (180,85.0511287798066,180,85.051) for layer 'cobblestone'. Please ensure that the SRS for this layer is correct. Its native extent is '686159783,145786972,692158671,153144983'


texts: Extraction of raster with shapefile python

texts:
I have  a raster tiff file containing vegetation index & also a shapefile of fields. I want to extract the field wise values from that raster file using GDAL. How can I do this?

I can read  the shapefile in python using gdal, but don't know how to extract its coordinates and how to extract that polygon from the raster tiff file.

import optparse
from osgeo import gdal, ogr, osr
import numpy as np
g_nd = gdal.Open('ndvi.tif')
nd_array = g_nd.ReadAsArray()
nd_array = np.array(nd_array, dtype=float)
osgeo.ogr.UseExceptions()
myShapefile = r"/home/cr.shp"
driver = ogr.GetDriverByName('ESRI Shapefile')
dataSource = driver.Open(Shapefile, 0)
dataSource = ogr.Open(Shapefile)


texts: Creating TAB with custom CRS using QGIS?

texts:
I meet problem about reproject in Qgis.

I created coordinate user defined. i used version Qgis 2.2.
I defined coordinate:

Name: VN 2000 / 107.75 3degees

Parameters:

+proj=tmerc +lat_0=0 +lon_0=107.75 +k=0.9999 +x_0=500000 +y_0=0 +ellps=WGS84 +towgs84=-191.90441429,-39.30318279,-111.45032835,-0.00928836,0.01975479,-0.00427372,0.252906278 +units=m +no_defs

when i save as (.shp format) new file to coordinate i create in here. It gets full parameters.

But when i save Mapinfo (.tab) format. It doesn't get full parameters (it's missing towgs84):

And if i open file in mapinfo software and overlay in Google earth, coordinate is not correct because it doesn't get 7 parameters (towgs84).

Can you help me? why it get full parameters?


texts: "Select by Attribute" in QGIS using python?

texts:
Is there a way to use the function "Select by Attribute" in QGIS using a python command? In my plugin the user should enter a value via a GUI and this value should be used in a function which selects all features which have this attribute. The column name is fixed in the code, the function should only search for the correct value.

In my current solution the function connects QGIS to a PostgreSQL database and runs an SQL statement. This creates a table from the result and the table is visualised as Shapefile in QGIS.

In principal it would be enough to highlight the features and not to create a new Shapefile of the selection. Using the "Select by Attribute" function would also skip the unnecessary database connection.

Is there a way to use the function "Select by Attribute" in python so that the features are highlighted? Using the function in QGIS all features that doesn't match the query are temporary blanked-out that would be ok too.


texts: Choropleth in Cartodb with lat and long of countries

texts:
I have a dataset in Cartodb with the following columns:

Name,Count,Lat,Long

When I upload the dataset, Cartodb automatically update the column Geometry with the Lat and Long.

The Lat and Long in my datasets are the centre of countries. So, I have only once combination of Lat and Long per country.

I want to use the Count and create a Choropleth for the countries that have the Lat and Long in my dataset.

I did it in the past with another dataset, but unfortunately, I haven't kept the procedure to do it again.


texts: How to export a RGB image from Google Earth Engine?

texts:
I have a natural color of Hawaii Main Island to export, but when I exported it, it only showed a grayscale information in QGIS, but I know that this is not a QGIS problem, it's from GEE.

This was the first script I executed when I exported it without knowing that I was having a grayscale .tif Image:
/**
 * Function to mask clouds based on the pixel_qa band of Landsat 8 SR data.
 * @param {ee.Image} image input Landsat 8 SR image
 * @return {ee.Image} cloudmasked Landsat 8 image
 */
function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = (1 << 5);
  var cloudsBitMask = (1 << 5);
  // Get the pixel QA band.
  var qa = image.select('pixel_qa');
  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
                 .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask);
}

var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
                  .filterDate('2014-01-01', '2020-12-31')
                  .map(maskL8sr);

var visParams = {
  bands: ['B4', 'B3', 'B2'],
  min: 0,
  max: 3000,
  gamma: 1.4,
};
Map.setCenter(-155.5459, 19.5623, 9);
Map.addLayer(dataset.median(), visParams);

var IMGLandsat8= ee.ImageCollection ('LANDSAT/LC08/C01/T1_SR')
  .filterDate ('2014-01-01', '2020-12-31')
  .filterBounds (geometry)
  .filterMetadata ('CLOUD_COVER', 'Less_Than', 4);
var Landsat8Filtro = ee.Image(IMGLandsat8.median());
var Landsat8Clip = Landsat8Filtro.clip (geometry);
Map.addLayer (Landsat8Clip, {
  min: 0.0,
  max: 2500,
  gamma: 1.0,
  bands: ['B4','B3','B2']},
  'Imagen Landsat 8');
print (Landsat8Filtro);
Export.image.toDrive({
  image: Landsat8Clip.select("B4", "B3", "B2"),
  description: 'Landsat8_30m',
  scale: 30,
  region: geometry});

Here I will leave you a link to make it simpler to see:
Hawaii Export Script
Everything's ok until I discovered it exported in grayscale, now I was looking around here and got some code to export it in RGB scale, but when I click in run it appears the message:

"image" is not defined in this scope."

Because I'm new on GEE, I don't know how I can solve it. Can anyone more experienced help me?
Here's the code I've tried:
  /**
 * Function to mask clouds based on the pixel_qa band of Landsat 8 SR data.
 * @param {ee.Image} image input Landsat 8 SR image
 * @return {ee.Image} cloudmasked Landsat 8 image
 */
function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = (1 << 5);
  var cloudsBitMask = (1 << 5);
  // Get the pixel QA band.
  var qa = image.select('pixel_qa');
  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
                 .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask);
}

var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
                  .filterDate('2014-01-01', '2020-12-31')
                  .map(maskL8sr);

var visParams = {
  bands: ['B4', 'B3', 'B2'],
  min: 0,
  max: 3000,
  gamma: 1.4,
};
Map.setCenter(-155.5459, 19.5623, 9);
Map.addLayer(dataset.median(), visParams);

var imageRGB = image.visualize({bands: ['B4', 'B3', 'B2'], min: 0, max: 2500});
print("rgb",imageRGB);

Export.image.toDrive({
  scale: 30,
  image: imageRGB,
  description: 'example_image_RGB',
  fileFormat: 'GeoTIFF',
  region: image.geometry});

Here's the link of this script:
Hawaii RGB Export Script


texts: Smoothing/interpolating across images in an ImageCollection to remove missing data

texts:
I have some code that is working properly to calculate the monthly NDVI averages for the previous two years from a date but I sometimes have missing data in some of the months and I would like to get an average based on the mean of the previous two months. I suppose I could also interpolate from the closest geographic data point but it seems like it would be better to interpolate across time than distance given that sometimes the clouds cover reasonably large areas.

But I'm certainly open to other opinions, I just want to fill these holes as accurately as possible. Is there an efficient way to do this. Here is a link to my working code and here is the code itself:

// pick a landsat tile footprint to use as my geometry
var wrs2_descending = ee.FeatureCollection('ft:1_RZgjlcqixp-L9hyS6NYGqLaKOlnhSC35AB5M5Ll');
// use a manually defined point to pick the WRS2 tile
var wrs2_filtered = wrs2_descending.filterBounds(roi);
var layer1 = ui.Map.Layer(wrs2_filtered, {}, 'WRS2 filtered');
Map.layers().set(1, layer1);

var imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR').filterBounds(wrs2_filtered);
var monthCount = ee.List.sequence(0, 11);

// Function to cloud mask from the pixel_qa band of Landsat 8 SR data.
function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = 1 << 3;
  var cloudsBitMask = 1 << 5;

  // Get the pixel QA band.
  var qa = image.select('pixel_qa');

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
      .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

  // Return the masked image, scaled to reflectance, without the QA bands.
  return image.updateMask(mask).divide(10000)
      .select("B[0-9]*")
      .copyProperties(image, ["system:time_start"]);
}

// run through the image collection and generate monthly NDVI median images
var composites = ee.ImageCollection.fromImages(monthCount.map(function(m) {
  var startMonth = 1; // thinking that I should always start from Jan so the series are similar
  var startYear = ee.Number(2017-1); // number is one year before the current one

  var month = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('month');
  var year = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('year')

  // filter by year and then filter by month to get monthly mosaics
  var filtered = imageCollection.filter(ee.Filter.calendarRange({
    start: year.subtract(1), // we want an average of the last two years
    end: year,
    field: 'year'
  })).filter(ee.Filter.calendarRange({
    start: month,
    field: 'month'
  }));
  // mask for clouds and then take the median
  var composite = filtered.map(maskL8sr).median();
  return composite.normalizedDifference(['B5', 'B4']).rename('NDVI')
      .set('month', ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month'));
}));
print(composites);

Map.addLayer(composites, {min: 0, max: 1}, 'check');

// stack the ImageCollection into a multi-band raster for downloading
var stackCollection = function(collection) {
  // Create an initial image.
  var first = ee.Image(collection.first()).select([]);

  // Write a function that appends a band to an image.
  var appendBands = function(image, previous) {
    return ee.Image(previous).addBands(image);
  };
  return ee.Image(collection.iterate(appendBands, first));
};
var stacked = stackCollection(composites);
print('stacked image', stacked);

// Display the first band of the stacked image.
Map.addLayer(stacked.select(0).clip(wrs2_filtered), {min:0, max:1}, 'stacked');


texts: Calculating Speed of Android device in Navigation mode using ArcGIS Runtime SDK?

texts: I am working on a Navigation App and I am using ArcGIS runtime sdk for this. It looks pretty straight forward and I was able to create a simple app. Now I want to calculate the speed of the device while navigating. I was wondering if that is possible or not as I did not find anything in this regard in ArcGIS documentation.


texts: 3D perspective on maps in Leaflet, CartoDB?

texts:
Are there any JS library out there that would render normal, flat maps (like Leaflet) into a perspective map like this one, on the web:

Also, anyone seen anything that could turn CartoDB data into 3D representation, like this?


texts: Highlight only the center feature on openlayers

texts:
I'm quite new to openlayers and I was wondering if there was a way to highlight ONLY the center feature of a layer http://openlayers.org/en/v3.0.0/examples/select-features.html

A highlight like the example above would be perfect and although I understand how its done, I have yet to find a way to highlight only the center.


texts:
I use qgis 3.4.4 and I make a filter on vector layer. Here is my code:
layers = QgsProject.instance().mapLayers()
for layer_id, layer in layers.items():
    if (layer.name() == "csv_points_acc") or (layer.name() == "csv_points_amb"):
        print(layer.name())
        expression = """"dateposte" like '%2019-01%'"""
        request = QgsFeatureRequest().setFilterExpression(expression)
        matches = 0
        for f in layer.getFeatures(request):
           matches += 1
        print(matches)

The matches printed correspond to the data but there is no change in the map. Can anyone help me to make the filter work to the map?


texts:
I am using the Create Grid tool in QGIS to simply create a 25x150ft grid. I am using EPSG:3857. When I select my parameter I want and run the tool, I double-checked the dimensions with the measurement tool and found that the grid dimensions were different from what I originally set. For time sake, I ended up just guessing and checking until I got the grid in the proper dimensions, but would like to know how to fix this for the next time it happens. I noticed that if I switched the measurement tool into Cartesian, then the dimensions are correct.
Do I need to switch all my layers into a Cartesian format, create grid, and reproject back?
That would seem a bit ridiculous especially if I had to project the rasters I am working with (<10GB).
Create Grid

Vertical Dimension Ellipsoidal

Vertical Dimension Cartesian


texts: Identifying geometry storage type in geodatabase stored in Oracle?

texts: How do I identify what geometry storage type is being used with a specific geodatabase stored in Oracle 9i via ArcSDE 9.3.1?


texts: Arc by center point in PostGIS does not fit the circle

texts:
I'd like to store a GML ArcByCenterPoint in PostGIS. I can work out the start, middle and end points required by the CIRCULARSTRING type and all seems to be OK, except that when I visualise the arc it does not fit the circle that it's supposed to be part of.

Data (in lon/lat format):

Circle centre point: 29.59444 40.26333
Radius:              18 NM (27780 M)
Arc start point:     29.89250 40.36667
Arc end point:       29.27528 40.31667
Arc middle points:   29.560000 40.511667 (counter-clockwise)
                     29.628611 40.015000 (clockwise)

SQL statements to insert the geometries. Note that I'm using ST_CurveToLine here, because I don't know of anything that can visualise a CIRCULARSTRING directly.

-- The arcs going both ways between the same start and end points
INSERT INTO test (test) VALUES (ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(29.8925 40.36667,29.560000 40.511667,29.27528 40.31667)'), 4326));
INSERT INTO test (test) VALUES (ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(29.8925 40.36667,29.628611 40.015000,29.27528 40.31667)'), 4326));

-- The full circle
INSERT INTO test (test) VALUES (ST_Buffer(ST_GeogFromText('POINT(29.59444 40.26333)'), 15 * 1852)::geometry);

Here is what the result looks like in Google Earth:

The arcs are in red and the lines from the center point to the start and end points are in blue. The arcs do touch the circle at 3 points, so it would appear that the coordinates were calculated correctly (or at least close). But the shape of both arcs is wrong - as you can see, they don't quite follow the circle.

Can anyone suggest what's going wrong here? Is either the CIRCULARSTRING type or the ST_CurveToLine function not doing what I expect? I'd love to take ST_CurveToLine out of the equation and visualise the CIRCULARSTRING directly, but I don't know of any way to do that.

Edit: I finally gave up on this approach and approximated the arc in a different way: Storing GML surface in PostGIS


texts: Installing 3D Analyst extensions in ArcView 3.3 on 64bit Windows 10?

texts:
I was using ArcView 3.2a version with 3D Analyst and spatial analyst extensions. Now i am not able to install 3D extension in my 64 bit computer windows 10.

How to install this extension?


texts:
I have a shapefile which looks like this (this is a snippet of it):

I would like to create a grid in a new shapefile which will be overlaid (that's not a technical term, I'm just not sure how to describe it) on this map.

The grid should be comprised of equal sized polygons, except by the borders where they can (and in all likelihood will) be smaller. It should look like this:

I have tried using the Create Fishnet tool in ArcMap to accomplish this, but this gives me a grid which is always rectangular and does not stop at the borders of the original shapefile.

How do I create this shapefile?


texts:
I am trying to use Ordered weighted averaging to sum up values across different raster overlays in QGIS 3.4.4, but I get this error:

Traceback (most recent call last):

File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\algs\saga\SagaAlgorithm.py",
line 217, in processAlgorithm
files.append(parameters[param.name()].source()[:-4] + 'sgrd')
AttributeError: 'list' object has no attribute 'source'

I have already tried to use Raster Calculator by SAGA, Raster analysis and GDAL, and GRASS' r.series, but either get an error or get a blank map. I have selected no-data value for 1 layer only, so I should get a result even if the areas don't overlap.


texts: GeoJSON manipulation library in javascript

texts:
I'm manipulating GeoJSON objects in a web application. Leaflet accepts the POJOs with the correct GeoJSON format.

But I'd like to use a specific library that creates those POJOs, taking care of the format specification. A library that provides a solid Object Oriented interface.

I receive my data from a REST API and I need to manually create the GeoJSON objects. I think it is not robust to just use simple JS objects. So, I'd love to have a library that supports that part of the work.

I can't specify more about the data format. The only thing I can say is that I get all that's necessary to create GeoJSON objects. The question aims to find a general purpose library. For example in Python, I'd use something like this: https://github.com/frewsxcv/python-geojson

But I cannot find a similar thing in Javascript. Do you know if such a thing exists?


texts: Joining attributes by location for more than one located feature using R

texts:
When joining attributes by location with the over function in R from the sp package, only the values for one of the polygons that intersects is retained. Is there a way in R that allows to take attributes of more than located feature? That is, to get ALL qualitative values the polygons that intersect/overlap. With an attribute column for the value of the first located feature, another for the second located feature, etc.
I have also asked in a separate question about Joining attributes by location for more than one located feature using QGIS
Sample code to perform simple spatial joins
#set up sample data
    install.packages('tmap')#use this library to upload sample spatial polygons
    library(tmap)
    data(Europe) # countries
    data(metro) # cities
    #transform sample data of points into polygons with same crs/projection for this example (trivial example because point.in.poly suited to this problem but just for the sake of an example
    metro.pts=spTransform(metro, crs(Europe))
    metro.poly=gBuffer(metro.pts, width=50000, byid=TRUE)

#load libraries for spatial join
    library(rgdal)
    library(sp)

 #spatial join of the two polygon shapefiles
        #"find the cities in each country"
        joined_one=cbind(over(Europe, metro.poly), as.data.frame(Europe))

    #but this only joins one of the cities in each country even when more than one city is present
    #if we check for spain, we only have Barcelona and not Madrid even though it is part of the city file
    na.omit(joined_first[joined_first$iso_a3=="ESP",])
    metro.poly[metro.poly$name=="Madrid"|metro.poly$name=="Barcelona",]

    #using the `fn` option (function) we can calculate arithmetic for quantitative variables as to get values for more than one polygon that intersects
    joined_qn=cbind(over(Europe, metro.poly[,5:8], fn=mean), as.data.frame(Europe))


texts: Can I Customize a QGIS Connection to GeoServer?

texts:
I have two different versions of QGIS at work – v3.6.3 and v2.18.3.  We have a GeoServer v2.14 that I want to pull features from via WFS requests.  I can pull features when using QGIS v2.18.3 but I receive a “DescribeFeatureType failed” message when using QGIS v3.6.3.  I have two questions:
1.  Is there a way within QGIS to see how the WFS requests are constructed in the two versions of QGIS?
2.  Is there a way to customize the WFS requests in QGIS3?


texts: Mapbox GL JS - 3D Buildings - display only some buildings in 3D

texts:
I am using this example provided by mapbox gl js:
Display buildings in 3D

Now the problem is I only want to show some buildings in 3D. How can achieve this? I don't know where to find the source-layer with which the example is working. A hint where to find it and how to customize would help alot.

I also have an own custom GeoJSON for buildings. It would be possible to add height information. But I don't know how to edit my geojson in order to work correctly so it would display the height.

Here is an example how my GeoJSON is structured:

{
    "type": "FeatureCollection",
    "name": "customBuildings",
    "crs": {
        "type": "name",
        "properties": {
            "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
        }
    },
    "features": [{
            "type": "Feature",
            "properties": {
                "osm_id": "25717939",
                "fclass": "building"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [[[12.9775952, 52.4079663], [12.9776357, 52.4081339], [12.9778491, 52.4081147], [12.9778086, 52.4079471], [12.9775952, 52.4079663]]]
            }
        }, {
            "type": "Feature",
            "properties": {
                "osm_id": "90582821",
                "fclass": "building"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [[[12.9759631, 52.4063223], [12.9759875, 52.4064343], [12.9762787, 52.4064107], [12.9762543, 52.4062987], [12.9759631, 52.4063223]]]
            }
        }, ]
}


texts: Relating tables based on a range of values?

texts:
I have a polygon shapefile of parcels with 2 fields that give a low and high address range. I would like to relate this to a point shapefile that has a specific address field for each point. The Addresses are homogenized strings in both files, I just need a way to relate each parcel address range to the exact addresses so I can select them and see where they are.

That is when I want to access the related table for Parcel 10,  with address range 1428-1430 1st avenue, I would like to have selected ALL points in the related table namely:

1428 1st ave
1429 1st ave
1430 1st ave

Is there any way to generate slightly more complex relationships like this on Arcmap?


texts:
I have some lines I'm attempting to symbolize in Mapserver with discrete symbol at each end.  Currently my .map file is set up this way:

STYLE
  SYMBOL 0
  WIDTH 1
  COLOR 0 0 0
END

When tested the lines show up as a simple black line.  I've tried appending the code below to add a symbol (defined in my .sym file) at one end of the line.

STYLE
  SYMBOL 0
  WIDTH 1
  COLOR 0 0 0
END
STYLE
  geomtransform 'end'
  angle auto
  symbol 'bob'
  size 8
  color 0 0 0
END

This breaks my testing environment.  I've also tried substituting GEOMETRYTRANSFORM in the code above with no luck.  Any suggestions?


texts:
Which software would you prefer for a telecom GIS project and why?

I have experience with both, but I personally prefer Telvent ArcFM over Telcordia Network Engineer because of it's functionality and tighter integration with ESRI products, especially ArcGIS Server.

Any other opinions?

Edit:
I would like to have your views based on (but not limited to) these factors:
1. Performance
2. Scalability
3. Database Support
4. Customization options/ ease of customization
5. Interoperability with other (GIS) systems
6. Data exchange to/from other non-GIS systems (like Sharepoint, middlewares etc.)
7. Availability of a web-based offering

I am purposefully ignoring cost at this moment as I would like a completely technical aspect for the comparison.


texts: QGis GDAL Grid Inverse Distance to a power - Grid Size

texts: When I run this function from QGis on a point shapefile, there is no option to determine the grid pixel size / resolution or dimensions. Am I missing something here?


texts: How to calculate distance from point to nearest polygoin via road network (polyline) ARCMap 10.3.1

texts: Using ArcMap, is it possible calculate distance from a postcode (point) to nearest polygon using a road network layer (polyline)? As opposed to just calculating Euclidean distance?


texts:
Does WFS (specifically we are using geoserver) allow for a 'CQL Filter' to be specified when making a XML request?

All the examples that I'm finding are for KVP requests.

I don't see why you couldn't do something like below yet I can't find it anywhere.

<CQL_FILTER>INCLUDE FILTER HERE</CQL_FILTER>


texts: What solutions to use QGIS as insert tool for a Postgres relationnal database?

texts:
I have a Postgres/PostGIS relational database and I would like to use QGIS as an interface for inserting data. The thing is that my database is quite complex and I need my tool to handle the following features: one-to-many relations, point coordinates editing and guided insert.

What I call guided insert is the procedure of inserting a line in a table, then inserting one or more lines in a child table with the foreign key of the first line, etc ... I need this feature to work with up to 4 levels (ex: insert a country, then a city related to this country, then a building related to this city and finally a person related to this building)

I see three solutions that could potentially fit my need, but before going into further tests and investigations, I would like to benefit from other experiences.

1) Using the QGIS Forms with relations between the tables:

This is the first thing I tried. It works not so bad, except from some difficulties with foreign keys legacy and coordinates editing. I just fear that it might not be customizable enough for all my use cases.

2) Using a custom from with QtDesigner:

As I never really used QtDesigner, I am not really sure of its potential in my case but it seems to be a good candidate for more customizable forms.

3) Using pygis:

I know a bit of Python, but I never used it to develop tools for QGIS. I think it might be the appropriate tool, especially in terms of customizability but I fear the development time compared to the other solutions.

Does someone have an idea of what could be the most appropriate tool?

QGIS : 2.10

Postgres: 9.3

PostGIS: 2.1.7


texts: Agisoft Photoscan Normalization of Multi-Spectral Data?

texts:
Do you know if it is possible to normalize the data for the multi-spectral projects using a python command or a the Batch Process in Agisoft PhotoScan?

If I know the max value I can do it using something like:

chunk.raster_ transform.formula = ([“(B4)”] / 55000)

But I want the max value to be dynamic based on the

chunk.raster_transform.calibrateRange()

I am trying get something like:

([“(B4)”] / max)


texts: What is the correct way to run a python script in QGIS Open Project macro?

texts:
This code (answer from @gcarrillo about other question - Is there any way to freeze the layer names in the TOC?) runs fine on python console and inside a plugin.

But now, I tried put it within the "openProject macro" and it crashed.

The legend not appears and I get a minidump. How I can to make this? Or I can´t...

from qgis.core import *
from qgis.utils import iface
from qgis.gui import *

def openProject():
  root = QgsProject.instance().layerTreeRoot()

  model = QgsLayerTreeModel(root)
  model.setFlag(QgsLayerTreeModel.ShowLegend)
  model.setFlag(QgsLayerTreeModel.ShowLegendAsTree)
  model.setFlag(QgsLayerTreeModel.AllowNodeReorder,False)
  model.setFlag(QgsLayerTreeModel.AllowNodeChangeVisibility)
  model.setFlag(QgsLayerTreeModel.AllowLegendChangeState)
  model.setFlag(QgsLayerTreeModel.AllowNodeRename,False)

  treeview=iface.layerTreeView()
  treeview.setModel(model)


texts: How can I extract lat/long from GDB file in FME?

texts:
I have a large GDB database of points of interest across the world. I can open this up in FME and the data viewer works great in showing me the content in a way that is easily consumable. Despite all of these data rows being filled with lots of info, and being properly mapped in the world viewer feature, I don't have the lat/long coordinates for these places.

I've tried several variations of Transformations, but I am unable to output the lat/long coordinates that I am looking for. Right now I am using a coordinateExtractor, that is successfully adding new X and Y values to the output file, but the coordinates don't show up as valid on Google maps. For example, this is what I am currently getting for a given row:

X: 1136921.462499998509884
Y: 216469.213800000026822

I feel like I am close! But I am stuck. How can I get the lat/long coordinates for each of these rows in a format that Google Maps will take?


texts: How to have an infinite colour ramp for a choropleth, in QGIS

texts:
I have a dataset of land values which, for the full range, is say 125 to 250,000,000, i.e for a whole state. For the user, they will only be seeing on the map canvas, a small subset of this at any one time, i.e for a suburb. But they will want to get a full spectrum on the colour ramp in their area of interest, to tease out the slightest variation in the suburb.
The approach I have taken is to divide the full range into 10 and have pseudo range of 1 - 100% within that sym_rnge. The psuedo range therefore repeats (code below). This is OK, until you get to the edges, when the values shown go from 99% to the next upper set and revert to 1% 2% etc.
I am using the VIRIDIS in-built ramp which looks nice, but doesn't repeat back to the starting colour (below). Instead the user seems brownish, purple, dark purple, yellow! I can't find an in-built ramp which repeats back to the starting colour. Just using that would solve my problem.

I looked at editing the code for the ramp, it is way too detailed I think to edit.
Is there a way to;

have a colour ramp which repeats
approach the problem from another angle?

set sym_rnge =
case
        when dlrs_ha1 between 0 and 12500 then dlrs_ha1 / 125
        when dlrs_ha1 between 12500 and 62500 then dlrs_ha1 / 625
        when dlrs_ha1 between 62500 and 312500 then dlrs_ha1 / 3125
        when dlrs_ha1 between 312500 and 1562500 then dlrs_ha1 / 15625
        when dlrs_ha1 between 1562500 and 7812500 then dlrs_ha1 / 78125
        when dlrs_ha1 between 7812500 and 39062500 then dlrs_ha1 / 390625
        when dlrs_ha1 between 39062500 and 195312500 then dlrs_ha1 / 1953125
        when dlrs_ha1 between 195312500 and 976562500 then dlrs_ha1 / 9765625
        when dlrs_ha1 between 976562500 and 4882812500 then dlrs_ha1 / 48828125
        when dlrs_ha1 between 4882812500 and 24414062500 then dlrs_ha1 / 244140625
        else dlrs_ha1

EDIT
Ramp editor


texts: This is a stack bar plot made by QGIS 3.18 (2nd image). All I want is to flip the image and overlap this plot as 3D in QGIS (Like image 1st). How can I do that?


texts: How to modify height model values outside of road network

texts:
I have a height model of a quite big area saved in Esri ASCII grid files and a road network of this same area in a shapefile. I'd like to convert every height model value outside the road network to -999.999 (NODATA_value in my .asc-files), as I won't be needing them. This would reduce amount of data massively as I will later use only real values and forget those NODATA_values.

Is there any reasonable way to do this, for example in QGIS or ArcMap? Would it even be possible to have a few meters wide buffer around the roads, just to be sure that there will be every needed height value in the end?


texts:
What are the options for rendering tm2 projects?

As far as I know the open source Mapbox tm2 projects have proprietary data sources (like OSM Bright 2), thus they are of little use, but some other projects have available sources, for example:

OSM Bright fork from Wikimedia
MapQuest Carto Style
Natural Earth from MapBox
Thank you map from Yohan Boniface

How is it possible to make a PNG rendering tile server which uses one of these styles as input source?

Are these even compatible with each other, or they prefer to be within their own pipeline?

Do I understand right that it has to be a 2 pass rendering:

For creating the Mapnik vector tiles in PBF format (using the PostGIS backend)
For taking the PBF tile file + styling information and rendering a PNG out of it

I see that there are some solutions which solve one part. For example:

Kosmtik can rasterize
Avecado can create PBF files, but the server part is only for testing
Kartotherian can kind of do everything but uses dozens of outside modules. On the other hand it is really well documented and it might be the only out-of-the-box solution so far
Mapzen's vector datasource can create and serve PBF files
Mapzen's TileStache fork looks like a serious fork but is without documentation or mentioning what it is capable of
The Mapbox stack is kind of open sourced, but without documentation so it's really hard for anyone to figure out how to use it (as mentioned by Andy Allan in his presentation below)
Andy Allan presented Vtiler + Hailstorm + Weatherman but I couldn't find anything about them
The tessera server seems interesting and can serve from tm2 styles, but it's not clear how can I make it pre-render and cache PBF files.

Can someone explain how to make the simplest possible PostGIS -> PBF -> PNG rendering pipeline?

Wouldn't it be a simple 2 pass rendering with mapnik-vector-tile?


texts:
I am migrating a plugin to (K)Ubuntu 18.04 and QGIS 3.2 but oddly enough I can't seem to connect to a postgres database.

As far as I can see the QPSQL driver is not loaded.
I ran the following code:

>>> qgis.PyQt.QtSql.QSqlDatabase.drivers()
['QSQLITE', 'QMYSQL', 'QMYSQL3', 'QSPATIALITE', 'SKGSQLCIPHER']

As you can see the QPSQL driver is not loaded. Is there something I am missing?

Extra information
- I am also running a local Postgresql9.6 (so there should be plenty of libs available)
- Latest versions of libpq-dev and libpq5 installed.
- I can load postgis layers from qgis just fine


texts: How to Solve Missing libintl-8.dll error with PostGIS?

texts:
I have Installed 32 Bit PostgreSQL 9.5 and PostGIS 2.3 on my 32 Bit Windows Desktop. I have connected to the Database via pgAdmin, and I have been able to create a PostGIS Database.

But when I try to Open the PostGIS Shapefile & DBF loader, I Get an error which says:

  The program can't start because libintl-8.dll is missing from your
  computer. Try reinstalling the program to fix this problem

What do I do to solve this issue? Where Can I find this DLL?


texts: How to enable positioning in underground Metro/Subway stations for smartphones?

texts:
Summary: my smartphone can't do public transport journey planning in underground metro and subway stations because it doesn't know where it is.
Is there a description for cities and public transport agencies how to enable smartphone positioning in underground public transport stations?
My simplest idea is to use Wifi routers. There might be already WIFI routers underground and adding cheap 20 USD routers for the sole purpose of positioning might be suitable.
But how do we tell Apple and Google where they are (and in which underground level)?
This question is not about a private indoor positioning system that works only with one app. The smartphone itself should know where it is, including all apps running on the smartphone.
I did not notice this problem in my own city where I memorized the public transport network before smartphones were invented. But testing my own mobility app for tourists in foreign cities, I found that this is a common problem (including in my own city).


texts:
I am working on a project for a volunteer organization and they want to know if it's possible to link a project to a web server?
Along with that, they want it to be password protected.
Does anyone know if this is possible and/or how to accomplish this?


texts:
I want to implement a mechanism to compare similar / identical paths. For example, a person who makes the trip home - work every day, be able to detect these paths and create groups to compare different indicators (speed, altitude, ...).

For each trip taken by each driver is recorded with GPS coordinates along the path, so for every trip I have the coordinates along the route. Is there any algorithm to detect similarity between paths? I'm using a geospatial representation of MongoDB.

I am conducting a pre-processing on the gps data to eliminate error, consisting of round the coordinates to 3 decimal places approximately 111.32 m. Now I'm interested to know how I can consider that two paths are the same / similar to compare.

Thanks in advance.


texts: Creating dynamic GIS charts in ArcGIS Desktop?

texts:
I'm using ArcGIS 10.1 for Desktop.

I have generated a table which has road segments which get inundated during different flood events. I want to be able to add a pie chart to the map which shows that during each flood ARI (1y, 2y, 5y, 10y, 20y, 50y and 100y) x% of the road network in the AOI gets inundated.

I tried the following:

and get

The table looks like

Is it possible for me to add python code for the chart to add all the 1y lengths and display that number only, 2y total lengths etc only so that you get a pie chart with just the 7 categories. I need to automate this as it needs to be run in several areas and some of the input data changes.


texts: How to use v.net.distance (GRASS) in QGIS?

texts:
I'm trying to compute the shortest distance via the network between the given sets of features (schools to hospitals or cholera cases to pumps, for example), using the v.net.distance GRASS algorithm inside of QGIS (Toolbox).
But there are several parameters in Advanced Parameters that have no instructions to use them. Where can I found instructions to use this tool?
The informations in https://grass.osgeo.org/grass72/manuals/v.net.distance.html does not have direct relationship to the Advanced Parameters.

My conclusions after reading Joseph's comments and Steven's answer.

A) From Category values: enter the id number of each desired feature for the analyzes. It is used instead of selecting the features with the mouse on the screen.

B) From WHERE conditions of SQL statement: it works when the "From Category values" field is filled or not.

C) To Category values: enter the id number of each desired feature for the analyzes. It is used instead of selecting the features with the mouse on the screen.

D) To WHERE conditions of SQL statement: it works when the "To Category values" field is filled or not.

E) Arc forward / both directions cost column: the length of the arc, for example.

F) Arc backward direction cost column: the length of the arc, for example. The length of the arc should be replaced by -1 when the direction is unique.

G) Node cost column: this is a numeric column of the From_points attribute table. I did not understand the effect of this parameter in the calculations.

H) The CAT column does not appear in the attribute table of the Network_Distance layer.


texts: How to resize OpenLayers map before print

texts:
I have an OpenLayers map container defined as

#preview_cont {
    width: 100%;
    height: 15cm;
}

It looks OK on screen, but when I print it, the map is distorted. I assume it's because map container proportions are changed when printing. As far as I know, in such a case

ol.Map.updateSize()

has to be called. So I tried this function:

$(window).resize(function () {
        map.updateSize();
});

Unfortunately, it's not called for printing. Is there a way, how to do it?


texts: Creating Multiple Field Indexes Using Arcpy

texts:
I want to create a code that will take a feature class' fields and create indexes for each of them (because it is tedious to do it by hand). I'm trying to use arcpy.ListFields to get the fields and put the result as the second parameter for arcpy.AddIndex. I am using a FOR loop and each field is called "f." If I just use f as the parameter  then I get the vague error "RuntimeError: Object: Error in executing tool." if I use f.name or just name (created from f.name) then I get "raise e ExecuteError: ERROR 000308: Invalid field type." The ArcGIS examples show a string of multiple names (probably for a composite index) separated by semicolans which will be read as distinct fields when the tool is executed. Why isn't my field being read as a field when I execute the tool? The code reads the file correctly and returns the names of all of the fields, so that shouldn't be the problem? Do you have any ideas or do these two tools not work well with each other?

fc = r"C:\data\featureclass"
flist = arcpy.ListFields(fc)
for f in flist:
    name = str(f.name)
    print name
    arcpy.AddIndex_management (fc, f , "inx_" + name, "NON_UNIQUE", "NON_ASCENDING")


texts: using PyQGIS to subsample a region of a raster layer's pixel data

texts:
I am having trouble sampling multiple pixels from a raster layer at oe time. If I want to sample pixel data from a layer at a particular  coordinate I can write.

ident = layers[0].dataProvider().identify(QgsPoint(357109.988, 6255412.925),QgsRaster.IdentifyFormatValue)

where my magic numbers come from the x and y coordinates of my CRS for my particular use case; however, I want to sample a rectangular subregion of the layer. looking at the API documentation ( https://qgis.org/api/classQgsRasterDataProvider.html#a33c343510d534f82c820579b9093fea1
)it appears that I can do something like this:

ident = layers[0].dataProvider().identify(QgsPoint(357109.988, 6255412.925),QgsRaster.IdentifyFormatValue,QgsRectangle(0,0,2,2),2,2)

and that does return a value, but it only returns one value. further googling has only turned up the API documentation.

How do I retrieve a nxm array full of band values centered around (or starting from) a point in a raster layer?


texts: function st_within(sde.st_geometry, geometry) does not exist


texts: How to rotate symbol in each point of LineString?

texts:
I have a linestring, and want to draw arrow forward and arrow back in each point except firat and last. Like this

I have no problems with first and last point couse i can rotate arrows with startAngle and endAngle. But how can i rotate arrows for other points?


texts: Use a sde.st_geometry function in a PL/SQL trigger

texts:
I have a PL/SQL trigger:

1    create or replace trigger "projects_to_meas_trig" before update of asset_id
2    on projects
3
4    for each row
5    declare
6        v_length number;
7    begin
8        if :new.asset_class = 3 then
9            select sde.st_length(shape)
10            into v_length
11            from user1.roads
12            where  road_id = :new.asset_id;
13
14            :new.to_meas := v_length;
15        end if;
16    end;

At line #9, when I try to use the st_length function, I get this error:

Error(4): PLS-00707: unsupported construct or internal error [2603]

Why can't I use the st_geometry function in a PL/SQL trigger?


texts: Not Able to Add a RasterLayer to ArcGIS API For JavaScript Map

texts:
Can you please take a look at This Demo and let me know why I am not able to add the Raster Layer  Layer: fishing_effort.tif (ID: 53) into the Map?

var map;
require([
    "esri/map",
    "esri/layers/ArcGISDynamicMapServiceLayer",
    "dojo/ready",
    "dojo/parser",
    "dijit/layout/BorderContainer",
    "dijit/layout/ContentPane"],
function (
Map, ArcGISDynamicMapServiceLayer,
ready, parser,
BorderContainer, ContentPane) {
    ready(function () {
        parser.parse();
        map = new Map("cpCenter", {
            basemap: "topo",
            center: [-9.113077, 0.759423],
            zoom: 2
        });
        var layer = new ArcGISDynamicMapServiceLayer("http://renewablestoolbox.biol.sfu.ca/rorapp/rest/services/RORApp/MapServer/53")
        map.addLayers([layer]);
    });
});

as you can see from the console I am getting 400 (Bad Request) error message but the layer is for sure at This Url


texts: Population in upstream area (looping over FeatureCollection)

texts:
I want to calculate the sum of the population living in the upstream area of stations using the hydro package by gena. I think I will have to loop over the stations (using the identifier "GEMS_Stati"). This is my (not very elegant) code to get the population for a single station:

var stations = ee.FeatureCollection('users/basins/stations');

//select only one station
var filter = ee.Filter.inList('GEMS_Stati', ['EGY00002']);
var FilteredStation = stations.filter(filter);

var PopCount2000= ee.Image('CIESIN/GPWv411/GPW_UNWPP-Adjusted_Population_Count/gpw_v4_population_count_adjusted_to_2015_unwpp_country_totals_rev11_2000_30_sec');

var hydro = require('users/gena/packages:hydro');

var catchments = hydro.getCatchments({level: 6});
var catchmentsSelected = hydro.getCatchments({outlet: FilteredStation, level: 6}) ;

var catchment_Pop2000 = PopCount2000.reduceRegions({
  collection: catchmentsSelected,
  reducer: ee.Reducer.sum(),
});

var sum_pop_upstream = catchment_Pop2000.reduceColumns({
  reducer: ee.Reducer.sum(),
  selectors: ['sum']
});

How can get a table that contains the station ID, "GEMS_Stati", and the respective value of "sum_pop_upstream" for each station?


texts:
I've a question about rendering a qgis project (src: postgis) into raster files (e.g. geotiff).

My Goal is it to render my qgis project into 256x256 tiles for Mapnik.
I know there are a lot of python scripts which can do that, but I want to use gdal2tiles (it's better performance). So I need big Geotiff files in the max. zoom level as input for gdal2tiles. For example 2x2km (14.000px x 14.000px).

The QGIS Print-Composer can't do that for me. Using the "cmd" command for making high resolution image ("qgis --project x.qgs --snaphot --width --height.." and so on) doesn't work with that high number of pixel.

Does someone has an idea?


texts: Can not load spatial data from MSSQL on Linux

texts:
I have a table on the MS SQL server. I am trying to import the data in R using the rgdal package. I can import the table on Windows without any problems using the following code:
readOGR(dsn = "MSSQL:server=NAME.domain.com;
                     database=Spatial;
                     trusted_connection=Yes",
        layer = "Apkaimes",
        encoding = "UTF-8", use_iconv = T)

However, I am not able to read the same table from the same SQL server on Linux. I am using the following code where the driver is specified:
readOGR(dsn = "MSSQL:server=NAME.domain.com;
                     database=Spatial;
                     driver=ODBC Driver 17 for SQL Server;
                     trusted_connection=Yes",
        layer = "Apkaimes")

I am getting the no features found error. However, I am able to connect to the server and to list the layers with the ogrListLayers(). I tried different combinations and values for the encoding and use_iconv with out success.
The ogrInfo() produce different results:
On Windows:
Source: "MSSQL:server=NAME.domain.com;
                     database=Spatial;
                     trusted_connection=Yes", layer: "Apkaimes"
Driver: MSSQLSpatial; number of rows: 85
Feature type: wkbPolygon with 2 dimensions
Extent: (495970 301544.7) - (587883.1 380104.2)
CRS: +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Number of fields: 2
  name type length typeName
1 Code    4      7   String
2 Name    4     20   String

On Linux:
Source: "MSSQL:server=NAME.domain.com;
                     database=Spatial;
                     driver=ODBC Driver 17 for SQL Server;
                     trusted_connection=Yes", layer: "Apkaimes"
Driver: MSSQLSpatial, no features found
CRS: +proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
Number of fields: 3
  name type length typeName
1   ID    0     10  Integer
2 Code    4      7   String
3 Name    4     20   String

Obviously rows are not imported on Linux.
SQL collation is Latvian_CI_AS if this helps.
GDAL version:
> system("gdalinfo --version")
GDAL 2.3.0, released 2018/05/04


texts:
I updated from QGIS 2.0 to 2.18 i November, but it seemes to have caused problems with the dxf-exportation to adobe illustrator. The files from the newer version causes illustrator to "hang". The new files are about double the size of the old ones, but it should still not be too much for illustrator.

Is this a common problem with the 2.18-version?

Is there something I can do about it?

Is it recommandable to use another coding when I export the dxf, for example?

Now, I just use the default settings. Or should I just go back to the older qgis-version again?


texts: Multiple copies of entries after syncing QField to desktop

texts:
I am learning my way into qfield and the qfieldsync plugin and I must be doing something wrong.
I have noticed in the desktop project I am getting multiple copies of features which I added in QField when I follow this particular sequence of steps:
I package a project using the plugin. The layer (point-layer)to be edited is set to 'offline editing'.
I copy the project files from a qfield-export folder to my phone, open QField, add new features, close qfield, then copy the project files to a different desktop folder 'qfield-import'. In qgis I use Synchronize from QField and the new features are visible. I delete the files from the desktop folder qfield-import.
Notice, I do not remove the project files from my phone.
Next, I use qfield again, add new features to the point-layer, close QField and then copy the project files from my phone to the desktop qfield-import folder.
Run Synchronize from qfield again, the newly added features are visible, but the previously added features are also copied. The pointlayer now has two exact copies of the features added the first time in QField and one copy of the features added in QField the second time.
This might be totally normal behaviour, but it caught me off guard. It seems the qfieldsync plugin does not recognize the first set of points have al ready been synchronized?
The reason I put this question here is I did not find in the documentation anywhere the need to remove the project fies from my phone, do a new packaging after syncing, copy the new export to my phone and then add the second set of points.
Again, it might very well be this is obvious to most, but I was expecting the sync plugin to recognize earlier synced data.


texts: Print reports from ArcGIS Enterprise web apps

texts:
Can I get my output report in word by publishing a new print service with ArcGIS Web AppBuilder printing tool? The source link I referenced while working on this topic is attached.
https://www.esri.com/arcgis-blog/products/arcgis-enterprise/mapping/print-reports-from-arcgis-enterprise-web-apps/


texts: Seeking QGIS tool for auto correcting address ranges at new intersections

texts:
I do public safety GIS, which is primarily centerline work. A tool that I have found indispensable when creating intersections where I don't have exact address point data is the Intersect Line tool from ETGeoTools / Ian-Ko. See the picture below for details on exactly what it does. It's basically the planarize lines tool on steroids.

I have moved 99% of my workflows over to AGP, and am in the process of migrating many to QGIS as I recently made the switch to Mac hardware and am a huge fan of open source.

Is there a tool in QGIS that can do this same thing or something close?


texts: ArcGIS Geoprocessing Service fails on data loading

texts:
I have a Desktop Script tool that works fine when run on desktop, but does not work when the results are turned into a geoprocessing serice. Running ArcGIS 10.2 on Desktop and 10.2 on server.

I have found that the geoprocessing service fails at the line of code where it tries to to load a data file I have saved to file. I have tried saving the data files using pickle, json, and also array files as .npy and .npz. It doesn't seem to make any difference. The geoprocessing service just will not load any array type file I provide. I have tried letting the geoprocessing packager save the file to the server, I have saved the files to a registered folder, and it doesn't seem to matter. Even text files will not load.

Has anyone been successful at loading a numpy array, dictionary, or similar type file into a geoprocessing service on arcgis server? If so, how did you do it?

I added error handling to my script, and here are the messages when I run the Geoprocessing Service:

Traceback Info:
File "E:\ARCGIS~2\DIRECT~1\ARCGIS~4\ARCGIS~2\Grace\HT5C33~1.GPS\EXTRAC~1\v101\HTAT_S~1\140307_HTAT_debug.py, line 74, in [module]
npzfile = numpy.load(array_package)

Error Info:
[Erno 2] No such file or directory: u'C:\\Users\\arcgis\\AppData\\Local\\Temp\\..\\cd\\tooldata\\package131123.npz

The E: drive is on the gis server machine and the .npz file is my data file I am trying to load. 140307_HTAT_debug.py is my source script. Apparently the npz file was copied over to the server, but not sure what that path means with the double dots, and why the server can't read it.


texts: Max number of versions allowed in SDE / weird behavior with large number of versions

texts: Is there a maximum number of versions allowed in an enterprise geodatabase? I have an enterprise geodatabase with a default version that has about 70 child versions. I am experiencing weird behavior where children versions is pushed to the default version without me doing anything. This has happened several times, apparently randomly. I am unable to replicate it, but it happens about once a week. Note that the database is on SQL Server 2014.


texts:
I am downloading raster layers in R from Global Forest Change (https://earthenginepartners.appspot.com/science-2013-global-forest/download_v1.4.html, data produced by Hansen et al., 2013). Each raster has 40000x40000 raster cells (~30m pixels) and weight 20-600 Mb when compressed (so, more than 10Gb when working with).

The data is provided in tiles spanning 10x10º and I need to get the whole world. However, some of the tiles only comprise the ocean, which has value 0 for all pixels.

I am trying to find a way to unveil whether a downloaded tile is only ocean or contains some additional data. If it is just ocean, I can create a custom raster with the desired resolution, extent and value=0 instead of doing some calculation on the raster that takes time due to the files size and resolution.

I have tried with

unique(values(raster))

inside and if() conditional, but that's an operation that takes a huge amount of RAM memory to perform for a single tile. I am trying to paralelize the process to use several cores for several tiles at the same time, and this is the only step where I run out of RAM memory and crashes the process.

Is there a different efficient approach to see if the values in the raster layer are only 0, so I can take a decision on the conditional about how to continue?

This code downloads an "ocean tile" (only ceros) and a "land tile" (additional values to cero):

temp_ocean <- tempfile()
download.file(as.character(https://storage.googleapis.com/earthenginepartners-hansen/GFC-2016-v1.4/Hansen_GFC-2016-v1.4_treecover2000_10N_120W.tif), destfile = temp_ocean)
ocean <- raster(file.path(temp_ocean))

temp_land <- tempfile()
download.file(as.character(https://storage.googleapis.com/earthenginepartners-hansen/GFC-2016-v1.4/Hansen_GFC-2016-v1.4_treecover2000_10N_080W.tif), destfile = temp_land)
land <- raster(file.path(temp_land))

Maybe it is just the way it is for such files, but I keep thinking that someone might come up with a different approach.


texts: I'm trying to make a decision tree in PyQGIS, but I can't find anything in the API that helps me to get started.  I am going to work with raster data of surveys, radiometrics, magnetometrics, surface temperature and other derivatives of DEM, but I need to do it automatically to facilitate work with other areas.  I need to get a raster image that directs me to the areas where the parameters assigned to each image are met, I do this process in ENVI but now I have to do it in QGIS.


texts: Adding several shapefiles to GroupLayer fast using ArcObjects

texts:
I want to add a bunch (several hundreds) of shapefiles (all feature layers) to a GroupLayer.

When I add them file by file this takes too long:

IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace pFeatureWorkspace = pWorkspaceFactory.OpenFromFile(dir, 0) as IFeatureWorkspace;
IFeatureLayer pFeatureLayer = new FeatureLayer();
pFeatureLayer.FeatureClass = pFeatureWorkspace.OpenFeatureClass(filename);
pFeatureLayer.Name = pFeatureLayer.FeatureClass.AliasName;
groupLayer.Add(pFeatureLayer);

I found IMapLayers.InsertLayersInGroup which takes an IEnumLayer but I can't find a way to load the shapefiles as an IEnumLayer. So I can't even say, if this would be faster.

Does anyone have a clue?

Update
I tried Kirk's hint with IName like this (totally ignoring possible null values):

IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace pFeatureWorkspace = pWorkspaceFactory.OpenFromFile(dir, 0) as IFeatureWorkspace;

IFeatureLayer pFeatureLayer = new FeatureLayer();
IWorkspace w = pFeatureWorkspace as IWorkspace;
var names = w.get_DatasetNames(esriDatasetType.esriDTFeatureClass);
names.Reset();
IDataLayer pDataLayer = pFeatureLayer as IDataLayer;
pDataLayer.DataSourceName = names.Next() as IName;
groupLayer.Add(pFeatureLayer);

It takes more than double as long as my first shot. So I think I'll stick with that one.


texts: Repairing data source for ArcGIS XY Event Table/Layer

texts:
I was given an .mxd file containing a lot of layers with broken data sources. I was able to fix most of them by looking at the old data source in the Source tab of the map property.

However, there are several layers that do not contain any data source info. All that is displayed in the Source tab is:

Data Type: XY Event Source
X Field: LONGITUDE
Y Field: LATITUDE

I was wondering if it is possible (and how) to find out the old data source and repair the data source?


texts:
I have two layers (polygon and point) in QGIS added from PostgreSQL database and want to select polygons from index grid with 5 or more points on them.
Is this possible to do in QGIS or in PgAdmin?

here is an example photo:


texts: R spTransform polygon that crosses dateline

texts:
I have created polygons with CRS = UTM (see here), which I need to transform to latitude/longitude. Some of my polygons cross the dateline, which causes the transformation to create a polygon that crosses the entire globe.

library(sp)
library(rgeos)

points <- data.frame(x = c(-179.5, 0), y = c(-50, -30))
coordinates(points) <- ~x+y
proj4string(points) <- '+init=epsg:4326'

points_sp <- spTransform(points, CRS('+init=epsg:32621')) # wrong zone, but ignored for example
# expand point to circle
circles <- gBuffer(points_sp, width = 1e+5)
# transform back to WGS84
circles_latlon <- spTransform(circles, CRS(proj4string(points)))

par(mfrow = c(1, 2))
plot(circles, axes = TRUE, main = 'UTM')
plot(circles_latlon, axes = TRUE, main = 'WGS84')

Is there a solution to split the polygons? Or and alternative solution that takes care of the dateline issue?


texts: leaflet returns wrong {x} {y} tiles from arcgis mapserver

texts:
I'm trying to add a leaflet map to an Angular 2 project, which shows a layer from an ESRI mapserver as a tileLayer. As such:

ngOnInit(): void {
    let map = L.map('map', {
        crs: L.CRS.EPSG3857});
    map.setView([51.19612, 4.4206237], 10)
    let tileLayer = L.tileLayer('http://geodata.antwerpen.be/arcgissql/rest/services/P_Publiek/P_basemap_wgs84/MapServer/tile/{z}/{x}/{y}', {
        minZoom: 1, maxZoom: 18, maxNativeZoom: 21, bounds: [[51.13, 4.28], [51.27, 4.56]]
    });
    map.addLayer(tileLayer);
}

The initialization of the map works as intended, and the map tries to add tiles from the correct baseUrl. However when it searches for the {x} and {y} coordinates, something gets messed up.
For zoomlevel 10 I get an 404 for  http://geodata.antwerpen.be/arcgissql/rest/services/P_Publiek/P_basemap_wgs84/MapServer/tile/10/524/342 which is correct as the tiles for that zoomlevel are situated around 68300 {x} and 71000 {y}.

I am not an expert regarding mapserver/leaflet/coordinate systems, so I could be missing something obvious, but in the documentation on leaflet or in the various examples I haven't seen anything regarding defining the origin of tiles.

I have tried what's suggested here:
https://stackoverflow.com/questions/22504251/set-map-center-in-leaflet-with-3857-lat-lon

Following plnker gives the very basic case with the corresponding url and the returning wrong results:
wrong tiles plunker.

My question ultimately is: am I missing something regarding the definition of the tiles or is there something in the configuration of the mapserver/layer which I need to take in to account?

EDIT: tested the same plunker with the maptile from OSM (http://{s}.osm.maptiles.xyz/{z}/{x}/{y}.png) and these give back some result. The direction of the tiles is not correct, but at least they get found. Maybe something in the configuration of the original mapserver is wrong?


texts: Address cleansing software compatible with ArcGIS

texts: I am looking for an address cleansing program i.e, a program that takes an address and cleans up misspellings, corrects city or zip as well as correcting wrong prefixes and/or suffixes. Ideally, said program would be compatible with ArcGIS so the geocoding process can be automated. Does anyone know of the existence of such a program? I have searched high and low to no avail. The addresses are usually provided by the user. For example they might provide 150 main AVE, san diego ca. When in fact it's supposed to be 150 main ST, san diego ca. I need a program that can catch such errors.


texts: Are there advanced Mapillary sequence editing tools (interpolation, streightening, key photos, etc)

texts: Is there a nicer way to edit Mapillary photo sequences? The online editor is very basic and only allows moving photos one by one.


texts:
I have a query which I use to find a route between two points. Even though the route is displayed good on the map the order I get from pgRouting is wrong.

The query is this one:

SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson,
                   length(ST_transform(rt.the_geom,3785))as meters,x1,x2,y1,y2,name, ways.gid
                FROM ways,
                    (SELECT gid, the_geom
                        FROM dijkstra_sp_delta(
                            'ways',
                            714,
                            4807,
                            0.1)
                   ) as rt
              WHERE ways.gid=rt.gid;

Do you know any way to take the segments of the route in right order?


texts: Calculating the longest distance within polygon in QGIS

texts:
I want to calculate the "diameter" of polygons in QGIS.

The "diameter" defined as the distance between the two most distant points of the polygon.

I couldn't find a fitting solution in the field calculator. Maybe you have some ideas?


texts: Why is QGIS project in recent projects greyed out?

texts:
When I open QGIS, there are projects which cannot be chosen. They work when I start browser of files and click in directory where the projects are.

Are there options to change it?


texts: Creating tiled pyramidal TIFF from PNG tiles that are organized in slippy map?

texts:
I have map tiles (Z/X/Y) of a certain location which I serve via a simple web server and add on QGIS for offline usage via the XYZ Tile Layer from the Browse menu.

These are to be used in a survey of a remote area that doesn't have Internet connectivity. However, moving these tiles from device to device takes time and I was wondering if I could convert them to a pyramidal tiled TIFF file which would admittedly be a large file but will be simple to move around and also to add to QGIS (as a raster layer).

It is also more amenable to land analysis.

I have looked at various libraries such as libtiff, etc but most seem capable of going the other way (from one large raster TIFF to XYZ tiles).

What I need to do is put the tiles of each zoom layer into one layer of the image pyramid. Each layer should be a tiled layer.

Can anyone point me in the right direction?


texts: Geoserver 2.5.4 getfeatureinfo intermittent: [freemarker.runtime] - Template processing error: "Expression feature. is undefined

texts:
We have a Geoserver serving a number of WMS layers from a PostGIS backend. Two are polygon layers with a content.ftl defined for getfeatureinfo requests.

These two randomly but rather often fail to show in the same info-popup.

The logs say

  ERROR [freemarker.runtime] - Template processing error: "Expression feature. is undefined on line 7,..  in content.ftl

--
The thing is that it shouldn't be undefined and it isn't most of the time and never when there's just one of the two layers in the map.

The content.ftls are similar, both beginning akin:

<#list features as feature>

Designation: ${feature.designation.value}

i.e  list features as feature, do ${feature.column.value}.

Could this be some sort of timings issue?


texts:
What is the best linux distro for using QGIS? By best I mean:

Easy to install latest version with all plugins.
Includes QGIS map server and instructions for getting it running.
Is easily updated to the latest version of QGIS.

Currently, I have had unfortunate experiences on QGIS with Ubuntu and Fedora either using very old versions, breaking features during updates, missing core plugins, or lack of documentation. Which distro are QGIS developers running?


texts: Importing feature class keeping relationship classes to annotation using ArcMap

texts:
I have a project I've been working on for a few years using 10.2
In the past I have been able to update the gdb by importing data from a shapefile to an existing feature class. ArcMap would tell me there was already a feature class with that name and did I want the data to go in that feature class, which I would allow.  The result was a feature class with updated data that was still linked to my annotation via a relationship class.  Any new data would have annotation generated for it.
When I went to follow the same process in 10.8 ArcMap didn't ask me about the naming conflict but instead imported the data and deleted the relationship classes.  Was there a change between 10.2 and 10.8 that would cause this or am I missing something?


texts: Unlocking 3D Analyst and Spatial Analyst Tools with ArcGIS Pro?

texts: If I buy ArcGIS Pro, do I need to buy Spatial Analyst and 3D Analyst extensions separately, or do they come free with the package?


texts: How to determine the number of rows and columns of DEM in ArcGIS

texts: I have a AsterDem of resolution 30m for my study area. I want to know the number of columns and rows present in the DEM raster. How do I find it out using ArcGIS?


texts: Creating Buffer around series of lines in R?

texts:
For a GIS class I'm taking I'm trying to create some spatial statistics for a route through a city. I need to create a buffer of 100m around the route. It looks like i can use gbuffer from rgdal but that requires that the data is prjected, which it's currently not. It sounds like i can project with spTransform but I'm not certain which method from rgdal to use.

Is there an obvious answer or a good resource for figuring that out?

Summary of the Spatial Lines Dataframe object I'm working with below.

Object of class SpatialLinesDataFrame
Coordinates:
   min       max
x -0.13590  0.033067
y 51.47773 51.543564
Is projected: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]

I'm currently trying this line but the object it returns still is not projected...

Projected_Path = sp::spTransform(path, "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" )


texts:
Possible Duplicate:
  Comparison of Open Source Desktop GIS Packages

I'm doing a little research to the available open source GIS-applications. I found a lot of OSGIS on the internet and now I'm trying to download them all and compare them using some technical components. I use:

is it free?
it is easily available (so no registration etc.)?
can it visualise the data?
can it manage the data?
is what language is it written (C, C++, ...)?
is there a large community behind it?
it is easy to use (interface, ...)?
in what language is the OSGIS (English, Dutch, French, ...)

What do you guys think about this? And most important: are there other technical components that could be much more important?

Thanx for the answers!

Y


texts: How to figure out an unknown reprojection of a old (18 century) map (raster)?

texts:
Here is a map of the Russian Empire of the late 18th century and I want to know its projection system. Unfortunately, the map does not contain information, which latitude point is a basis/which coordinate system it uses.

Could you give me an advice, how to transform the unknown projection of the map into a commonly used ones (e.g. WGS84). I can georeference the raster but it is not a solution in my case because I need to know how to transform the values of the system for other maps, which use (apparently) the same projection system. Examples of the rasters to transform using the projection are below.

https://yadi.sk/i/LS45OGbswAACx

P.S. Updated a second link. Should work now.


texts: U.S. Census Data, Block Level, Where to Find It

texts:
Does the Census Bureau still release block level data, say for 2014? If so, has anybody been able to successfully procure it, and how?

I spent a large portion of yesterday exploring the FactFinder website and others looking for Block Level data. I am looking for general demographic data, general housing data, and even the blocks themselves for a community fire study I am working on. I can adjust the variables based on what data is available.

I understand that due to reporting and privacy that certain areas are available in different scales. I am looking for block level data for San Jose, CA and Santa Clara County, CA (which in the past been made available by block) . I am only able to find a few links to 2010 data at that level but hoping to find newer data. I don't even see the block level in the drop down selections (I have played with numerous data sets to see if they populate the block selection).


texts: Not showing the unselected elements for map production

texts: I have made a selection using attributes, from two different feature classes, once I have done that, i want to make map, but i want other 'unselected elements' to be not seen in actual map, below picture for illustration.


texts:
Problem

How to calculate center of each custom tile as a point (x,y) or (x,y,z) where z is zoom level, in a projection: EPSG:3857?

What I know about the tiles

Originally they are served as TMS
They represent png images 256*256
They are in projection: EPSG:3857
In OpenLayers2 they were coded like TMS layer
In OpenLayers3 (v.3.8.2) they are coded like XYZ layer (that includes -y) as shown in this example:

-

  var baseLayer = new ol.layer.Tile({
      source: new ol.source.XYZ({
        url: 'http://path/to/the/tiles/base/{z}/{x}/{-y}.png'
      })
    })


texts: How to get a street map from location point and distance

texts:
I would like to find a way to get the map giving a location point (center point) and a distance.

For example, I would like to get the image map of a place with a squared area of N, S, E, W each 525 m from location point 51.05660 N, 3.721500 E.

I would like to download, if possible, the image generated of this zone in png, eps or shapefile.

Regards


texts: Output not connecting as input in ArcGIS ModelBuilder?

texts:
As seen in the image, I am trying to connect "Output Dataset" i.a result of merge of 2 shapefiles as input in the CLIP tool.

As you can see in the image(in the red highlighted area), input option is not coming when I am trying to connect "Output Dataset" with CLIP.

What should I do?


texts: How to perform a slope analysis in QGIS?

texts: I have contour information in the form of line features (see picture below) and I want to do a slope analysis in QGIS. Is it possible?


texts: OpenLayers map blurry with pixelRatio = 1

texts:
I needed to display raster image tiles served from GeoServer on my OpenLayers 6 map. Using TileWMS(), this was working fine, but was a little slow, so I wanted to start using GeoWebCache from the server. I opted to continue using WMS (I need to use getFeatureInfo() so WMTS() wouldn't work). This alone didn't seem to speed anything up, and I saw a recomendation somewhere to set the map pixelRatio: 1. This allowed for a significant speed increase. Tiles load immediately (was taking about 3 seconds per layer before), but now the map seems blurry. This is very apparent on point and label features on the map, but it could be happening on other features and layers.
The tile layers are merged into a layerGroup comprised of Google street layer (OMS) and 5 WMS layers served from Geoserver.
How can I get similar performance increases while maintaining the clarity on the map?
Relevant code:
this.map = new Map({
      target: 'map',
      layers: [
        this.baseLayers
      ],
      pixelRatio: 1,
      overlays: [this.somePopup],
      view: new View({
        center: olProj.fromLonLat([-86, 38]),
        zoom: 5
      }),
    });

var layer = new TileLayer({
        name: 'tile-layer',
        className: 'tile-layer',
        extent: [-13884991, 2870341, -7455066, 6338219],
        source: new TileWMS({
          url: 'https://geoserver.url.com/geoserver/some_workspace/wms',
          params: {'LAYERS': 'some_workspace:some_layer', 'TILED': true, 'WIDTH': 256, 'HEIGHT': 256, 'SRS': 'EPSG:3857'},
          serverType: 'geoserver',
          projection: 'EPSG:3857',
          transition: 0,
        })
      });

Update: I have discovered that when 'pixelRatio' is not set to 1, I am not hitting GWC, which explains the slowness. Referencing this post.


texts:
I am struggling to get derived data from a shapefile. In the attribute table of the shapefile, I can see just the id, initialdat and finaldate.

Does anyone have a good solution to get the derived data in R or QGIS?


texts: Generate contour lines for big DEMs and import into PostGis

texts:
I've downloaded the SRTM DEM files for most of Europe, from both 3arc_v4.1 and 1arc_v3 versions. The first comes in 5x5 degrees tiles, the latter in 1x1. I can stitch them together with gdalbuildvrt into a huge file (208801x90001 pixels, according to gdalinfo). So far so good; I can even generate terrain coloring, hill and slope shading without a problem (except time, of course).

What I can't do is to generate contour lines for it. gdal_contour either runs out of RAM (8GiB) or reaches the ESRI Shapefile file limit (2GiB, I think). I can generate shapefiles for each individual tile and then run shp2pgsql to import it, but the problem is at the tile limit: The contour lines from one tile cross the correlative one from the next tile. For example:

http://grulicueva.homenet.org/~mdione/Elevation/#14/45.0000/15.0000

So the question is: is it possible to import such big datasets, in particular directly to PostGis? if not, is it possible to stitch the individual ones before importing into PostGis?


texts: QGIS Expression string builder has buggy text

texts:
Whenever I open a tool which opens the familiar 'Expression String Builder' interface, the text in the input box behaves very strangely - the cursor is offset, and text becomes overlaid. This makes it very difficult to edit expressions using this editor.

Any suggestions on what settings could be responsible for this situation?

This screencap shows an example of the poorly rendered text, the string entered is:

"SA22018_NAME"  +  '\n'  +  "2018_rollcount"


texts:
After having built a QGIS 3 plugin, I'd like to know how could I call my plugin without clicking on the plugin bar of QGIS to launch it.

I've tried implement a first batch file for it :

REM changer OSGEO4W_ROOT pour aller sur le dossier du shell
SET OSGEO4W_ROOT=C:\Program Files\QGIS 3.4
SET QGISNAME=qgis
SET QGIS=%OSGEO4W_ROOT%\apps\%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
REM Gdal setup
SET PATH=%OSGEO4W_ROOT%\bin;%QGIS%\bin;%PATH%
SET PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
SET PYTHONPATH=%QGIS%\python;%PYTHONPATH%

REM Launch python
REM python "C:\Users\(username)\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tombarel\zoom_snap_dialog.py"
pause

The problem is I don't know how to launch the plugin from my batchfile once I've opened QGIS (version 3.4.4)

I've seen previous answers where fToolsmodule was still available for QGIS 2.X. but about the version 3 of QGIS I can't figure out how to do a standalone program which actions the plugin

I've tried to look at the run()method in the plugin main python file but I couldn't find a way either to call it from another python file


texts: Determining whether to use 64 bit QGIS over 32 bit QGIS?

texts:
I cannot find any supporting documentation explaining why to use QGIS 64 bit instead of 32 bit or vice versa on www.qgis.org.

Is there any available?

I believe 64 bit should allow you use more machine memory than 32 bit, which may be useful for large files/datasets.


texts: ArcGIS Online cannot add enterprise user with hyphen in email address

texts:
When "inviting" users to join our ArcGIS Online organisation with the option "Add members using their enterprise ID", it works for most of the users.  They receive and email, click on the link in the email, and the account gets created.  They can then log in using their Active Directory credentials.
However, one of the users has a hyphenated surname, and the hyphen is included in their email address.  When this user clicks on the link in their invitation email, they get the following error:

Notification
Error in accepting invitation for user 'fred.bloggs_smith@worplace.com._WorkPlace', Invitation Id '15a11bf4Ae7bfaaa8bc29422cb7d28de9' Cannot accept invitation.
User email must match invitation email.

Note that the username (which is the concatenated email address, underscore, and organisation name) has the hyphen replaced with an underscore.
It has the correct email address, as the user received the email, and it is still listed correctly with the hyphen in the list of "Pending Members".  So it is only in this username that it has been changed to an underscore.
I understand that hyphens are not permitted in the username.  That's fine.  But are they also not permitted in the email address?  Surely it should accept any valid email address?
How can I get this user registered with their enterprise login on our ArcGIS Online organisation without creating a new email alias for the user?
(Note that I'm aware of the option to "Add members using their enterprise ID without sending invitations".  I do not know if this would resolve the issue or not, but I have been unable to use this option due to a separate problem which is still unanswered at:  ArcGIS Online "Add members using their enterprise ID" - what value to use for "Enterprise ID"? )


texts: Does Euclidean distance consider multiple points nearby?

texts:
I have a hypothetical setting I am trying to use to better understand Euclidean distance. So of course this example will only work for the purpose of understanding a concept, rather than actually being realistic. I want to find the impact of urban trees on the indoor air quality of nearby buildings. Of course, this would be the idea that by being nearby more trees, your building would have cleaner air inside. However, I need to prove this, which I want to do with regression, saying that yes, there is a statistically significant relationship between proximity to trees and indoor air quality. I am trying to figure out how to actually get this distance-to-trees consideration into a data layer, and I am thinking I should use Euclidean distance.
How would Euclidean distance in this situation be different than just distance? More specifically, would Euclidean distance mean just the distance from a building to the nearest tree and that's it, ignoring all other trees less nearby, but still somewhat nearby? To conceptualize, let's say building A is 25 feet away from the nearest tree and that is the only tree within a 100 foot radius, and building B is 50 feet away from the nearest tree, but there are multiple of these trees that are 50 feet away. How would all of these distances be weighted? If we are conceptualizing these trees as radiating clean air, then which building would be more affected by the trees in terms of Euclidean distance? Yes, building A is closer to a tree than building B, but building B has more trees still somewhat close to it. This is the confusion I am having over whether I should use Euclidean distance. Would Euclidean distance still be appropriate for this situation since I am interested in proximity?
The goal would be to use the Euclidean distance raster output layer as the explanatory variable in a geographically weighted regression, with indoor air quality for buildings as the dependent variable, all in QGIS.


texts: Creating smaller sized grid and interpolating data from bigger grid

texts:
I am working with a vector grid that looks like this:

I am not very experienced with QGIS and have been looking for a way to divide each mesh of the grid a certain amount of time to get a smaller grid like this:

Instead of a 6x6 grid I would have a 12x12 grid. I then would like to interpolate each cells value with each other to get a nice gradient instead of something that is so pixelated. I am not even sure interpolation is the right term here...?

Is there a way of doing so with QGIS? I could work with python too if it's needed or if there is an easier way with it.


texts: Calculating length of polygon in geopandas?

texts:
For example to calculate the area is like this:

df['area']=df['geometry'].area

How do we find the length of the perimiter?


texts: Display Distances and Azimuths for parcels in QGIS

texts:
I need to extract distances and azimuths (metes and bounds) from shapefile parcels in QGIS. I tried using the "Azimuth and Distance Calculator" plug-in, but all that I get when I run it is "The limit of a patrimonial area must be single part geometry" and then Python error "TypeError: 'NoneType' object is not subscriptable". The shapefile I am trying to extract Distances and Azimuths for is here: http://honolulu-cchnl.opendata.arcgis.com/datasets/parcels-tax

Does anyone know how I can make the plug-in work or an alternate way of doing this?


texts:
I'm trying to make a Leaflet map with World Eckert IV projection using Proj4Lefalet.  From what I understand, I should be able to define my CRS like so:

var crs = new L.Proj.CRS('ESRI:54012',
    '+proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ',
    {
        resolutions: [8192, 4096, 2048, 1024, 512, 256, 128],
        origin: [0, 0]
    });

Given that ESRI:54012 is the code for this projection.  However, I
get the error:

uncaught exception: ESRI:54012

I cannot find an EPSG code for this projection, just an ESRI code.  Am I missing something here?


texts:
I need to dissolve a feature class based on two fields for the dissolve_field parameter and two fields for the statistics_fields parameter.  Does anyone have an example of how to do this using C#?

The code I'm using works if I only pass in a single field for the dissolve_field parameter:

ESRI.ArcGIS.DataManagementTools.Dissolve dissolve = new ESRI.ArcGIS.DataManagementTools.Dissolve();

//Set parameters values
dissolve.in_features = "... path to feature class to dissolve ...";
dissolve.dissolve_field = "Field1, Field2";
dissolve.statistics_fields = "[NumberField1,MIN],[NumberField2,MAX]";
dissolve.multi_part = "MULTI_PART";
dissolve.unsplit_lines = "UNSPLIT_LINES";
dissolve.out_feature_class = "... path to the output feature class ...";

// Dissolve the feature class
Geoprocessor geoprocessor = new Geoprocessor();
object result = geoprocessor.Execute(dissolve, null);


texts:
I often work on mapping sensitive patient level data. Whilst I feel I have a good grasp of many of the governance issues around this (ie when to use binning and k-anonymity techniques) but I'd like to improve my knowledge on this.

Here is a good example of why this is of importance: Spatial confidentiality and GIS: re-engineering mortality locations from published maps about Hurricane Katrina

Does anyone have any good rules of thumb they employ when mapping sensitive data?

Are there any good resources out there which cover different methods of protecting confidentiality or provide guidance on the matter?


texts: Measuring distance between points along a river system

texts: I have a forked river with multiple x,y data points along it and I need to measure the distance between these points when travelling along the river.  However the forked part is throwing a wrench into things.  I need the total distance as you move from 1-2, 2-3, 3-4 etc.  The problem is the points are not sequential along the river and some points are in one fork while the next points are in the other. This is in ArcMap10. Thanks


texts: Add Attributes to OpenStreetMap Data in ESRI that was already Loaded?

texts:
I followed some instructions to load OpenStreetMap Data into a geodatabase for our companies footprint using the "Load OSM Data" in the OpenStreetMap Toolbox for ArcMap. My end goal was to create a network dataset using this data. It has finally completed after running for about 2 weeks. I was reading another instruction set that added this information to the steps that were not included in the first Instructions I read initially.
    Expand the optional Adjust Input Schema parameter and add the following OSM tag keys to schema:

admin_level
bridge
content
craft
drinking_water
emergency
ford
generator:source
maritime
name
name:en
office
oneway
pump
ref
religion
seasonal
tower:type
tunnel
The following tags are optional. They are required for a network dataset. Adding these tags at this stage speeds up the creation of the network dataset if it is required:
access
construct
maxheight
maxspeed
proposed
smoothness
surface

I am hoping there is a method or a tool where I can add these attributes that I did not load initially to the dataset. This is a somewhat time-sensitive project and I sadly do not have 2 weeks to do this over again.


texts: How do I programmatically automate "Random Points" in QGIS?

texts:
The random point tool in QGIS 2.4 works perfectly fine through the GUI, but I can't figure out how to automate this tool via Python and/or the modeller.

Specifically, under the menu items: Vector | Research Tools | Random points, I am able to create a random point file that is based on a column in the input Shapefile. When I examine Processing | History and log, I am unable to find the python equivalent command to automate this command.

There's a similar algorithm under the Processing Toolbox called "Random points inside polygons (variable)", but this plugin appears to be slightly different than its GUI counterpart (e.g., it contains an option to input a minimum distance between points). More importantly, this version of the tool does NOT work with the very same shapefiles that work when using the GUI version of the random point tool mentioned above.

How I can call the GUI version of the "Random Points" tool via the modeller and/or Python?


texts:
With me I have a csv file. Am using qgis 1.8.5.
I added delimited layer to a map shapefile in qgis. I noticed that some cooridates fell out of the boundaries of the .shp file.
I selected the coordinates whcih are out of the boundary using "Select Features by Rectangle".
 I tried dragging the selected coordinates but I wasn't unable to do that. Where am I going wrong?