[postgis-users] OSM post import questions

2015-11-23 Thread Thomas Endres
Hi, I have a couple post-import questions regarding North America osm data - hoping someone can help. Using the following with Postgres 9.4.5 and PostGIS 2.2 on an ubuntu instance. osm2pgsql --create --slim --cache 14000 --number-processes 4 --hstore -d osm --flat-nodes

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Darrel Maddy
OK I spoke too soon. I tried this: SELECT (ST_SummaryStats(ST_Union(rast))).sum sum FROM (SELECT ST_MapAlgebra(deposition.rast, concentrated.rast, 'IF concentrated > 6 THEN deposition ELSE NULL ENDIF ' ) FROM mymodel.deposition, mymodel.concentrated WHERE

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
The expression has to stay as it was: 'IF [rast2] > threshold THEN [rast1] ELSE NULL ENDIF ' Just replace the threshold value as you did. Do not try to replace the [rast2] and [rast1]. They refer to the first and second raster pixel values. Read the ST_Mapalgebra doc... Don't expect our

[postgis-users] GDAL to postgis issue

2015-11-23 Thread Stephen Crawford
Hi All, I am trying to use GDAL to translate a NetCDF to sql for insertion into postgis with . The NetCDF file uses 0-360 for longitude instead of -180/180. Does anyone of a switch or function somewhere along the line--in GDAL, raster2pgsql, or postgis--that can fix this for me.

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Roxanne Reid-Bennett
On 11/23/2015 12:41 PM, Darrel Maddy wrote: Dear Pierre, I was not looking for a total solution and I am grateful for the suggestion. Although it may not look like it, I did consult the documentation and also I have Regina’s book beside me. Unfortunately, for me at least, both documents

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
Good catch Roxanne! Thanks! From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Roxanne Reid-Bennett Sent: Monday, November 23, 2015 7:46 PM To: postgis-users@lists.osgeo.org Subject: Re: [postgis-users] Help with SQL query? On 11/23/2015 12:41 PM, Darrel Maddy

[postgis-users] Error Edge intersects (not on endpoints) with existing edge when creating edge topology

2015-11-23 Thread ranjitsaurav
Hi everyone, I am having the problem in creating the edge topology in postgresql. When I try to create the edge topology I get the error as "Edge intersects (not on endpoints) with existing edge" from my linestring. Could anyone suggest how to modify my line string so that this error is not

Re: [postgis-users] min distance to right and left

2015-11-23 Thread toni hernández
I'll first approach it with topology. Sounds great! :) (Also I hadn't thought about dead end streets.) Thank you! *Toni Hernández Vallès* Servei de Sistemes d'Informació Geogràfica i Teledetecció - Universitat de Girona *SIGTE* - Pl. Ferrater Mora 1 17071 Girona Tel +34 972 418 039 (7026

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Rasmus Aveskogh
Regarding filename matching etc. I would just wrap everything in a scripting language of your choice (bash, python, ruby etc.) considering all the GMT programs, including grdmath, are command line tools. -ra On 23 Nov 2015, at 16:27, Rasmus Aveskogh wrote: > > Though this

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Rasmus Aveskogh
Though this is probably possible in PostGIS nowadays I would personally solve such a use case with GMT (http://gmt.soest.hawaii.edu/), for example with grdmath (http://gmt.soest.hawaii.edu/doc/5.2.1/grdmath.html) which lets you perform rather complex computations on multiple grids (for

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
Darrel, 1) Create a new raster selecting the right pixels with ST_MapAlgebra(raster, raster) 2) Make sure only intersecting rasters are processed by using their upper left corner X and Y coordinates (with ST_UpperLeftX() and UpperLeftY()) 3) Sum the selected pixels with

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Darrel Maddy
Dear Pierre and Rasmus, Many thanks for trying to help. Rasmus: I am aware of GMT but I was looking for a solution in postgis so that I can keep all of the data extraction in one place. Pierre: That is exactly what I was looking for and very many thanks for including the explanation. I am a

[postgis-users] min distance to right and left

2015-11-23 Thread toni hernández
Hello everyone, I have two tables: streets and buildings. streets with a linestring geometry and buildings with polygons geometry. I need to know what is the minimal distance from each street to a building on the right, and then, what is the minimal distance from the street to a building on

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Darrel Maddy
Dear Pierre, I was not looking for a total solution and I am grateful for the suggestion. Although it may not look like it, I did consult the documentation and also I have Regina's book beside me. Unfortunately, for me at least, both documents assume some knowledge of SQL - which I do not

Re: [postgis-users] OSM post import questions

2015-11-23 Thread Imre Samu
Hi Tom, > osm_id field contains non-unique values as well as negative values This is normal. Osm2pgsql optimised for rendering. - The osm2pgsql program now spliting long ways after around 1 degree or 100km https://github.com/openstreetmap/osm2pgsql/search?utf8=%E2%9C%93=Split+long+ways -