Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
Thanks. I couldn't see how this would help as this is structural not mathematical. But I am trying to bring the parts back together. S On Tue, 22 Jan 2019 10:01:36 +1100, Martin Davis wrote: Could the problem be the use of the ogr2ogr option -nlt POLYGON ? Some of the input geometries

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
Try the ireland.sql file again. I used Paul's suggested SQL. S On Tue, 22 Jan 2019 09:39:25 +1100, Martin Davis wrote: Not much help, I'm afraid. I need the geometry in WKBHex. Not sure offhand how to get that out of PostGIS. Just post the WKT and let's see what that looks like. On Mon,

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon (SPDBA) Greener
I'm didn't load into geometry, I used ogr2ogr to load into geography. All work to date has been ok except now I want to aggregate union the polygon parts of bounties with multiple polygon parts. ST_Union is not geographic aware hence all the trouble. Using geometry as the load target does not

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Martin Davis
Could the problem be the use of the ogr2ogr option -nlt POLYGON ? Some of the input geometries are multipolygons, and it sounds like the way to handle this with ogr2ogr is to use GEOMETRY or PROMOTE_TO_MULTI [1][2] [1] https://www.gdal.org/ogr2ogr.html [2] https://gis.stackexchange.com/a/195223

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Paul Ramsey
Just ’select geom’ will return the extended hexwkb (which we should have JTS support as a matter of convenience). If you need pure standard hex wkb, then select encode(st_asbinary(geom), ‘hex’) will do that P > On Jan 21, 2019, at 2:39 PM, Martin Davis wrote: > > Not much help, I'm afraid.

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Paul Ramsey
> On Jan 21, 2019, at 1:46 PM, Simon Greener wrote: > > Thanks Paul. > > However, I get the same number of distinct st_isvalidreason results. Something is awry here, because I get only 'Valid Geometry’ as a validity check result… I loaded your shape file, I have 42 irish counties, I didn’t

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Martin Davis
Not much help, I'm afraid. I need the geometry in WKBHex. Not sure offhand how to get that out of PostGIS. Just post the WKT and let's see what that looks like. On Mon, Jan 21, 2019 at 1:52 PM Simon Greener wrote: > Try here for an example: > >

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
Try here for an example: https://www.dropbox.com/s/n234bc6i5hj7y4o/Ireland.sql?dl=0___ postgis-users mailing list postgis-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
Thanks Paul. However, I get the same number of distinct st_isvalidreason results. Is there anything I can do with ogr2ogr when loading to help? Simon On Tue, 22 Jan 2019 08:34:02 +1100, Paul Ramsey wrote: +proj=gnom +lat_0=53.35 +lon_0=-6.26 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Paul Ramsey
> On Jan 21, 2019, at 1:28 PM, Simon Greener wrote: > > I can't find a suitable gnomic srid for PostGIS. > You’re going to want one centred on Ireland, not the pole, and I think maybe it’s wanting a geodetic basis, try this: +proj=gnom +lat_0=53.35 +lon_0=-6.26 +x_0=0 +y_0=0 +ellps=WGS84

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Martin Davis
Can you post the WKB of one of the failing geometries, from the loaded data? It's best to look at the exact input causing the problem. On a side note, I did notice that when the polygons were merged (using JTS, which works fine), there is only one very small hole in the result [1]. It seems to

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
Paul, I can't find a suitable gnomic srid for PostGIS. I have tried this: INSERT INTO spatial_ref_sys (srid, proj4text) VALUES (55000, '+proj=gnom +lat_0=90 +lon_0=-7.646288'); but I get this when I use ST_Transform. UPDATE data.osm_county SET geom55000 =

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Paul Ramsey
Not really sure that’s the answer… I’d much rather see work on geodetic edges in GEOS P > On Jan 21, 2019, at 1:20 PM, Darafei Komяpa Praliaskouski > wrote: > > If someone is willing, there is an old Geography Overlays patch that needs > lots of love:

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Komяpa
If someone is willing, there is an old Geography Overlays patch that needs lots of love: https://github.com/postgis/postgis/pull/191 On Tue, Jan 22, 2019 at 12:13 AM Paul Ramsey wrote: > > > > On Jan 21, 2019, at 1:00 PM, Simon Greener > wrote: > > > > When a geography is casted to geometry

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Paul Ramsey
> On Jan 21, 2019, at 1:00 PM, Simon Greener wrote: > > When a geography is casted to geometry for use in the aggregate form of > ST_Union (or other commands such as ST_Within) is the processing done > assuming the data is projected even when geodetic? All processing of geometry make

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Simon Greener
The shapefile (from OSM) can be accessed here: https://www.dropbox.com/s/jbptp3ycmc8cqzi/gis_osm_county_a_free_1.rar?dl=0 The command used to load is: ogr2ogr -overwrite -progress -skipfailures -a_srs "EPSG:4326" ^ -f "PostgreSQL" PG:"dbname='gisdb' host='localhost' port='5432'

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Martin Davis
Simon, can you post one (or more) of the geographies which are being reported as invalid when you run *select distinct st_isvalidreason(a.geog4326::geometry) *? It's certainly possible for reprojection to introduce invalidities, due to geodesic/straight line issue. I'm actually surprised this

Re: [postgis-users] Geography/geometry

2019-01-21 Thread Birgit Laggner
t;PostGIS Users Discussion" Gesendet: Montag, 21. Januar 2019 06:23:10 Betreff: [postgis-users] Geography/geometry Folks, I'm in a situation where I need to ST_Union or ST_Collect some osm_county Polygon (not MultiPolygon) data for Ireland. Now, because ST_Union or ST_Collect do not

[postgis-users] Geography/geometry

2019-01-20 Thread Simon Greener
Folks, I'm in a situation where I need to ST_Union or ST_Collect some osm_county Polygon (not MultiPolygon) data for Ireland. Now, because ST_Union or ST_Collect do not support geography, I cast to geometry before calling. select min(a.osm_id) as osm_id, a.name, count(*) as