From bhazuka at usgs.gov Tue Sep 1 08:55:55 2015 From: bhazuka at usgs.gov (Hazuka, Brad) Date: Tue, 1 Sep 2015 10:55:55 -0500 Subject: [postgis-users] Calculating center point for geographic polygon that crosses IDL Message-ID: Hello, I am fairly new to PostGIS and I am hoping some one can provide me a hand with an issue relating to scenes crossing the International Date Line (IDL) and finding the center point. I currently maintain a PostgreSQL database that contains footprints for satellite scenes. The scenes have global coverage and range in size from ~1500Km squared down to ~100Km squared. The footprints are stored in a geography column as basic polygons as seen below. SRID=4326;POLYGON((179.255436389612 49.0944921724897,-179.572711844818 49.0656217040858,-179.619180111394 48.3778311277411,179.224815891643 48.4060150740941,179.255436389612 49.0944921724897)) I need to be able to determine the center point of each scene in order to provide some additional information to various applications using the data. Based on forums and various other web resources, it appears the way to calculate the center point is by converting geography to geometry and using the ST_CENTROID function as seen below. ST_ASEWKT(ST_CENTROID(ST_GEOMFROMEWKT(ST_ASEWKT(footprint)))) Using my polygon example from above, the function call would look like the following. ST_ASEWKT(ST_CENTROID(ST_GEOMFROMEWKT('SRID=4326;POLYGON((179.255436389612 49.0944921724897,-179.572711844818 49.0656217040858,-179.619180111394 48.3778311277411,179.224815891643 48.4060150740941,179.255436389612 49.0944921724897))'))) Here is where the problem lies. In the above example, the centroid returns a center point value of the following: st_asewkt ---------------------------------------------------- SRID=4326;POINT(-0.148022213748242 48.7359898569253) Note that the centroid longitude is -0.148022213748242. The footprint I provided crosses the IDL. The scene center longitude should be ~179.8181. I was able to hack together an inelegant solution that will correct for the IDL on a Cartesian system up to a point. I have provided the code below. The code appears to work but will breakdown if the scene footprint is to large and I am sure I have not accounted for everything. CREATE FUNCTION test (in i_wkt varchar) RETURNS TABLE ( centerlat FLOAT , centerlon FLOAT ); AS $$ DECLARE l_ctrlat FLOAT; l_ctrlon FLOAT; l_lonmin FLOAT; l_lonmax FLOAT; l_lontmp FLOAT; BEGIN SELECT ST_Y(ST_CENTROID(ST_GEOMFROMEWKT(i_wkt))) , ST_X(ST_CENTROID(ST_GEOMFROMEWKT(i_wkt))) , ST_XMIN(ST_GEOMFROMEWKT(i_wkt)) , ST_XMAX(ST_GEOMFROMEWKT(i_wkt)) INTO l_ctrlat , l_ctrlon , l_lonmin , l_lonmax; -- See if the scene crossesthe IDL if so correct the negative value IF (abs(l_lonmin) + abs(l_lonmax)) > 180 THEN l_lontmp := 360 + l_lonmin; l_ctrlon := ((l_lonmax + l_lontmp)/2); END IF; -- Determine which side of the IDL the longitude belongs on IF l_ctrlon > 180 THEN l_ctrlon := l_lonctr - 360; END IF; RETURN QUERY SELECT l_ctrlat AS centerlat , l_ctrlon AS centerlon; END; $$ LANGUAGE plpgsql; Is there a way to determine the center point for a geographic scene that crosses the IDL using current PostGIS functions that will remain true for any foot print size that does not require additional code? If so, what combination of functions do I need to use? Do I need to re-project the scene prior to determining the center point with ST_CENTROID since I move the footprint to a Cartesian geometry type? If no functions are available, is there a preferred method for determining center point of a polygon that crosses the IDL that will better allow for larger sizes of polygons in a geographic system? I am currently running PostgreSQL 9.3.4 with PostGIS extension 2.1.0. Any help you could provide would be appreciated. Bradley J. Hazuka Database Administrator Innovate!, Inc. Contractor to the U.S. Geological Survey (USGS) -------------- next part -------------- An HTML attachment was scrubbed... URL: From traviskirstine at gmail.com Wed Sep 2 11:32:40 2015 From: traviskirstine at gmail.com (Travis Kirstine) Date: Wed, 2 Sep 2015 14:32:40 -0400 Subject: [postgis-users] perform intersection on large tables Message-ID: I'm trying to perform an intersection using two tables, one table contains a regular grid of polygon geometries the other table contains parcels polygons. I need to perform an intersection to extract the parcels as lines with a label point for each polygon in the grid table. My novice approach was to create new table with a generic geometry type and then loop through each row in the grid table to run the intersection against the parcels and insert the results into the table. The approach works OK when dealing with a few records but fails miserably when run against larger tables Any suggestions CREATE TABLE results ( id SERIAL, pin VARCHAR(9), zone VARCHAR, base_name VARCHAR(9) ); SELECT AddGeometryColumn('results', 'geom', 4326, 'GEOMETRY', 2 ); CREATE OR REPLACE FUNCTION genTiles() RETURNS int4 AS ' DECLARE r RECORD; BEGIN FOR r IN SELECT * FROM grid_table LOOP INSERT INTO results (zone, base_name, pin, geom) SELECT r.zone, r.base_name, p.pin, ST_Intersection((ST_Dump(ST_Boundary(p.geom))).geom, r.geom) AS geom FROM parcel p WHERE ST_Intersects(p.geom, r.geom); INSERT INTO results (pin, zone, base_name, geom) SELECT r.zone, r.base_name, p.pin, ST_Intersection((ST_Dump(ST_PointOnSurface(p.geom))).geom, r.geom) AS geom FROM parcels p WHERE ST_Intersects(ST_PointOnSurface(p.geom), r.geom); END LOOP; return 1; END; ' LANGUAGE plpgsql; SELECT genTiles() as output -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Wed Sep 2 13:23:30 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Wed, 2 Sep 2015 16:23:30 -0400 Subject: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? Message-ID: <55E75AC2.4000708@swoodbridge.com> Hi all, I just noticed that it is not obvious how to determine that geom and st_reverse(geom) are different! It seems that by definition st_equals(geom, st_reverse(geom)) is true as is geom = st_reverse(geom). So this seems to be by definition, but it brings up the question how to quickly and efficiently determine that they are also different, even if they are "equal". I'm doing st_astext(geom) != st_astext(st_reverse(geom)) but I worry about precision issues doing this. I suppose I could also check if the st_startpoint() of the two are the same, but that seems problematic also. Thoughts, -Steve From jim at jimkeener.com Wed Sep 2 13:23:16 2015 From: jim at jimkeener.com (James Keener) Date: Wed, 02 Sep 2015 16:23:16 -0400 Subject: [postgis-users] perform intersection on large tables In-Reply-To: References: Message-ID: <6392A51F-E781-4E6B-9E7F-9FBF1C17DFB1@jimkeener.com> Is there a reason you don't simply join and insist on looping? Index the geometry fields and joining on st_contains or something should have decent performance. Jim On September 2, 2015 2:32:40 PM EDT, Travis Kirstine wrote: >I'm trying to perform an intersection using two tables, one table >contains >a regular grid of polygon geometries the other table contains parcels >polygons. I need to perform an intersection to extract the parcels as >lines with a label point for each polygon in the grid table. My novice >approach was to create new table with a generic geometry type and then >loop >through each row in the grid table to run the intersection against the >parcels and insert the results into the table. > >The approach works OK when dealing with a few records but fails >miserably >when run against larger tables > >Any suggestions > > > CREATE TABLE results ( > id SERIAL, > pin VARCHAR(9), > zone VARCHAR, > base_name VARCHAR(9) > ); > SELECT AddGeometryColumn('results', 'geom', 4326, 'GEOMETRY', 2 ); > > > CREATE OR REPLACE FUNCTION genTiles() RETURNS int4 AS ' > DECLARE r RECORD; > BEGIN > > FOR r IN SELECT * FROM grid_table > LOOP > INSERT INTO results (zone, base_name, pin, geom) > SELECT > r.zone, r.base_name, > p.pin, > ST_Intersection((ST_Dump(ST_Boundary(p.geom))).geom, >r.geom) AS geom > FROM > parcel p > WHERE > ST_Intersects(p.geom, r.geom); > > > INSERT INTO results (pin, zone, base_name, geom) > SELECT > r.zone, r.base_name, > p.pin, > ST_Intersection((ST_Dump(ST_PointOnSurface(p.geom))).geom, >r.geom) AS geom > FROM > parcels p > WHERE > ST_Intersects(ST_PointOnSurface(p.geom), r.geom); > > END LOOP; > return 1; > END; > ' LANGUAGE plpgsql; > > SELECT genTiles() as output > > >------------------------------------------------------------------------ > >_______________________________________________ >postgis-users mailing list >postgis-users at lists.osgeo.org >http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Wed Sep 2 13:37:31 2015 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Wed, 2 Sep 2015 20:37:31 +0000 Subject: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? In-Reply-To: <55E75AC2.4000708@swoodbridge.com> References: <55E75AC2.4000708@swoodbridge.com> Message-ID: Hi Steve, I think you almost need to check every point from at least one linestring against the other linestring. You could check just one end, but they could still be the same but the other end different. Also you could have line strings with the same end points, but different intermediate points. Your st_astext approach seems to be the most full proof, if it?s just the direction that you are looking for, then you may need to do a double (or triple condition) pass if the line strings are congruent. You would need to check the ends against each other after finding out that they match up in physical space in order to get direction. bobb > On Sep 2, 2015, at 3:23 PM, Stephen Woodbridge wrote: > > Hi all, > > I just noticed that it is not obvious how to determine that > geom and st_reverse(geom) are different! > > It seems that by definition st_equals(geom, st_reverse(geom)) is true as is geom = st_reverse(geom). So this seems to be by definition, but it brings up the question how to quickly and efficiently determine that they are also different, even if they are "equal". > > I'm doing st_astext(geom) != st_astext(st_reverse(geom)) but I worry about precision issues doing this. I suppose I could also check if the st_startpoint() of the two are the same, but that seems problematic also. > > Thoughts, > -Steve > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From woodbri at swoodbridge.com Wed Sep 2 14:04:38 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Wed, 2 Sep 2015 17:04:38 -0400 Subject: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? In-Reply-To: References: <55E75AC2.4000708@swoodbridge.com> Message-ID: <55E76466.2030701@swoodbridge.com> Hi Bob, Yes, for now I'm just taking a pgrouting path and reversing some of the edges so the coordinates flow correctly from end to end of the path. But it just dawned on me that I can change the test to geom::text = st_reverse(geom)::text and this will avoid the precision issue I was worded about. It just seems like we should have a function that allows us to check for sameness: create or replace st_isSameGeometry(a geometry, b geometry) returns boolean language sql as $_$ select a::text=b::text; $_$; -Steve On 9/2/2015 4:37 PM, Basques, Bob (CI-StPaul) wrote: > Hi Steve, > > I think you almost need to check every point from at least one > linestring against the other linestring. > > You could check just one end, but they could still be the same but > the other end different. Also you could have line strings with the > same end points, but different intermediate points. > > Your st_astext approach seems to be the most full proof, if it?s just > the direction that you are looking for, then you may need to do a > double (or triple condition) pass if the line strings are congruent. > You would need to check the ends against each other after finding out > that they match up in physical space in order to get direction. > > bobb > > > > >> On Sep 2, 2015, at 3:23 PM, Stephen Woodbridge >> wrote: >> >> Hi all, >> >> I just noticed that it is not obvious how to determine that geom >> and st_reverse(geom) are different! >> >> It seems that by definition st_equals(geom, st_reverse(geom)) is >> true as is geom = st_reverse(geom). So this seems to be by >> definition, but it brings up the question how to quickly and >> efficiently determine that they are also different, even if they >> are "equal". >> >> I'm doing st_astext(geom) != st_astext(st_reverse(geom)) but I >> worry about precision issues doing this. I suppose I could also >> check if the st_startpoint() of the two are the same, but that >> seems problematic also. >> >> Thoughts, -Steve _______________________________________________ >> postgis-users mailing list postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ postgis-users mailing > list postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > From lr at pcorp.us Wed Sep 2 14:40:28 2015 From: lr at pcorp.us (Paragon Corporation) Date: Wed, 2 Sep 2015 17:40:28 -0400 Subject: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? In-Reply-To: <55E76466.2030701@swoodbridge.com> References: <55E75AC2.4000708@swoodbridge.com> <55E76466.2030701@swoodbridge.com> Message-ID: <003501d0e5c7$fc8b61f0$f5a225d0$@pcorp.us> Have you tried ST_OrderingEquals ? -----Original Message----- From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Stephen Woodbridge Sent: Wednesday, September 02, 2015 5:05 PM To: postgis-users at lists.osgeo.org Subject: Re: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? Hi Bob, Yes, for now I'm just taking a pgrouting path and reversing some of the edges so the coordinates flow correctly from end to end of the path. But it just dawned on me that I can change the test to geom::text = st_reverse(geom)::text and this will avoid the precision issue I was worded about. It just seems like we should have a function that allows us to check for sameness: create or replace st_isSameGeometry(a geometry, b geometry) returns boolean language sql as $_$ select a::text=b::text; $_$; -Steve On 9/2/2015 4:37 PM, Basques, Bob (CI-StPaul) wrote: > Hi Steve, > > I think you almost need to check every point from at least one > linestring against the other linestring. > > You could check just one end, but they could still be the same but the > other end different. Also you could have line strings with the same > end points, but different intermediate points. > > Your st_astext approach seems to be the most full proof, if it s just > the direction that you are looking for, then you may need to do a > double (or triple condition) pass if the line strings are congruent. > You would need to check the ends against each other after finding out > that they match up in physical space in order to get direction. > > bobb > > > > >> On Sep 2, 2015, at 3:23 PM, Stephen Woodbridge >> wrote: >> >> Hi all, >> >> I just noticed that it is not obvious how to determine that geom and >> st_reverse(geom) are different! >> >> It seems that by definition st_equals(geom, st_reverse(geom)) is true >> as is geom = st_reverse(geom). So this seems to be by definition, but >> it brings up the question how to quickly and efficiently determine >> that they are also different, even if they are "equal". >> >> I'm doing st_astext(geom) != st_astext(st_reverse(geom)) but I worry >> about precision issues doing this. I suppose I could also check if >> the st_startpoint() of the two are the same, but that seems >> problematic also. >> >> Thoughts, -Steve _______________________________________________ >> postgis-users mailing list postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ postgis-users mailing > list postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From lr at pcorp.us Wed Sep 2 14:44:28 2015 From: lr at pcorp.us (Paragon Corporation) Date: Wed, 2 Sep 2015 17:44:28 -0400 Subject: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? References: <55E75AC2.4000708@swoodbridge.com> <55E76466.2030701@swoodbridge.com> Message-ID: <003601d0e5c8$8bf5b520$a3e11f60$@pcorp.us> Steve, Forgot to mention -- there was subtle bug in ST_OrderingEquals that prevented it from using a spatial index, which Vicky pointed out. I fixed it for not yet released 2.1.9 https://trac.osgeo.org/postgis/ticket/3236 So sadly to be safe, you have to throw in an additional && if you need it to utilize spatial index. -----Original Message----- From: Paragon Corporation [mailto:lr at pcorp.us] Sent: Wednesday, September 02, 2015 5:40 PM To: 'PostGIS Users Discussion' Subject: RE: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? Have you tried ST_OrderingEquals ? -----Original Message----- From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Stephen Woodbridge Sent: Wednesday, September 02, 2015 5:05 PM To: postgis-users at lists.osgeo.org Subject: Re: [postgis-users] How can I detect that geom != st_reverse(geom) for linestrings? Hi Bob, Yes, for now I'm just taking a pgrouting path and reversing some of the edges so the coordinates flow correctly from end to end of the path. But it just dawned on me that I can change the test to geom::text = st_reverse(geom)::text and this will avoid the precision issue I was worded about. It just seems like we should have a function that allows us to check for sameness: create or replace st_isSameGeometry(a geometry, b geometry) returns boolean language sql as $_$ select a::text=b::text; $_$; -Steve On 9/2/2015 4:37 PM, Basques, Bob (CI-StPaul) wrote: > Hi Steve, > > I think you almost need to check every point from at least one > linestring against the other linestring. > > You could check just one end, but they could still be the same but the > other end different. Also you could have line strings with the same > end points, but different intermediate points. > > Your st_astext approach seems to be the most full proof, if it s just > the direction that you are looking for, then you may need to do a > double (or triple condition) pass if the line strings are congruent. > You would need to check the ends against each other after finding out > that they match up in physical space in order to get direction. > > bobb > > > > >> On Sep 2, 2015, at 3:23 PM, Stephen Woodbridge >> wrote: >> >> Hi all, >> >> I just noticed that it is not obvious how to determine that geom and >> st_reverse(geom) are different! >> >> It seems that by definition st_equals(geom, st_reverse(geom)) is true >> as is geom = st_reverse(geom). So this seems to be by definition, but >> it brings up the question how to quickly and efficiently determine >> that they are also different, even if they are "equal". >> >> I'm doing st_astext(geom) != st_astext(st_reverse(geom)) but I worry >> about precision issues doing this. I suppose I could also check if >> the st_startpoint() of the two are the same, but that seems >> problematic also. >> >> Thoughts, -Steve _______________________________________________ >> postgis-users mailing list postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ postgis-users mailing > list postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From graeme.bell at nibio.no Thu Sep 3 02:03:19 2015 From: graeme.bell at nibio.no (Graeme B. Bell) Date: Thu, 3 Sep 2015 09:03:19 +0000 Subject: [postgis-users] perform intersection on large tables Message-ID: <7D65EE9C-1712-4EB8-96AE-5E4ECF4F7CD1@skogoglandskap.no> > I'm trying to perform an intersection using two tables, one table contains > a regular grid of polygon geometries the other table contains parcels > polygons. I need to perform an intersection to extract the parcels as > lines with a label point for each polygon in the grid table. My novice > approach was to create new table with a generic geometry type and then loop > through each row in the grid table to run the intersection against the > parcels and insert the results into the table. > > The approach works OK when dealing with a few records but fails miserably > when run against larger tables Hi Travis, Here is a fast implementation of a GIS intersection which will perform well even on huge tables, which you can simplify or modify as you like. It uses parallel programming to get an extra speedup from the multiple cores of your server. Whatever you do, make sure you have spatial indices on both your source geo columns! That's essential. https://github.com/gbb/fast_map_intersection Graeme Bell From remi.cura at gmail.com Thu Sep 3 04:38:48 2015 From: remi.cura at gmail.com (=?UTF-8?Q?R=C3=A9mi_Cura?=) Date: Thu, 3 Sep 2015 13:38:48 +0200 Subject: [postgis-users] perform intersection on large tables In-Reply-To: <7D65EE9C-1712-4EB8-96AE-5E4ECF4F7CD1@skogoglandskap.no> References: <7D65EE9C-1712-4EB8-96AE-5E4ECF4F7CD1@skogoglandskap.no> Message-ID: Hey, not trying to insult anyone here, but you look like you should start with the basics, aka read a basic SQL tutorial for concept of join, then (join, 2 tables properly indexed ) --do one time CREATE INDEX ON my_table_1 USING GIST(geom) ; CREATE INDEX ON my_table_2 USING GIST(geom) ; --your query, should be very fast (seconds to minutes for usual size) SELECT ST_Intersection(t1.geom, t2.geom), --or whatever FROM my_table_1 AS t1, my_table_2 AS t2 WHERE ST_Intersects(t1.geom, t2.geom) = TRUE ; --note that it could be written better, this is for understanding ), then you may try to increase performances and exploit all the CPU you have, if it is indeed the bottleneck (maybe IO is your bottleneck, maybe network , maybe RAM...). Cheers, R?mi-C 2015-09-03 11:03 GMT+02:00 Graeme B. Bell : > > I'm trying to perform an intersection using two tables, one table > contains > > a regular grid of polygon geometries the other table contains parcels > > polygons. I need to perform an intersection to extract the parcels as > > lines with a label point for each polygon in the grid table. My novice > > approach was to create new table with a generic geometry type and then > loop > > through each row in the grid table to run the intersection against the > > parcels and insert the results into the table. > > > > The approach works OK when dealing with a few records but fails miserably > > when run against larger tables > > Hi Travis, > > Here is a fast implementation of a GIS intersection which will perform > well even on huge tables, which you can simplify or modify as you like. > It uses parallel programming to get an extra speedup from the multiple > cores of your server. > Whatever you do, make sure you have spatial indices on both your source > geo columns! That's essential. > > https://github.com/gbb/fast_map_intersection > > Graeme Bell > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lr at pcorp.us Mon Sep 7 20:10:19 2015 From: lr at pcorp.us (Paragon Corporation) Date: Mon, 7 Sep 2015 23:10:19 -0400 Subject: [postgis-users] pgRouting 2.1.0, pgRouting 2.0.1 and osm2pgrouting-2.1.0-alpha - windows binaries available Message-ID: <000001d0e9e3$e4fe3f60$aefabe20$@pcorp.us> pgRouting 2.1.0 and osm2pgrouting 2.1.0-alpha were released today - details below For windows users wanting to try out the new pgRouting and osm2pgrouting offerings, these are now available on PostGIS windows page: http://postgis.net/windows_downloads In the experimental section. More comments here: http://www.bostongis.com/blog/index.php?/archives/245-pgRouting-2.1.0-and-os m2pgrouting-2.1.0-alpha-is-out,-windows-binaries-available.html Let me know if you run into issues. Want to catch all before PostGIS 2.2. bundle release. Thanks, Regina http://www.postgis.us http://postgis.net -----Original Message----- From: pgrouting-dev-bounces at lists.osgeo.org [mailto:pgrouting-dev-bounces at lists.osgeo.org] On Behalf Of Daniel Kastl Sent: Monday, September 07, 2015 2:59 PM To: pgRouting developers mailing list ; pgRouting users mailing list Subject: [pgrouting-dev] Release of pgRouting 2.1.0, pgRouting 2.0.1 and osm2pgrouting-2.1.0-alpha The pgRouting Team is pleased to announce the release of pgRouting 2.1.0! pgRouting 2.1.0 --------------- With the release of pgRouting 2.1 the library has been refactored, various bugs have been fixed and a new VRP solver has been added as a new algorithm. As a result of this effort, we have been able to simplify pgRouting, remove redundant code and improve the underlying functions in terms of stability and maintainability. For a summary of important changes see the following release notes: https://github.com/pgRouting/pgrouting/releases/tag/pgrouting-2.1.0 To see the full list of changes check the list of Closed Issues on Github: https://github.com/pgRouting/pgrouting/issues?q=is%3Aissue+milestone%3A%22Re lease+2.1.0%22+is%3Aclosed The pgRouting 2.1 Documentation is available under the following URL: http://docs.pgrouting.org/2.1/doc/index.html pgRouting 2.0.1 --------------- A bug-fix release of pgRouting 2.0 has been published as well: https://github.com/pgRouting/pgrouting/releases/tag/pgrouting-2.0.1 osm2pgrouting 2.1.0-alpha ------------------------- During this year's Google Summer of Code osm2pgrouting has been refactored and improved. Thank you to our GSoC student Sarthak Agarwal. We appreciate any feedback and help in testing the new version of osm2pgrouting! Release: https://github.com/pgRouting/osm2pgrouting/releases/tag/osm2pgrouting-2.1.0- alpha Changes: https://github.com/pgRouting/osm2pgrouting/blob/develop/NEWS Thank you to all of the users, developers, and supporters of pgRouting. We would like to call out special thanks for this pgRouting release to Vicky Vergara, Regina Obe and Ko Nagase for their time and support that really made this release possible! Furthermore thank you to Georepublic, Paragon Corporation and iMaptools.com for continued support of the pgRouting project. We also had a lot of support from our users testing releases, submitting patches, reporting issues and our apologies for not being able to list everyone by name but we do appreciate everyone's efforts. Enjoy. Hope to see some of you at FOSS4G Seoul! The pgRouting Team -- Georepublic UG & Georepublic Japan eMail: daniel.kastl at georepublic.de Web: http://georepublic.info _______________________________________________ pgrouting-dev mailing list pgrouting-dev at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/pgrouting-dev From kliu at pivotal.io Tue Sep 8 00:39:18 2015 From: kliu at pivotal.io (Kuien Liu) Date: Tue, 8 Sep 2015 15:39:18 +0800 Subject: [postgis-users] pgRouting 2.1.0, pgRouting 2.0.1 and osm2pgrouting-2.1.0-alpha - windows binaries available In-Reply-To: <000001d0e9e3$e4fe3f60$aefabe20$@pcorp.us> References: <000001d0e9e3$e4fe3f60$aefabe20$@pcorp.us> Message-ID: Excellent news! I'm looking for something like just pgRouting. Before I try it, I want to know: does it depend on PostGIS/Topology, or PostGIS/Geometry is good enough? I'm considering to deploy pgRouting (or sth similar) on older version of PostGIS, topology may be not supported. Thanks. Cheers, Kuien Liu On Tue, Sep 8, 2015 at 11:10 AM, Paragon Corporation wrote: > pgRouting 2.1.0 and osm2pgrouting 2.1.0-alpha were released today - details > below > > For windows users wanting to try out the new pgRouting and osm2pgrouting > offerings, these are now available on PostGIS windows page: > > http://postgis.net/windows_downloads In the experimental section. > > More comments here: > > > http://www.bostongis.com/blog/index.php?/archives/245-pgRouting-2.1.0-and-os > m2pgrouting-2.1.0-alpha-is-out,-windows-binaries-available.html > > Let me know if you run into issues. Want to catch all before PostGIS 2.2. > bundle release. > > Thanks, > Regina > http://www.postgis.us > http://postgis.net > > > > > > -----Original Message----- > From: pgrouting-dev-bounces at lists.osgeo.org > [mailto:pgrouting-dev-bounces at lists.osgeo.org] On Behalf Of Daniel Kastl > Sent: Monday, September 07, 2015 2:59 PM > To: pgRouting developers mailing list ; > pgRouting users mailing list > Subject: [pgrouting-dev] Release of pgRouting 2.1.0, pgRouting 2.0.1 and > osm2pgrouting-2.1.0-alpha > > The pgRouting Team is pleased to announce the release of pgRouting 2.1.0! > > pgRouting 2.1.0 > --------------- > > With the release of pgRouting 2.1 the library has been refactored, various > bugs have been fixed and a new VRP solver has been added as a new > algorithm. > As a result of this effort, we have been able to simplify pgRouting, remove > redundant code and improve the underlying functions in terms of stability > and maintainability. > > For a summary of important changes see the following release notes: > https://github.com/pgRouting/pgrouting/releases/tag/pgrouting-2.1.0 > > To see the full list of changes check the list of Closed Issues on > Github: > > https://github.com/pgRouting/pgrouting/issues?q=is%3Aissue+milestone%3A%22Re > lease+2.1.0%22+is%3Aclosed > > The pgRouting 2.1 Documentation is available under the following URL: > http://docs.pgrouting.org/2.1/doc/index.html > > > pgRouting 2.0.1 > --------------- > > A bug-fix release of pgRouting 2.0 has been published as well: > https://github.com/pgRouting/pgrouting/releases/tag/pgrouting-2.0.1 > > > osm2pgrouting 2.1.0-alpha > ------------------------- > > During this year's Google Summer of Code osm2pgrouting has been refactored > and improved. Thank you to our GSoC student Sarthak Agarwal. > > We appreciate any feedback and help in testing the new version of > osm2pgrouting! > Release: > > https://github.com/pgRouting/osm2pgrouting/releases/tag/osm2pgrouting-2.1.0- > alpha > Changes: https://github.com/pgRouting/osm2pgrouting/blob/develop/NEWS > > > > Thank you to all of the users, developers, and supporters of pgRouting. We > would like to call out special thanks for this pgRouting release to Vicky > Vergara, Regina Obe and Ko Nagase for their time and support that really > made this release possible! > Furthermore thank you to Georepublic, Paragon Corporation and iMaptools.com > for continued support of the pgRouting project. We also had a lot of > support > from our users testing releases, submitting patches, reporting issues and > our apologies for not being able to list everyone by name but we do > appreciate everyone's efforts. > Enjoy. > > Hope to see some of you at FOSS4G Seoul! > > The pgRouting Team > > > > -- > Georepublic UG & Georepublic Japan > eMail: daniel.kastl at georepublic.de > Web: http://georepublic.info > _______________________________________________ > pgrouting-dev mailing list > pgrouting-dev at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/pgrouting-dev > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at georepublic.de Tue Sep 8 01:07:37 2015 From: daniel at georepublic.de (Daniel Kastl) Date: Tue, 8 Sep 2015 17:07:37 +0900 Subject: [postgis-users] pgRouting 2.1.0, pgRouting 2.0.1 and osm2pgrouting-2.1.0-alpha - windows binaries available In-Reply-To: References: <000001d0e9e3$e4fe3f60$aefabe20$@pcorp.us> Message-ID: <55EE9749.8000402@georepublic.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 08/09/15 16:39, Kuien Liu wrote: > Excellent news! I'm looking for something like just pgRouting. > > Before I try it, I want to know: does it depend on > PostGIS/Topology, or PostGIS/Geometry is good enough? I'm > considering to deploy pgRouting (or sth similar) on older version > of PostGIS, topology may be not supported. Thanks. > pgRouting has its own network topology, which is more simple than PostGIS/Topology. For more details see the documentation about pgr_createTopology: http://docs.pgrouting.org/2.1/src/common/doc/functions/create_topology.h tml#pgr-create-topology Best regards, Daniel - -- Georepublic UG & Georepublic Japan eMail: daniel.kastl at georepublic.de Web: http://georepublic.info -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV7pdJAAoJEHjh5kk/zBG0nCIH/0LiFhsQZYiArVYEzQgBKfRY Cnh6JxvdoO7PoElMaeA5vl9GQxty62W9GVHBuegV+L7lNjdOjVKZ/fVXU3wnR+sk JI4Izd9jISQxKLH5EaCLWpArrTXLS6f5zFpE+oziqtnmOX7vgI+uOyJGELVMBOiu /DJBTqW0ekzIPvauc/E4F1mcjwwaQX+OoO4dv6qelCf/wyCeAy7gQv4sgD3XnpYg r1gYoa6GON+gq0GT4BbxFVNMPSyzcHElf9+zSODLXKy7deROoyBca67kBXSLXHwk XPeHGZ703lnFz4Rv90ejXGmbT+CnbMF6qJHBkmkuJ9lOoSwVS6CmawKVfMkxbVc= =BisD -----END PGP SIGNATURE----- From Christophe.Malek at ec.gc.ca Wed Sep 9 10:43:11 2015 From: Christophe.Malek at ec.gc.ca (Malek,Christophe [CMC]) Date: Wed, 9 Sep 2015 13:43:11 -0400 Subject: [postgis-users] FW: geographystyle feature request (external textual representation) In-Reply-To: References: Message-ID: Hi PostGIS users, I would like to make a feature request relating to the "external textual representation" of the geography data type. In short, I would like to request the provision of a directly human readable form as I believe it may be the intention and possibly proper usage of having the "external textual representation". Currently it appears that the geography data type is represented textually as something like "010100008000000080EB5108400000006066662E400000000000005940" which means little to nothing to the average human. Obviously we can run the ST_AsText function to get another more readable column but then we have two columns: one just for readability and another that users actually work with to calculate distances etc. etc. Or even worse, creating even more columns for users to work with using ST_X, ST_Y, ST_Z. I would like to request that we instead be able to set the "external textual representation" of the geography data type to something more human friendly such as to the output of ST_AsText. This would allow users to better understand the data while at the same time allowing them to work with it without additional conversion. It is my understanding that this has been done in Postgres for the date and interval data types using the commands: "SET DATESTYLE TO ISO" etc. or "SET INTERVALSTYLE TO POSTGRES" etc. Postgis could perhaps include something similar: "SET GEORAPHYSTYLE TO WKT", "SET GEOGRAPHYSTYLE TO POSTGIS", etc. or something along those lines to give users some more options. Please forgive me if there is already such a feature as I was not able to find it after searching both google and the postgis forums. If there is, then if you could please point me in the right direction and my apologies. If there isn't, then it might be interesting to hear back if people would be interested in such a feature and even more interested to hear back if somebody else is willing to develop it. I unfortunately don't have time at the moment to implement it myself as I am just at the early stages of testing Postgres/Postgis and converting a very large dataset. But I believe such a feature might make Postgis an even more digestible option for our end users and possibly others. I understand there could be some precision related issues in converting back and forth between internal storage and WKT format that users would probably need to be aware of but in such cases users should probably be using the "binary external representation" or the usual geography/geometry constructors rather than "text external representation" for construction anyway. Effectively, the text representation is probably one of the worst ones to be working with from a performance standpoint (due to all the extra parsing involved) so should be possibly be discouraged in general for anything other than convenience for human use anyway. Looking forward to hearing from you, Chris Chris Malek christophe.malek at ec.gc.ca Data Assimilation Informatics Canadian Meteorological Centre 2121 Trans Canada Highway Dorval, Quebec H9P 1J3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseph85750 at yahoo.com Wed Sep 9 12:10:05 2015 From: joseph85750 at yahoo.com (Joseph Spenner) Date: Wed, 9 Sep 2015 19:10:05 +0000 (UTC) Subject: [postgis-users] Trouble with returning MultiPolygon on psql query Message-ID: <939372679.3878859.1441825805354.JavaMail.yahoo@mail.yahoo.com> Hello, I have a file (source.json) containing 25 GeoJSON polygons with weather alerts, which I imported into postgres using the following command: $ ogr2ogr -f "PostgreSQL" PG:"dbname=weatherzones user=postgres" "source.json" -nln polys Here's how it looks in Postgres: polytest=# \d polys; ?????????????????????????????????????? Table "public.polys" ??? Column??? |????????? Type?????????? |??????????????????????? Modifiers??????????????????????? --------------+-------------------------+--------------------------------------------------------- ?ogc_fid????? | integer???????????????? | not null default nextval('polys_ogc_fid_seq'::regclass) ?wkb_geometry | geometry(Geometry,4326) | ?warnings???? | character varying?????? | Indexes: ??? "polys_pk" PRIMARY KEY, btree (ogc_fid) ??? "polys_geom_idx" gist (wkb_geometry) polytest=# I can see it stored all of them: polytest=# select count(*) from polys; ?count ------- ??? 25 (1 row) polytest=#? However, when I try to use a ST_Intersects(ST_PointFromText('POINT(), I can't seem to get lines with MultiPolygons to return rows.? The regular Polygons seem to work fine, though. For example, I have the following MultiPolygon in my table from Nevada: http://microflush.org/json/24.json Using a validator site, such as http://geojsonlint.com/ , I can copy/paste that JSON into the interface and it looks like 2 adjacent shapes making up the MultiPolygon. If I grab points from the upper section of the polygon, using something like http://itouchmap.com/latlong.html, I get rows returned:polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -114.543457 39.336281 )', 4326), wkb_geometry) limit 2; polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -115.658569 39.500297 )', 4326), wkb_geometry) limit 2; But if I use a point from the lower Polygon section of that MultiPolygon, I get zero: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -115.977173 38.548667 )', 4326), wkb_geometry) limit 2; Another example from Florida (a little more difficult to see, but same issue):http://microflush.org/json/06.json polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -81.988228 27.034561 )', 4326), wkb_geometry) limit 2; warnings ---------- (0 rows) The above point (-81.988228 27.034561) would spacially exist in this MultiPolygon. However, in this example, it will only return rows if I pick a point inside the little polygon which shows up focused to the south of the much larger polygon (when you use the geojsonlin.com site to plot the whole thing).? For example, this point: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -81.9878 27.034 )', 4326), wkb_geometry) limit 2;(1 row) So, it would seem the select statements which should return Multipolygons are not returning for all Polygons contained in the MultiPolygon. Is there something I'm doing incorrectly with my queries? Any help would be great. Thank you! Joseph Spenner -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseph85750 at yahoo.com Sat Sep 12 10:29:27 2015 From: joseph85750 at yahoo.com (Joseph Spenner) Date: Sat, 12 Sep 2015 17:29:27 +0000 (UTC) Subject: [postgis-users] Trouble with returning MultiPolygon on psql query In-Reply-To: <939372679.3878859.1441825805354.JavaMail.yahoo@mail.yahoo.com> References: <939372679.3878859.1441825805354.JavaMail.yahoo@mail.yahoo.com> Message-ID: <977537324.1537109.1442078967621.JavaMail.yahoo@mail.yahoo.com> I believe I may have overcomplicated my question.? My apologies.? I've come up with a much simpler explanation of the issue: I have a MultiPolygon with 2 relatively simple polygons in it: http://microflush.org/json/MultiPolygon.json I've pulled out the 2 polygons from the above MultiPolygon below: http://microflush.org/json/upper.json http://microflush.org/json/lower.json Any/all of the 3 above can be copied/pasted into a GeoJSON tester to view them:??? http://geojsonlint.com/ I've stored the original MultiPolygon in PostgreSQL as described in my original post: $ ogr2ogr -f "PostgreSQL" PG:"dbname=weatherzones user=postgres" "MultiPolygon.json" -nln polys Here's how it looks in Postgres after the import: polytest=# \d polys; ?????????????????????????????????????? Table "public.polys" ??? Column??? |????????? Type?????????? |??????????????????????? Modifiers??????????????????????? --------------+-------------------------+--------------------------------------------------------- ?ogc_fid????? | integer???????????????? | not null default nextval('polys_ogc_fid_seq'::regclass) ?wkb_geometry | geometry(Geometry,4326) | ?warnings???? | character varying?????? | Indexes: ??? "polys_pk" PRIMARY KEY, btree (ogc_fid) ??? "polys_geom_idx" gist (wkb_geometry) polytest=# When I try to query postgres using single points which lie in the lower polygon, I do not get rows returned.However, when I query using points which lie in the upper polygon, I get the row returned. ie: This point lies in the lower polygon, and this query returns no rows: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -116.024551 38.485773 )', 4326), wkb_geometry); This next point lies in the upper polygon, and this query returns a row, which is the MultiPolygon: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -114.879913 39.249129 )', 4326), wkb_geometry); Is there something wrong with my query, or perhaps the original MultiPolygon which can explain why a query with a point from the lower polygon won't return the MultiPolygon row?? I've done this with other MultiPolygons and have not had an issue like this. Any help would be great. Thanks! Joseph Spenner From: Joseph Spenner To: PostGIS Users Discussion Sent: Wednesday, September 9, 2015 12:10 PM Subject: Trouble with returning MultiPolygon on psql query Hello, I have a file (source.json) containing 25 GeoJSON polygons with weather alerts, which I imported into postgres using the following command: $ ogr2ogr -f "PostgreSQL" PG:"dbname=weatherzones user=postgres" "source.json" -nln polys Here's how it looks in Postgres: polytest=# \d polys; ?????????????????????????????????????? Table "public.polys" ??? Column??? |????????? Type?????????? |??????????????????????? Modifiers??????????????????????? --------------+-------------------------+--------------------------------------------------------- ?ogc_fid????? | integer???????????????? | not null default nextval('polys_ogc_fid_seq'::regclass) ?wkb_geometry | geometry(Geometry,4326) | ?warnings???? | character varying?????? | Indexes: ??? "polys_pk" PRIMARY KEY, btree (ogc_fid) ??? "polys_geom_idx" gist (wkb_geometry) polytest=# I can see it stored all of them: polytest=# select count(*) from polys; ?count ------- ??? 25 (1 row) polytest=#? However, when I try to use a ST_Intersects(ST_PointFromText('POINT(), I can't seem to get lines with MultiPolygons to return rows.? The regular Polygons seem to work fine, though. For example, I have the following MultiPolygon in my table from Nevada: http://microflush.org/json/24.json Using a validator site, such as http://geojsonlint.com/ , I can copy/paste that JSON into the interface and it looks like 2 adjacent shapes making up the MultiPolygon. If I grab points from the upper section of the polygon, using something like http://itouchmap.com/latlong.html, I get rows returned:polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -114.543457 39.336281 )', 4326), wkb_geometry) limit 2; polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -115.658569 39.500297 )', 4326), wkb_geometry) limit 2; But if I use a point from the lower Polygon section of that MultiPolygon, I get zero: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -115.977173 38.548667 )', 4326), wkb_geometry) limit 2; Another example from Florida (a little more difficult to see, but same issue):http://microflush.org/json/06.json polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -81.988228 27.034561 )', 4326), wkb_geometry) limit 2; warnings ---------- (0 rows) The above point (-81.988228 27.034561) would spacially exist in this MultiPolygon. However, in this example, it will only return rows if I pick a point inside the little polygon which shows up focused to the south of the much larger polygon (when you use the geojsonlin.com site to plot the whole thing).? For example, this point: polytest=# select warnings from polys where ST_Intersects(ST_PointFromText('POINT( -81.9878 27.034 )', 4326), wkb_geometry) limit 2;(1 row) So, it would seem the select statements which should return Multipolygons are not returning for all Polygons contained in the MultiPolygon. Is there something I'm doing incorrectly with my queries? Any help would be great. Thank you! Joseph Spenner -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdcvass at gmail.com Mon Sep 14 14:17:38 2015 From: sdcvass at gmail.com (Steve) Date: Mon, 14 Sep 2015 17:17:38 -0400 Subject: [postgis-users] $libdir/postgis-2.1: No such file or directory Message-ID: All, Ive been beating this to death for too long and hope someone can steer me strait. Freah install of Linux 6.6 Postgresql fresh install 9.3.9 On a closed network but I mined (I think) all the rpm's I need for postgis. Postgis install nicely but upon create extension, I get $libdir/postgis-2.1: No such file or directory when running ./pg_config --pkglibdir, I see /var/lib/pgsql/9.3/lib. postgis-2.1 is not there so I copy it there. No matter what, I still get this error. Any help for an old Oracle guy would be appreciated. Steve Sent from my iPhone From devrim at gunduz.org Mon Sep 14 14:53:54 2015 From: devrim at gunduz.org (=?ISO-8859-1?Q?Devrim_G=FCnd=FCz?=) Date: Tue, 15 Sep 2015 00:53:54 +0300 Subject: [postgis-users] $libdir/postgis-2.1: No such file or directory In-Reply-To: References: Message-ID: Hi, Are you compiling from source? If so, add --enable-raster for extension support. Or better, use RPMs: http://yum.postgreql.org . Regards, On September 15, 2015 12:17:38 AM GMT+03:00, Steve wrote: >All, > >Ive been beating this to death for too long and hope someone can steer >me strait. > >Freah install of Linux 6.6 > >Postgresql fresh install 9.3.9 > >On a closed network but I mined (I think) all the rpm's I need for >postgis. > >Postgis install nicely but upon create extension, I get >$libdir/postgis-2.1: No such file or directory > >when running ./pg_config --pkglibdir, I see /var/lib/pgsql/9.3/lib. >postgis-2.1 is not there so I copy it there. No matter what, I still >get this error. > >Any help for an old Oracle guy would be appreciated. > >Steve > > >Sent from my iPhone >_______________________________________________ >postgis-users mailing list >postgis-users at lists.osgeo.org >http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From remi.cura at gmail.com Tue Sep 15 00:52:36 2015 From: remi.cura at gmail.com (=?UTF-8?Q?R=C3=A9mi_Cura?=) Date: Tue, 15 Sep 2015 09:52:36 +0200 Subject: [postgis-users] $libdir/postgis-2.1: No such file or directory In-Reply-To: References: Message-ID: Hey, have you check that the postgis-2.1.so file exists somewhere beside the compile folder? (captain obvious) you may need to restart the postgres server (captain obvious) Need admin right when installing postgis, after compile. If you compile yourself, some use of the command `ldconfig` at the right time may save you. Cheers, R?mi-C 2015-09-14 23:53 GMT+02:00 Devrim G?nd?z : > Hi, > > Are you compiling from source? If so, add --enable-raster for extension > support. > > Or better, use RPMs: http://yum.postgreql.org . > > Regards, > > On September 15, 2015 12:17:38 AM GMT+03:00, Steve > wrote: >> >> All, >> >> Ive been beating this to death for too long and hope someone can steer me strait. >> >> Freah install of Linux 6.6 >> >> Postgresql fresh install 9.3.9 >> >> On a closed network but I mined (I think) all the rpm's I need for postgis. >> >> Postgis install nicely but upon create extension, I get $libdir/postgis-2.1: No such file or directory >> >> when running ./pg_config --pkglibdir, I see /var/lib/pgsql/9.3/lib. postgis-2.1 is not there so I copy it there. No matter what, I still get this error. >> >> Any help for an old Oracle guy would be appreciated. >> >> Steve >> >> >> Sent from my iPhone >> ------------------------------ >> >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.ladner at gmail.com Tue Sep 15 04:25:03 2015 From: eric.ladner at gmail.com (Eric Ladner) Date: Tue, 15 Sep 2015 11:25:03 +0000 Subject: [postgis-users] $libdir/postgis-2.1: No such file or directory In-Reply-To: References: Message-ID: Interesting that is says "$libdir/..." and not "/usr/lib/...". It almost looks like something in a shell script is surrounded in single quotes where it should be double and it's not evaluating the "$libdir" into what it should actually point to. On Tue, Sep 15, 2015 at 2:53 AM R?mi Cura wrote: > Hey, > have you check that the postgis-2.1.so file exists somewhere beside the > compile folder? > > (captain obvious) you may need to restart the postgres server > (captain obvious) Need admin right when installing postgis, after compile. > > If you compile yourself, some use of the command `ldconfig` > at the right time may save you. > > > Cheers, > R?mi-C > > 2015-09-14 23:53 GMT+02:00 Devrim G?nd?z : > >> Hi, >> >> Are you compiling from source? If so, add --enable-raster for extension >> support. >> >> Or better, use RPMs: http://yum.postgreql.org . >> >> Regards, >> >> On September 15, 2015 12:17:38 AM GMT+03:00, Steve >> wrote: >>> >>> All, >>> >>> Ive been beating this to death for too long and hope someone can steer me strait. >>> >>> Freah install of Linux 6.6 >>> >>> Postgresql fresh install 9.3.9 >>> >>> On a closed network but I mined (I think) all the rpm's I need for postgis. >>> >>> Postgis install nicely but upon create extension, I get $libdir/postgis-2.1: No such file or directory >>> >>> when running ./pg_config --pkglibdir, I see /var/lib/pgsql/9.3/lib. postgis-2.1 is not there so I copy it there. No matter what, I still get this error. >>> >>> Any help for an old Oracle guy would be appreciated. >>> >>> Steve >>> >>> >>> Sent from my iPhone >>> ------------------------------ >>> >>> postgis-users mailing list >>> postgis-users at lists.osgeo.org >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >>> >>> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Bistrais at maine.gov Tue Sep 15 09:25:30 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Tue, 15 Sep 2015 16:25:30 +0000 Subject: [postgis-users] Need help on query to return boundary of polygon Message-ID: I would like to return the boundary of a selected polygon, and I can't seem to get my syntax correct. What I want to do is to select the boundary from a polygon table of towns, where the town name equals a selected town. Something like this: Select ST_Boundary(geom) from (select * from towns where towns.townname='Mytown') -obviously this is not correct, but hopefully gives an idea of what I want. Any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From woodbri at swoodbridge.com Tue Sep 15 09:52:17 2015 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Tue, 15 Sep 2015 12:52:17 -0400 Subject: [postgis-users] Need help on query to return boundary of polygon In-Reply-To: References: Message-ID: <55F84CC1.60605@swoodbridge.com> On 9/15/2015 12:25 PM, Bistrais, Bob wrote: > I would like to return the boundary of a selected polygon, and I can?t > seem to get my syntax correct. What I want to do is to select the > boundary from a polygon table of towns, where the town name equals a > selected town. Something like this: > > Select ST_Boundary(geom) from (select * from towns where > towns.townname=?Mytown?) Does this work: select st_boundary(geom) from towns where townname='Mytown'; -Steve > -obviously this is not correct, but hopefully gives an idea of what I want. > > Any suggestions? > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > From birgit.laggner at ti.bund.de Thu Sep 17 05:31:43 2015 From: birgit.laggner at ti.bund.de (Birgit Laggner) Date: Thu, 17 Sep 2015 14:31:43 +0200 Subject: [postgis-users] Trouble with returning MultiPolygon on psql query In-Reply-To: <977537324.1537109.1442078967621.JavaMail.yahoo@mail.yahoo.com> References: <939372679.3878859.1441825805354.JavaMail.yahoo@mail.yahoo.com> <977537324.1537109.1442078967621.JavaMail.yahoo@mail.yahoo.com> Message-ID: <55FAB2AF.10604@ti.bund.de> Hi Joseph, I tried your intersects query after creating the multipolygon using the st_geomfromtext function with the coordinates from your geojson objects. There were no problems with the intersects query. The query returned a result even with the point within the lower polygon. So my question would be: Are you sure, you did import all multipolygon parts in postgres? If you can't visualize the PostGIS geometries, perhaps you could dump the multipolygon in question to single polygons and compare the resulting number with the original as a first approach? Regards, Birgit Am 12.09.2015 um 19:29 schrieb Joseph Spenner: > I believe I may have overcomplicated my question. My apologies. I've > come up with a much simpler explanation of the issue: > > I have a MultiPolygon with 2 relatively simple polygons in it: > > http://microflush.org/json/MultiPolygon.json > > > > I've pulled out the 2 polygons from the above MultiPolygon below: > > http://microflush.org/json/upper.json > > http://microflush.org/json/lower.json > > Any/all of the 3 above can be copied/pasted into a GeoJSON tester to > view them: > http://geojsonlint.com/ > > > I've stored the original MultiPolygon in PostgreSQL as described in my > original post: > > $ ogr2ogr -f "PostgreSQL" PG:"dbname=weatherzones user=postgres" > "MultiPolygon.json" -nln polys > > Here's how it looks in Postgres after the import: > > polytest=# \d polys; > Table "public.polys" > Column | Type | Modifiers > --------------+-------------------------+--------------------------------------------------------- > ogc_fid | integer | not null default > nextval('polys_ogc_fid_seq'::regclass) > wkb_geometry | geometry(Geometry,4326) | > warnings | character varying | > Indexes: > "polys_pk" PRIMARY KEY, btree (ogc_fid) > "polys_geom_idx" gist (wkb_geometry) > > polytest=# > > > When I try to query postgres using single points which lie in the > lower polygon, I do not get rows returned. > However, when I query using points which lie in the upper polygon, I > get the row returned. > > ie: > > This point lies in the lower polygon, and this query returns no rows: > > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -116.024551 38.485773 )', > 4326), wkb_geometry); > > > This next point lies in the upper polygon, and this query returns a > row, which is the MultiPolygon: > > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -114.879913 39.249129 )', > 4326), wkb_geometry); > > Is there something wrong with my query, or perhaps the original > MultiPolygon which can explain why a query with a point from the lower > polygon won't return the MultiPolygon row? I've done this with other > MultiPolygons and have not had an issue like this. > > Any help would be great. > > Thanks! > > Joseph Spenner > > > > > > ------------------------------------------------------------------------ > *From:* Joseph Spenner > *To:* PostGIS Users Discussion > *Sent:* Wednesday, September 9, 2015 12:10 PM > *Subject:* Trouble with returning MultiPolygon on psql query > > Hello, I have a file (source.json) containing 25 GeoJSON polygons with > weather alerts, which I imported into postgres using the following > command: > > $ ogr2ogr -f "PostgreSQL" PG:"dbname=weatherzones user=postgres" > "source.json" -nln polys > > Here's how it looks in Postgres: > > polytest=# \d polys; > Table "public.polys" > Column | Type | Modifiers > --------------+-------------------------+--------------------------------------------------------- > ogc_fid | integer | not null default > nextval('polys_ogc_fid_seq'::regclass) > wkb_geometry | geometry(Geometry,4326) | > warnings | character varying | > Indexes: > "polys_pk" PRIMARY KEY, btree (ogc_fid) > "polys_geom_idx" gist (wkb_geometry) > > polytest=# > > I can see it stored all of them: > > polytest=# select count(*) from polys; > count > ------- > 25 > (1 row) > > polytest=# > > However, when I try to use a ST_Intersects(ST_PointFromText('POINT(), > I can't seem to get lines with MultiPolygons to return rows. The > regular Polygons seem to work fine, though. > > For example, I have the following MultiPolygon in my table from Nevada: > http://microflush.org/json/24.json > > Using a validator site, such as http://geojsonlint.com/ , I can > copy/paste that JSON into the interface and it looks like 2 adjacent > shapes making up the MultiPolygon. > > If I grab points from the upper section of the polygon, using > something like http://itouchmap.com/latlong.html, I get rows returned: > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -114.543457 39.336281 )', > 4326), wkb_geometry) limit 2; > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -115.658569 39.500297 )', > 4326), wkb_geometry) limit 2; > > But if I use a point from the lower Polygon section of that > MultiPolygon, I get zero: > > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -115.977173 38.548667 )', > 4326), wkb_geometry) limit 2; > > > > Another example from Florida (a little more difficult to see, but same > issue): > http://microflush.org/json/06.json > > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -81.988228 27.034561 )', 4326), > wkb_geometry) limit 2; > > warnings > ---------- > (0 rows) > > The above point (-81.988228 27.034561) would spacially exist in this > MultiPolygon. > > > However, in this example, it will only return rows if I pick a point > inside the little polygon which shows up focused to the south of the > much larger polygon (when you use the geojsonlin.com site to plot the > whole thing). For example, this point: > > polytest=# select warnings from polys where > ST_Intersects(ST_PointFromText('POINT( -81.9878 27.034 )', 4326), > wkb_geometry) limit 2; > (1 row) > > So, it would seem the select statements which should return > Multipolygons are not returning for all Polygons contained in the > MultiPolygon. > > Is there something I'm doing incorrectly with my queries? > > Any help would be great. > > Thank you! > > Joseph Spenner > > > > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.kania at op.pl Tue Sep 22 15:14:08 2015 From: p.kania at op.pl (Piotr Kania) Date: Wed, 23 Sep 2015 00:14:08 +0200 Subject: [postgis-users] How to convert multipolygon to linestring Message-ID: <5601D2B0.7010502@op.pl> Hi! I try to convert my multipolygon layer to multilinestring - here: http://postgis.refractions.net/docs/ST_ExteriorRing.html I found example: "(...)--If you have a table of MULTIPOLYGONs --and want to return a MULTILINESTRING composed of the exterior rings of each polygon SELECT gid, ST_Collect(ST_ExteriorRing(the_geom)) AS erings FROM (SELECT gid, (ST_Dump(the_geom)).geom As the_geom FROM sometable) As foo GROUP BY gid; (...)" My postgresql connection calls -"database", schema-"public", default primary key field - "gid", default geometry field -"geom", my multipolygon layer- "poly_layer". How will look sql code above, with my data- if I'd like to convert "poly_layer" into new multilinestring layer "line_layer"? Thanks for response Regarding Piotr Kania From Bob.Bistrais at maine.gov Wed Sep 23 14:26:32 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Wed, 23 Sep 2015 21:26:32 +0000 Subject: [postgis-users] Using string variables with PGScript Message-ID: I am having trouble using a variable in a Select statement, using PGScript. I am trying to define a string variable, then use it in the Select statement. Something like this: DECLARE @MYSTRING; SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a previous select SELECT * from mytable where myfield = @MYSTRING; -The variable is not quoted, so the select statement fails. How do I get the string variable to be enclosed in quotes? -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.fawcett at gmail.com Wed Sep 23 18:43:30 2015 From: david.fawcett at gmail.com (David Fawcett) Date: Wed, 23 Sep 2015 20:43:30 -0500 Subject: [postgis-users] Using string variables with PGScript In-Reply-To: References: Message-ID: Bob, I haven't ever used PGScript, but I wonder one of the postgres quote functions found on this page might work: http://www.postgresql.org/docs/9.1/static/functions-string.html I would try quote_literal() David. On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob wrote: > I am having trouble using a variable in a Select statement, using > PGScript. I am trying to define a string variable, then use it in the > Select statement. Something like this: > > > > DECLARE @MYSTRING; > > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a > previous select > > > > SELECT * from mytable where myfield = @MYSTRING; > > > > -The variable is not quoted, so the select statement fails. How do I get > the string variable to be enclosed in quotes? > > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgit.laggner at ti.bund.de Thu Sep 24 06:22:42 2015 From: birgit.laggner at ti.bund.de (Birgit Laggner) Date: Thu, 24 Sep 2015 15:22:42 +0200 Subject: [postgis-users] Using string variables with PGScript In-Reply-To: References: Message-ID: <5603F922.4090801@ti.bund.de> Hi Bob, I would recommend something as simple as SELECT * from mytable where myfield = '@MYSTRING'; I tried using a string variable in a PGScript once, too, and if I remember correctly, quote_literal() did not work. Good luck and regards, Birgit Am 24.09.2015 um 03:43 schrieb David Fawcett: > Bob, > > I haven't ever used PGScript, but I wonder one of the postgres quote > functions found on this page might work: > http://www.postgresql.org/docs/9.1/static/functions-string.html > > I would try quote_literal() > > David. > > On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > wrote: > > I am having trouble using a variable in a Select statement, using > PGScript. I am trying to define a string variable, then use it in > the Select statement. Something like this: > > DECLARE @MYSTRING; > > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was > set from a previous select > > SELECT * from mytable where myfield = @MYSTRING; > > -The variable is not quoted, so the select statement fails. How > do I get the string variable to be enclosed in quotes? > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From pramsey at cleverelephant.ca Thu Sep 24 15:25:56 2015 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Thu, 24 Sep 2015 15:25:56 -0700 Subject: [postgis-users] PostGIS 2.2.0 RC1 Message-ID: Hey everyone, We are almost at a 2.2.0 release (yeah, it took a while) so before doing that we are cutting a release candidate for you to test out. Please do. It's here: http://download.osgeo.org/postgis/source/postgis-2.2.0rc1.tar.gz The release notes are here: http://svn.osgeo.org/postgis/tags/2.2.0rc1/NEWS You can file tickets here, as usual: https://trac.osgeo.org/postgis Thanks! Team PostGIS From caritj at gmail.com Thu Sep 24 16:32:39 2015 From: caritj at gmail.com (Paul J. Caritj) Date: Thu, 24 Sep 2015 19:32:39 -0400 Subject: [postgis-users] invalid join selectivity: 179531936.000000 Message-ID: Hello, I am having trouble with what I expected to be a simple query. I have two tables, one of census tracts (with a multipolygon geometry column, srid 4269), and another of sites (with a point geometry column, srid 4269). I want to find the number of sites that are within a tract of more than a given population, so I've tried: SELECT count(sites.id) FROM sites, census_tracts WHERE AND census_tracts.population > 2000 AND ST_Contains(census_tracts.geometry, sites.location); But when I do this I get: psycopg2.InternalError: invalid join selectivity: 179531936.000000. Both of the relevant tables have been analyzed and vacuumed. The output of postgis_full_version() is POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER I'm using Windows 7. Does this ring a bell for anyone? Thanks very much! -Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From remi.cura at gmail.com Fri Sep 25 01:19:49 2015 From: remi.cura at gmail.com (=?UTF-8?Q?R=C3=A9mi_Cura?=) Date: Fri, 25 Sep 2015 10:19:49 +0200 Subject: [postgis-users] invalid join selectivity: 179531936.000000 In-Reply-To: References: Message-ID: Yep, I had the same problem https://trac.osgeo.org/postgis/ticket/2543 The issue is that this bug is hard to reproduce. As a workaround, you can try to drop and recreate the table : DROP TABLE VACUUM FULL ANALYZE CREATE TABLE CREATE INDEX Cheers, R?mi-C 2015-09-25 1:32 GMT+02:00 Paul J. Caritj : > Hello, > I am having trouble with what I expected to be a simple query. I have two > tables, one of census tracts (with a multipolygon geometry column, srid > 4269), and another of sites (with a point geometry column, srid 4269). I > want to find the number of sites that are within a tract of more than a > given population, so I've tried: > > SELECT count(sites.id) FROM sites, census_tracts WHERE AND > census_tracts.population > 2000 AND ST_Contains(census_tracts.geometry, > sites.location); > > But when I do this I get: psycopg2.InternalError: invalid join > selectivity: 179531936.000000. > > Both of the relevant tables have been analyzed and vacuumed. > > The output of postgis_full_version() is > > POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 > March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" > LIBJSON="UNKNOWN" RASTER > > I'm using Windows 7. > > Does this ring a bell for anyone? > > Thanks very much! > > -Paul > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Bistrais at maine.gov Fri Sep 25 05:19:26 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Fri, 25 Sep 2015 12:19:26 +0000 Subject: [postgis-users] postgis-users Digest, Vol 163, Issue 11 In-Reply-To: References: Message-ID: Hi Birgit and David, Many thanks for your replies. I actually tried what you had suggested. Quoting the variable as '@myvariable' caused the liteal string, @myvariable, to be passed. I also tried casting, but the variable still got passed as an integer, without quots, causing an error. In order to make it work, I created another field which is an integer field. I populated the new field with the appropriate integer values. This worked, but I would still be interested in finding a way to pas numeric characters as text. ________________________________________ From: postgis-users-bounces at lists.osgeo.org [postgis-users-bounces at lists.osgeo.org] on behalf of postgis-users-request at lists.osgeo.org [postgis-users-request at lists.osgeo.org] Sent: Thursday, September 24, 2015 3:00 PM To: postgis-users at lists.osgeo.org Subject: postgis-users Digest, Vol 163, Issue 11 Send postgis-users mailing list submissions to postgis-users at lists.osgeo.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users or, via email, send a message with subject or body 'help' to postgis-users-request at lists.osgeo.org You can reach the person managing the list at postgis-users-owner at lists.osgeo.org When replying, please edit your Subject line so it is more specific than "Re: Contents of postgis-users digest..." Today's Topics: 1. Using string variables with PGScript (Bistrais, Bob) 2. Re: Using string variables with PGScript (David Fawcett) 3. Re: Using string variables with PGScript (Birgit Laggner) ---------------------------------------------------------------------- Message: 1 Date: Wed, 23 Sep 2015 21:26:32 +0000 From: "Bistrais, Bob" To: "postgis-users at lists.osgeo.org" Subject: [postgis-users] Using string variables with PGScript Message-ID: Content-Type: text/plain; charset="us-ascii" I am having trouble using a variable in a Select statement, using PGScript. I am trying to define a string variable, then use it in the Select statement. Something like this: DECLARE @MYSTRING; SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a previous select SELECT * from mytable where myfield = @MYSTRING; -The variable is not quoted, so the select statement fails. How do I get the string variable to be enclosed in quotes? -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Wed, 23 Sep 2015 20:43:30 -0500 From: David Fawcett To: PostGIS Users Discussion Subject: Re: [postgis-users] Using string variables with PGScript Message-ID: Content-Type: text/plain; charset="utf-8" Bob, I haven't ever used PGScript, but I wonder one of the postgres quote functions found on this page might work: http://www.postgresql.org/docs/9.1/static/functions-string.html I would try quote_literal() David. On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob wrote: > I am having trouble using a variable in a Select statement, using > PGScript. I am trying to define a string variable, then use it in the > Select statement. Something like this: > > > > DECLARE @MYSTRING; > > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a > previous select > > > > SELECT * from mytable where myfield = @MYSTRING; > > > > -The variable is not quoted, so the select statement fails. How do I get > the string variable to be enclosed in quotes? > > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Thu, 24 Sep 2015 15:22:42 +0200 From: Birgit Laggner To: postgis-users at lists.osgeo.org Subject: Re: [postgis-users] Using string variables with PGScript Message-ID: <5603F922.4090801 at ti.bund.de> Content-Type: text/plain; charset="windows-1252"; Format="flowed" Hi Bob, I would recommend something as simple as SELECT * from mytable where myfield = '@MYSTRING'; I tried using a string variable in a PGScript once, too, and if I remember correctly, quote_literal() did not work. Good luck and regards, Birgit Am 24.09.2015 um 03:43 schrieb David Fawcett: > Bob, > > I haven't ever used PGScript, but I wonder one of the postgres quote > functions found on this page might work: > http://www.postgresql.org/docs/9.1/static/functions-string.html > > I would try quote_literal() > > David. > > On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > wrote: > > I am having trouble using a variable in a Select statement, using > PGScript. I am trying to define a string variable, then use it in > the Select statement. Something like this: > > DECLARE @MYSTRING; > > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was > set from a previous select > > SELECT * from mytable where myfield = @MYSTRING; > > -The variable is not quoted, so the select statement fails. How > do I get the string variable to be enclosed in quotes? > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users End of postgis-users Digest, Vol 163, Issue 11 ********************************************** From lr at pcorp.us Sat Sep 26 06:31:21 2015 From: lr at pcorp.us (Paragon Corporation) Date: Sat, 26 Sep 2015 09:31:21 -0400 Subject: [postgis-users] Vertica Spatial support Message-ID: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> Someone mentioned this on IRC because they were trying to use PostGIS with mindset of eventually porting to Vertica. https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/Place/HPVerticaPlac eLimitations.htm What intrigued me was that Vertica has a geography type and I had thought only PostGIS and SQL Server had that type. Aside from that rest is all OGC compliancy stuff, of course aside from it being a subset of what PostGIS has, the implementation looks strikingly similar. https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/Place/CategoriesOfS patialFunctions.htm (like ST_IsValidReason - that's not an OGC spatial function, but I thought a PostGIS concoction and they have that) Might be just because Vertica is one of Michael Stonebraker's inventions so the similarity would naturally come from ideas borrowed from related projects and the calling syntax would naturally behave like PostgreSQL. Has anybody used Vertica, knows about it etc. Thanks, Regina http://www.postgis.us http://postgis.net From lr at pcorp.us Sat Sep 26 06:47:27 2015 From: lr at pcorp.us (Paragon Corporation) Date: Sat, 26 Sep 2015 09:47:27 -0400 Subject: [postgis-users] invalid join selectivity: 179531936.000000 (and windows testers) Message-ID: <001201d0f861$e21ad5b0$a6508110$@pcorp.us> Paul C., Given that you are on windows, if it's not too much trouble for you, can you try upgrading to PostGIS 2.2.0rc1. The issue that Remi-C highlighted, looks like something that the other Paul (pramsey) committed to trunk (PostGIS 2.2) but did not back-port to 2.1 so you testing on 2.2, would better confirm the fix or ?non-fix and maybe he can back-port. I just pushed out the binaries for those for PostgreSQL 9.4 and 9.3 (and 9.2) (both 32-bit and 64-bit) - http://postgis.net/windows_downloads (in the experimental section) ? and on final release will push to Application Stackbuilder (though I won't be packaging 9.2 on stackbuilder). So you just need to pick the relevant RC1 for your postgres and copy over the binaries) And an ALTER EXTENSION postgis UPDATE; As a selfish reason, I'd really like to get some windows people testing PostGIS 2.2 before final release next week or so. It's been in incubation for quite some time (I think longer than 2.0 in fact) and has lots of new and shiny things (new proj, new GDAL, included SFCGAL for advanced 3D support ) (the stack-builder package will also have a pgRouting 2.1, ogr_fdw, (and pointcloud if I can get the damn thing to compile again)) that PostGIS 2.1 doesn't have. Thanks, Regina http://www.postgis.us http://postgis.net PostGIS Windows package maintainer. From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of R?mi Cura Sent: Friday, September 25, 2015 4:20 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] invalid join selectivity: 179531936.000000 Yep, I had the same problem https://trac.osgeo.org/postgis/ticket/2543 The issue is that this bug is hard to reproduce. As a workaround, you can try to drop and recreate the table : DROP TABLE VACUUM FULL ANALYZE CREATE TABLE CREATE INDEX Cheers, R?mi-C 2015-09-25 1:32 GMT+02:00 Paul J. Caritj >: Hello, I am having trouble with what I expected to be a simple query. I have two tables, one of census tracts (with a multipolygon geometry column, srid 4269), and another of sites (with a point geometry column, srid 4269). I want to find the number of sites that are within a tract of more than a given population, so I've tried: SELECT count(sites.id ) FROM sites, census_tracts WHERE AND census_tracts.population > 2000 AND ST_Contains(census_tracts.geometry, sites.location); But when I do this I get: psycopg2.InternalError: invalid join selectivity: 179531936.000000. Both of the relevant tables have been analyzed and vacuumed. The output of postgis_full_version() is POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER I'm using Windows 7. Does this ring a bell for anyone? Thanks very much! -Paul _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From gdt at ir.bbn.com Sat Sep 26 09:37:51 2015 From: gdt at ir.bbn.com (Greg Troxel) Date: Sat, 26 Sep 2015 12:37:51 -0400 Subject: [postgis-users] Vertica Spatial support In-Reply-To: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> (Paragon Corporation's message of "Sat, 26 Sep 2015 09:31:21 -0400") References: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> Message-ID: "Paragon Corporation" writes: > Someone mentioned this on IRC because they were trying to use PostGIS with > mindset of eventually porting to Vertica. That raises interesting licensing questions (assuming Vertica does not have a GPL-compatible license, which seems to be true). -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 180 bytes Desc: not available URL: From lr at pcorp.us Sat Sep 26 12:36:12 2015 From: lr at pcorp.us (Paragon Corporation) Date: Sat, 26 Sep 2015 15:36:12 -0400 Subject: [postgis-users] Vertica Spatial support In-Reply-To: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> References: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> Message-ID: <000f01d0f892$9aae6b20$d00b4160$@pcorp.us> Greg, >> Someone mentioned this on IRC because they were trying to use PostGIS with >> mindset of eventually porting to Vertica. > That raises interesting licensing questions (assuming Vertica does not > have a GPL-compatible license, which seems to be true). I don't think there is any GPL issue here. Sorry if I was unclear by the word "port". What the guy was interested in knowing was the portability of his SQL statements and ease of copying data over to Vertica if he were to choose that over PostGIS. I think he noticed that Vertica and PostGIS/PostgreSQL have similar looking syntax and of course PostGIS being much cheaper to develop on. The comment about Vertica having an ST_IsValidDetail function and geography type is an interesting "Standard by defacto" behavior I am seeing a lot of lately where different databases are copying each other even though the OGC nor SQL/MM defines such things. e.g. SQL Server had a geography - Paul liked that - PostGIS followed and added a geography type. I imagine Vertica thought the same and they created a geography type. So now we have a pseudo standard geography type thing sprouting up in many places. MySQL has massive parallels to PostGIS which I'm pretty sure they did not get from OGC or SQL/MM like their ST_GeoHash function https://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html SpatiaLite is so much like PostGIS that I'm tempted to rewrite my book and call it SpatiaLite (aka PostGISLite) In Action, with some minor changes (okay kidding a bit). Thanks, Regina http://www.postgis.us http://postgis.net _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From gdt at ir.bbn.com Sat Sep 26 15:55:47 2015 From: gdt at ir.bbn.com (Greg Troxel) Date: Sat, 26 Sep 2015 18:55:47 -0400 Subject: [postgis-users] Vertica Spatial support In-Reply-To: <000f01d0f892$9aae6b20$d00b4160$@pcorp.us> (Paragon Corporation's message of "Sat, 26 Sep 2015 15:36:12 -0400") References: <000001d0f85f$a28ebf30$e7ac3d90$@pcorp.us> <000f01d0f892$9aae6b20$d00b4160$@pcorp.us> Message-ID: "Paragon Corporation" writes: > I don't think there is any GPL issue here. Sorry if I was unclear by the > word "port". What the guy was interested in knowing was the portability of > his SQL statements and ease of copying data over to Vertica if he were to > choose that over PostGIS. Thanks. That makes sense and I agree there is no issue. I thought you meant to compile postgis as an extension into Vertica. > The comment about Vertica having an ST_IsValidDetail function and geography > type is an interesting "Standard by defacto" behavior I am seeing a lot of > lately where different databases are copying each other even though the OGC > nor SQL/MM defines such things. It's remarkable (and nice) that beyond-standard things seem to be the same. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 180 bytes Desc: not available URL: From ohwang00 at gmail.com Sun Sep 27 00:33:58 2015 From: ohwang00 at gmail.com (One) Date: Sun, 27 Sep 2015 00:33:58 -0700 (PDT) Subject: [postgis-users] Install problem with PROJ directory In-Reply-To: References: Message-ID: <1443339238018-5008851.post@n6.nabble.com> I have a problem similar to the OP. I installed PostgreSQL and Proj4 on my Mac, and now I want to install PostGIS from source. However, when I run the ./configure command, I get this result: ... checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: could not find proj_api.h - you may need to specify the directory of a PROJ.4 installation using --with-projdir I believe that postgres and proj were installed correctly because sample psql and proj commands appear to work okay. If I do "which proj", I get this result: /usr/local/bin/proj Also, a search for "proj_api.h" shows these results, minus the file in the source directory: /Library/Frameworks/PROJ.framework/Versions/4/Headers/proj_api.h /opt/local/include/proj_api.h /usr/local/include/proj_api.h I have tried the following and still failed to configure: ./configure --with-projdir=/usr/local/bin ./configure --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers/ ./configure --with-projdir=/opt/local/include/ ./configure --with-projdir=/usr/local/include My specs: -MacBookPro OS X Yosemite Version 10.10.2 -XCode version 6.3.2 -PostgreSQL version 9.3.5 , installed from source (I am using an older version of Postgres because I need a version that's compatible with ArcGIS). -Proj4 version 4.9.1 (the one at /usr/local/bin/proj is installed from source, and the one at /opt/local is installed from MacPorts) I am installing PostGIS from source, and not Homebrew, MacPorts, or KyngChaos, because I need a version that will work with PostgreSQL 9.3.5. What should I try next? Thanks for your help. ------ Sample output: $ ./configure --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers checking build system type... x86_64-apple-darwin14.1.0 checking host system type... x86_64-apple-darwin14.1.0 checking how to print strings... printf checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm checking the name lister (/usr/bin/nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 196608 checking how to convert x86_64-apple-darwin14.1.0 file names to x86_64-apple-darwin14.1.0 format... func_convert_file_noop checking how to convert x86_64-apple-darwin14.1.0 file names to toolchain format... func_convert_file_noop checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for objdump... no checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... no checking for strip... strip checking for ranlib... ranlib checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking command to parse /usr/bin/nm output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking for dsymutil... dsymutil checking for nmedit... nmedit checking for lipo... lipo checking for otool... otool checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin14.1.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking how to run the C preprocessor... gcc -E checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fno-common -DPIC checking if g++ PIC flag -fno-common -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin14.1.0 dyld checking how to hardcode library paths into programs... immediate checking for grep that handles long lines and -e... (cached) /usr/bin/grep checking for ant... no checking for cpp... /usr/bin/cpp checking if g++ supports -Wall... yes checking if g++ supports -Wmissing-prototypes... yes checking if g++ supports -ffloat-store... no checking for flex... flex checking lex output file root... lex.yy checking lex library... -ll checking whether yytext is a pointer... yes checking for bison... bison -y checking ieeefp.h usability... no checking ieeefp.h presence... no checking for ieeefp.h... no checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking for vasprintf... yes checking for asprintf... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking whether isfinite is declared... yes checking whether isfinite is declared... yes checking for perl... /usr/bin/perl checking for convert... no configure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be built checking for xsltproc... /usr/bin/xsltproc checking for xmllint... /usr/bin/xmllint checking for dblatex... no configure: WARNING: dblatex is not installed so PDF documentation cannot be built configure: WARNING: could not locate Docbook stylesheets required to build the documentation checking CUnit/CUnit.h usability... no checking CUnit/CUnit.h presence... no checking for CUnit/CUnit.h... no configure: WARNING: could not locate CUnit required for unit tests checking iconv.h usability... yes checking iconv.h presence... yes checking for iconv.h... yes checking for libiconv_open in -liconv... no checking for iconv_open in -lc... no checking for iconv_open in -liconv... yes checking for iconvctl... no checking for libiconvctl... no checking for pg_config... /usr/local/pgsql/bin/pg_config checking PostgreSQL version... PostgreSQL 9.3.5 checking libpq-fe.h usability... yes checking libpq-fe.h presence... yes checking for libpq-fe.h... yes checking for PQserverVersion in -lpq... yes checking for xml2-config... /usr/bin/xml2-config checking libxml/tree.h usability... yes checking libxml/tree.h presence... yes checking for libxml/tree.h... yes checking libxml/parser.h usability... yes checking libxml/parser.h presence... yes checking for libxml/parser.h... yes checking libxml/xpath.h usability... yes checking libxml/xpath.h presence... yes checking for libxml/xpath.h... yes checking libxml/xpathInternals.h usability... yes checking libxml/xpathInternals.h presence... yes checking for libxml/xpathInternals.h... yes checking for xmlInitParser in -lxml2... yes checking for geos-config... /usr/local/bin/geos-config checking GEOS version... 3.4.2 checking geos_c.h usability... yes checking geos_c.h presence... yes checking for geos_c.h... yes checking for initGEOS in -lgeos_c... yes checking for sfcgal-config... /usr/local/bin/sfcgal-config checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a thread-safe mkdir -p... ./install-sh -c -d checking whether NLS is requested... yes checking for msgfmt... /opt/local/bin/msgfmt checking for gmsgfmt... /opt/local/bin/msgfmt checking for xgettext... /opt/local/bin/xgettext checking for msgmerge... /opt/local/bin/msgmerge checking for ld used by GCC... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for shared library run path origin... done checking for CFPreferencesCopyAppValue... yes checking for CFLocaleCopyCurrent... yes checking for GNU gettext in libc... no checking for iconv... yes checking for working iconv... yes checking how to link with libiconv... -liconv checking for GNU gettext in libintl... no checking whether to use NLS... no Using user-specified proj directory: /Library/Frameworks/PROJ.framework/Versions/4/Headers checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: could not find proj_api.h - you may need to specify the directory of a PROJ.4 installation using --with-projdir ------ Steps I followed to install Proj4 from source: mkdir proj4 cd proj4 curl -O http://download.osgeo.org/proj/proj-4.9.1.tar.gz gunzip proj-4.9.1.tar.gz tar xf proj-4.9.1.tar cd proj-4.9.1 ./configure make make check make install -- View this message in context: http://postgis.17.x6.nabble.com/Install-problem-with-PROJ-directory-tp4998687p5008851.html Sent from the PostGIS - User mailing list archive at Nabble.com. From lr at pcorp.us Sun Sep 27 18:39:39 2015 From: lr at pcorp.us (Paragon Corporation) Date: Sun, 27 Sep 2015 21:39:39 -0400 Subject: [postgis-users] Install problem with PROJ directory In-Reply-To: <1443339238018-5008851.post@n6.nabble.com> References: <1443339238018-5008851.post@n6.nabble.com> Message-ID: <000901d0f98e$8b105500$a130ff00$@pcorp.us> Try changing the To ./configure --with-projdir=/opt/local Or with: ./configure --with-projdir=/usr/local The directory path is that that includes the include and bin for proj. Not the include path. Hope that helps, Regina http://www.postgis.us http://postgis.net -----Original Message----- From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of One Sent: Sunday, September 27, 2015 3:34 AM To: postgis-users at lists.osgeo.org Subject: Re: [postgis-users] Install problem with PROJ directory I have a problem similar to the OP. I installed PostgreSQL and Proj4 on my Mac, and now I want to install PostGIS from source. However, when I run the ./configure command, I get this result: ... checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: could not find proj_api.h - you may need to specify the directory of a PROJ.4 installation using --with-projdir I believe that postgres and proj were installed correctly because sample psql and proj commands appear to work okay. If I do "which proj", I get this result: /usr/local/bin/proj Also, a search for "proj_api.h" shows these results, minus the file in the source directory: /Library/Frameworks/PROJ.framework/Versions/4/Headers/proj_api.h /opt/local/include/proj_api.h /usr/local/include/proj_api.h I have tried the following and still failed to configure: ./configure --with-projdir=/usr/local/bin ./configure --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers/ ./configure --with-projdir=/opt/local/include/ ./configure --with-projdir=/usr/local/include My specs: -MacBookPro OS X Yosemite Version 10.10.2 -XCode version 6.3.2 -PostgreSQL version 9.3.5 , installed from source (I am using an older version of Postgres because I need a version that's compatible with ArcGIS). -Proj4 version 4.9.1 (the one at /usr/local/bin/proj is installed from source, and the one at /opt/local is installed from MacPorts) I am installing PostGIS from source, and not Homebrew, MacPorts, or KyngChaos, because I need a version that will work with PostgreSQL 9.3.5. What should I try next? Thanks for your help. ------ Sample output: $ ./configure --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers checking build system type... x86_64-apple-darwin14.1.0 checking host system type... x86_64-apple-darwin14.1.0 checking how to print strings... printf checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha in/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm checking the name lister (/usr/bin/nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 196608 checking how to convert x86_64-apple-darwin14.1.0 file names to x86_64-apple-darwin14.1.0 format... func_convert_file_noop checking how to convert x86_64-apple-darwin14.1.0 file names to toolchain format... func_convert_file_noop checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha in/usr/bin/ld option to reload object files... -r checking for objdump... no checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... no checking for strip... strip checking for ranlib... ranlib checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking command to parse /usr/bin/nm output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking for dsymutil... dsymutil checking for nmedit... nmedit checking for lipo... lipo checking for otool... otool checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin14.1.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking how to run the C preprocessor... gcc -E checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha in/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) is GNU ld... no checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fno-common -DPIC checking if g++ PIC flag -fno-common -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin14.1.0 dyld checking how to hardcode library paths into programs... immediate checking for grep that handles long lines and -e... (cached) /usr/bin/grep checking for ant... no checking for cpp... /usr/bin/cpp checking if g++ supports -Wall... yes checking if g++ supports -Wmissing-prototypes... yes checking if g++ supports -ffloat-store... no checking for flex... flex checking lex output file root... lex.yy checking lex library... -ll checking whether yytext is a pointer... yes checking for bison... bison -y checking ieeefp.h usability... no checking ieeefp.h presence... no checking for ieeefp.h... no checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking for vasprintf... yes checking for asprintf... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking whether isfinite is declared... yes checking whether isfinite is declared... yes checking for perl... /usr/bin/perl checking for convert... no configure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be built checking for xsltproc... /usr/bin/xsltproc checking for xmllint... /usr/bin/xmllint checking for dblatex... no configure: WARNING: dblatex is not installed so PDF documentation cannot be built configure: WARNING: could not locate Docbook stylesheets required to build the documentation checking CUnit/CUnit.h usability... no checking CUnit/CUnit.h presence... no checking for CUnit/CUnit.h... no configure: WARNING: could not locate CUnit required for unit tests checking iconv.h usability... yes checking iconv.h presence... yes checking for iconv.h... yes checking for libiconv_open in -liconv... no checking for iconv_open in -lc... no checking for iconv_open in -liconv... yes checking for iconvctl... no checking for libiconvctl... no checking for pg_config... /usr/local/pgsql/bin/pg_config checking PostgreSQL version... PostgreSQL 9.3.5 checking libpq-fe.h usability... yes checking libpq-fe.h presence... yes checking for libpq-fe.h... yes checking for PQserverVersion in -lpq... yes checking for xml2-config... /usr/bin/xml2-config checking libxml/tree.h usability... yes checking libxml/tree.h presence... yes checking for libxml/tree.h... yes checking libxml/parser.h usability... yes checking libxml/parser.h presence... yes checking for libxml/parser.h... yes checking libxml/xpath.h usability... yes checking libxml/xpath.h presence... yes checking for libxml/xpath.h... yes checking libxml/xpathInternals.h usability... yes checking libxml/xpathInternals.h presence... yes checking for libxml/xpathInternals.h... yes checking for xmlInitParser in -lxml2... yes checking for geos-config... /usr/local/bin/geos-config checking GEOS version... 3.4.2 checking geos_c.h usability... yes checking geos_c.h presence... yes checking for geos_c.h... yes checking for initGEOS in -lgeos_c... yes checking for sfcgal-config... /usr/local/bin/sfcgal-config checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a thread-safe mkdir -p... ./install-sh -c -d checking whether NLS is requested... yes checking for msgfmt... /opt/local/bin/msgfmt checking for gmsgfmt... /opt/local/bin/msgfmt checking for xgettext... /opt/local/bin/xgettext checking for msgmerge... /opt/local/bin/msgmerge checking for ld used by GCC... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha in/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch ain/usr/bin/ld) is GNU ld... no checking for shared library run path origin... done checking for CFPreferencesCopyAppValue... yes checking for CFLocaleCopyCurrent... yes checking for GNU gettext in libc... no checking for iconv... yes checking for working iconv... yes checking how to link with libiconv... -liconv checking for GNU gettext in libintl... no checking whether to use NLS... no Using user-specified proj directory: /Library/Frameworks/PROJ.framework/Versions/4/Headers checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: could not find proj_api.h - you may need to specify the directory of a PROJ.4 installation using --with-projdir ------ Steps I followed to install Proj4 from source: mkdir proj4 cd proj4 curl -O http://download.osgeo.org/proj/proj-4.9.1.tar.gz gunzip proj-4.9.1.tar.gz tar xf proj-4.9.1.tar cd proj-4.9.1 ./configure make make check make install -- View this message in context: http://postgis.17.x6.nabble.com/Install-problem-with-PROJ-directory-tp499868 7p5008851.html Sent from the PostGIS - User mailing list archive at Nabble.com. _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From birgit.laggner at ti.bund.de Mon Sep 28 01:02:17 2015 From: birgit.laggner at ti.bund.de (Birgit Laggner) Date: Mon, 28 Sep 2015 10:02:17 +0200 Subject: [postgis-users] postgis-users Digest, Vol 163, Issue 11 In-Reply-To: References: Message-ID: <5608F409.9040204@ti.bund.de> Hi Bob, now, I understand your problem. My suggestion would be to triple the single quotation marks as in the small example below: declare @v; set @v = '''1'''; print @v; I hope this works with your pgscript somehow... Regards, Birgit Am 25.09.2015 um 14:19 schrieb Bistrais, Bob: > Hi Birgit and David, > > Many thanks for your replies. I actually tried what you had suggested. Quoting the variable as '@myvariable' caused the liteal string, @myvariable, to be passed. I also tried casting, but the variable still got passed as an integer, without quots, causing an error. > > In order to make it work, I created another field which is an integer field. I populated the new field with the appropriate integer values. This worked, but I would still be interested in finding a way to pas numeric characters as text. > > > > ________________________________________ > From: postgis-users-bounces at lists.osgeo.org [postgis-users-bounces at lists.osgeo.org] on behalf of postgis-users-request at lists.osgeo.org [postgis-users-request at lists.osgeo.org] > Sent: Thursday, September 24, 2015 3:00 PM > To: postgis-users at lists.osgeo.org > Subject: postgis-users Digest, Vol 163, Issue 11 > > Send postgis-users mailing list submissions to > postgis-users at lists.osgeo.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > or, via email, send a message with subject or body 'help' to > postgis-users-request at lists.osgeo.org > > You can reach the person managing the list at > postgis-users-owner at lists.osgeo.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of postgis-users digest..." > > > Today's Topics: > > 1. Using string variables with PGScript (Bistrais, Bob) > 2. Re: Using string variables with PGScript (David Fawcett) > 3. Re: Using string variables with PGScript (Birgit Laggner) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 23 Sep 2015 21:26:32 +0000 > From: "Bistrais, Bob" > To: "postgis-users at lists.osgeo.org" > Subject: [postgis-users] Using string variables with PGScript > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > I am having trouble using a variable in a Select statement, using PGScript. I am trying to define a string variable, then use it in the Select statement. Something like this: > > DECLARE @MYSTRING; > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a previous select > > SELECT * from mytable where myfield = @MYSTRING; > > -The variable is not quoted, so the select statement fails. How do I get the string variable to be enclosed in quotes? > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 23 Sep 2015 20:43:30 -0500 > From: David Fawcett > To: PostGIS Users Discussion > Subject: Re: [postgis-users] Using string variables with PGScript > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Bob, > > I haven't ever used PGScript, but I wonder one of the postgres quote > functions found on this page might work: > http://www.postgresql.org/docs/9.1/static/functions-string.html > > I would try quote_literal() > > David. > > On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > wrote: > >> I am having trouble using a variable in a Select statement, using >> PGScript. I am trying to define a string variable, then use it in the >> Select statement. Something like this: >> >> >> >> DECLARE @MYSTRING; >> >> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a >> previous select >> >> >> >> SELECT * from mytable where myfield = @MYSTRING; >> >> >> >> -The variable is not quoted, so the select statement fails. How do I get >> the string variable to be enclosed in quotes? >> >> >> >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Thu, 24 Sep 2015 15:22:42 +0200 > From: Birgit Laggner > To: postgis-users at lists.osgeo.org > Subject: Re: [postgis-users] Using string variables with PGScript > Message-ID: <5603F922.4090801 at ti.bund.de> > Content-Type: text/plain; charset="windows-1252"; Format="flowed" > > Hi Bob, > > I would recommend something as simple as > > SELECT * from mytable where myfield = '@MYSTRING'; > > I tried using a string variable in a PGScript once, too, and if I > remember correctly, quote_literal() did not work. > > Good luck and regards, > > Birgit > > > > > Am 24.09.2015 um 03:43 schrieb David Fawcett: >> Bob, >> >> I haven't ever used PGScript, but I wonder one of the postgres quote >> functions found on this page might work: >> http://www.postgresql.org/docs/9.1/static/functions-string.html >> >> I would try quote_literal() >> >> David. >> >> On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > > wrote: >> >> I am having trouble using a variable in a Select statement, using >> PGScript. I am trying to define a string variable, then use it in >> the Select statement. Something like this: >> >> DECLARE @MYSTRING; >> >> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was >> set from a previous select >> >> SELECT * from mytable where myfield = @MYSTRING; >> >> -The variable is not quoted, so the select statement fails. How >> do I get the string variable to be enclosed in quotes? >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > End of postgis-users Digest, Vol 163, Issue 11 > ********************************************** > From ohwang00 at gmail.com Mon Sep 28 12:35:01 2015 From: ohwang00 at gmail.com (One Hwang) Date: Mon, 28 Sep 2015 12:35:01 -0700 Subject: [postgis-users] Install problem with PROJ directory In-Reply-To: <000901d0f98e$8b105500$a130ff00$@pcorp.us> References: <1443339238018-5008851.post@n6.nabble.com> <000901d0f98e$8b105500$a130ff00$@pcorp.us> Message-ID: Thank you, Regina! That worked! On Sun, Sep 27, 2015 at 6:39 PM, Paragon Corporation wrote: > Try changing the > To > > ./configure --with-projdir=/opt/local > > > Or with: > > ./configure --with-projdir=/usr/local > > > The directory path is that that includes the include and bin for proj. > Not > the include path. > > Hope that helps, > Regina > http://www.postgis.us > http://postgis.net > > > -----Original Message----- > From: postgis-users-bounces at lists.osgeo.org > [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of One > Sent: Sunday, September 27, 2015 3:34 AM > To: postgis-users at lists.osgeo.org > Subject: Re: [postgis-users] Install problem with PROJ directory > > I have a problem similar to the OP. I installed PostgreSQL and Proj4 on my > Mac, and now I want to install PostGIS from source. However, when I run the > ./configure command, I get this result: > > ... > checking proj_api.h usability... no > checking proj_api.h presence... no > checking for proj_api.h... no > configure: error: could not find proj_api.h - you may need to specify the > directory of a PROJ.4 installation using --with-projdir > > I believe that postgres and proj were installed correctly because sample > psql and proj commands appear to work okay. > > If I do "which proj", I get this result: > /usr/local/bin/proj > > Also, a search for "proj_api.h" shows these results, minus the file in the > source directory: > /Library/Frameworks/PROJ.framework/Versions/4/Headers/proj_api.h > /opt/local/include/proj_api.h > /usr/local/include/proj_api.h > > I have tried the following and still failed to configure: > ./configure --with-projdir=/usr/local/bin ./configure > --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers/ > ./configure --with-projdir=/opt/local/include/ > ./configure --with-projdir=/usr/local/include > > My specs: > > -MacBookPro OS X Yosemite Version 10.10.2 -XCode version 6.3.2 -PostgreSQL > version 9.3.5 , installed from source (I am using an older version of > Postgres because I need a version that's compatible with ArcGIS). > -Proj4 version 4.9.1 (the one at /usr/local/bin/proj is installed from > source, and the one at /opt/local is installed from MacPorts) > > I am installing PostGIS from source, and not Homebrew, MacPorts, or > KyngChaos, because I need a version that will work with PostgreSQL 9.3.5. > > What should I try next? > > Thanks for your help. > > ------ > > Sample output: > > $ ./configure > --with-projdir=/Library/Frameworks/PROJ.framework/Versions/4/Headers > checking build system type... x86_64-apple-darwin14.1.0 checking host > system > type... x86_64-apple-darwin14.1.0 checking how to print strings... printf > checking for gcc... gcc checking whether the C compiler works... yes > checking for C compiler default output file name... a.out checking for > suffix of executables... > checking whether we are cross compiling... no checking for suffix of object > files... o checking whether we are using the GNU C compiler... yes checking > whether gcc accepts -g... yes checking for gcc option to accept ISO C89... > none needed checking for a sed that does not truncate output... > /usr/bin/sed > checking for grep that handles long lines and -e... /usr/bin/grep checking > for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F > checking for ld used by gcc... > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha > in/usr/bin/ld > checking if the linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > is GNU ld... no > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm checking > the name lister (/usr/bin/nm) interface... BSD nm checking whether ln -s > works... yes checking the maximum length of command line arguments... > 196608 > checking how to convert x86_64-apple-darwin14.1.0 file names to > x86_64-apple-darwin14.1.0 format... func_convert_file_noop checking how to > convert x86_64-apple-darwin14.1.0 file names to toolchain format... > func_convert_file_noop checking for > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha > in/usr/bin/ld > option to reload object files... -r > checking for objdump... no > checking how to recognize dependent libraries... pass_all checking for > dlltool... no checking how to associate runtime and link libraries... > printf > %s\n checking for ar... ar checking for archiver @FILE support... no > checking for strip... strip checking for ranlib... ranlib checking for > gawk... no checking for mawk... no checking for nawk... no checking for > awk... awk checking command to parse /usr/bin/nm output from gcc object... > ok checking for sysroot... no checking for a working dd... /bin/dd checking > how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... > no checking if : is a manifest tool... no checking for dsymutil... dsymutil > checking for nmedit... nmedit checking for lipo... lipo checking for > otool... otool checking for otool64... no checking for -single_module > linker > flag... yes checking for -exported_symbols_list linker flag... yes checking > for -force_load linker flag... yes checking how to run the C > preprocessor... > gcc -E checking for ANSI C header files... yes checking for sys/types.h... > yes checking for sys/stat.h... yes checking for stdlib.h... yes checking > for > string.h... yes checking for memory.h... yes checking for strings.h... yes > checking for inttypes.h... yes checking for stdint.h... yes checking for > unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs > checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc > option to produce PIC... -fno-common -DPIC checking if gcc PIC flag > -fno-common -DPIC works... yes checking if gcc static flag -static works... > no checking if gcc supports -c -o file.o... yes checking if gcc supports -c > -o file.o... (cached) yes checking whether the gcc linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > supports shared libraries... yes > checking dynamic linker characteristics... darwin14.1.0 dyld checking how > to > hardcode library paths into programs... immediate checking whether > stripping > libraries is possible... yes checking if libtool supports shared > libraries... yes checking whether to build shared libraries... yes checking > whether to build static libraries... yes checking for gcc... (cached) gcc > checking whether we are using the GNU C compiler... (cached) yes checking > whether gcc accepts -g... (cached) yes checking for gcc option to accept > ISO > C89... (cached) none needed checking how to run the C preprocessor... gcc > -E > checking for g++... g++ checking whether we are using the GNU C++ > compiler... yes checking whether g++ accepts -g... yes checking how to run > the C++ preprocessor... g++ -E checking for ld used by g++... > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha > in/usr/bin/ld > checking if the linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > is GNU ld... no > checking whether the g++ linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > supports shared libraries... yes > checking for g++ option to produce PIC... -fno-common -DPIC checking if g++ > PIC flag -fno-common -DPIC works... yes checking if g++ static flag -static > works... no checking if g++ supports -c -o file.o... yes checking if g++ > supports -c -o file.o... (cached) yes checking whether the g++ linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > supports shared libraries... yes > checking dynamic linker characteristics... darwin14.1.0 dyld checking how > to > hardcode library paths into programs... immediate checking for grep that > handles long lines and -e... (cached) /usr/bin/grep checking for ant... no > checking for cpp... /usr/bin/cpp checking if g++ supports -Wall... yes > checking if g++ supports -Wmissing-prototypes... yes checking if g++ > supports -ffloat-store... no checking for flex... flex checking lex output > file root... lex.yy checking lex library... -ll checking whether yytext is > a > pointer... yes checking for bison... bison -y checking ieeefp.h > usability... > no checking ieeefp.h presence... no checking for ieeefp.h... no checking > termios.h usability... yes checking termios.h presence... yes checking for > termios.h... yes checking for vasprintf... yes checking for asprintf... yes > checking for _LARGEFILE_SOURCE value needed for large files... no checking > whether isfinite is declared... yes checking whether isfinite is > declared... > yes checking for perl... /usr/bin/perl checking for convert... no > configure: WARNING: ImageMagick does not seem to be installed. > Documentation > cannot be built checking for xsltproc... /usr/bin/xsltproc checking for > xmllint... /usr/bin/xmllint checking for dblatex... no > configure: WARNING: dblatex is not installed so PDF documentation cannot be > built > configure: WARNING: could not locate Docbook stylesheets required to build > the documentation checking CUnit/CUnit.h usability... no checking > CUnit/CUnit.h presence... no checking for CUnit/CUnit.h... no > configure: WARNING: could not locate CUnit required for unit tests checking > iconv.h usability... yes checking iconv.h presence... yes checking for > iconv.h... yes checking for libiconv_open in -liconv... no checking for > iconv_open in -lc... no checking for iconv_open in -liconv... yes checking > for iconvctl... no checking for libiconvctl... no checking for pg_config... > /usr/local/pgsql/bin/pg_config checking PostgreSQL version... PostgreSQL > 9.3.5 checking libpq-fe.h usability... yes checking libpq-fe.h presence... > yes checking for libpq-fe.h... yes checking for PQserverVersion in -lpq... > yes checking for xml2-config... /usr/bin/xml2-config checking libxml/tree.h > usability... yes checking libxml/tree.h presence... yes checking for > libxml/tree.h... yes checking libxml/parser.h usability... yes checking > libxml/parser.h presence... yes checking for libxml/parser.h... yes > checking > libxml/xpath.h usability... yes checking libxml/xpath.h presence... yes > checking for libxml/xpath.h... yes checking libxml/xpathInternals.h > usability... yes checking libxml/xpathInternals.h presence... yes checking > for libxml/xpathInternals.h... yes checking for xmlInitParser in -lxml2... > yes checking for geos-config... /usr/local/bin/geos-config checking GEOS > version... 3.4.2 checking geos_c.h usability... yes checking geos_c.h > presence... yes checking for geos_c.h... yes checking for initGEOS in > -lgeos_c... yes checking for sfcgal-config... /usr/local/bin/sfcgal-config > checking whether make sets $(MAKE)... yes checking for a BSD-compatible > install... /usr/bin/install -c checking for a thread-safe mkdir -p... > ./install-sh -c -d checking whether NLS is requested... yes checking for > msgfmt... /opt/local/bin/msgfmt checking for gmsgfmt... > /opt/local/bin/msgfmt checking for xgettext... /opt/local/bin/xgettext > checking for msgmerge... /opt/local/bin/msgmerge checking for ld used by > GCC... > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolcha > in/usr/bin/ld > checking if the linker > > (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolch > ain/usr/bin/ld) > is GNU ld... no > checking for shared library run path origin... done checking for > CFPreferencesCopyAppValue... yes checking for CFLocaleCopyCurrent... yes > checking for GNU gettext in libc... no checking for iconv... yes checking > for working iconv... yes checking how to link with libiconv... -liconv > checking for GNU gettext in libintl... no checking whether to use NLS... no > Using user-specified proj directory: > /Library/Frameworks/PROJ.framework/Versions/4/Headers > checking proj_api.h usability... no > checking proj_api.h presence... no > checking for proj_api.h... no > configure: error: could not find proj_api.h - you may need to specify the > directory of a PROJ.4 installation using --with-projdir > > ------ > Steps I followed to install Proj4 from source: > > mkdir proj4 > cd proj4 > curl -O http://download.osgeo.org/proj/proj-4.9.1.tar.gz > gunzip proj-4.9.1.tar.gz > tar xf proj-4.9.1.tar > cd proj-4.9.1 > ./configure > make > make check > make install > > > > > -- > View this message in context: > > http://postgis.17.x6.nabble.com/Install-problem-with-PROJ-directory-tp499868 > 7p5008851.html > Sent from the PostGIS - User mailing list archive at Nabble.com. > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caritj at gmail.com Mon Sep 28 12:38:58 2015 From: caritj at gmail.com (Paul J. Caritj) Date: Mon, 28 Sep 2015 15:38:58 -0400 Subject: [postgis-users] invalid join selectivity: 179531936.000000 In-Reply-To: References: Message-ID: Thanks everyone. I had mistakenly assumed that the bug R?mi and Imre have pointed out would be fixed in 2.1.8. I haven't been able to upgrade or patch, but the workaround of copying the data to a new table seems to work. Thanks again, Paul On Fri, Sep 25, 2015 at 4:19 AM, R?mi Cura wrote: > Yep, > I had the same problem > https://trac.osgeo.org/postgis/ticket/2543 > > The issue is that this bug is hard to reproduce. > > As a workaround, you can try to drop and recreate the table : > DROP TABLE > VACUUM FULL ANALYZE > CREATE TABLE > CREATE INDEX > > > Cheers, > R?mi-C > > > > 2015-09-25 1:32 GMT+02:00 Paul J. Caritj : > >> Hello, >> I am having trouble with what I expected to be a simple query. I have two >> tables, one of census tracts (with a multipolygon geometry column, srid >> 4269), and another of sites (with a point geometry column, srid 4269). I >> want to find the number of sites that are within a tract of more than a >> given population, so I've tried: >> >> SELECT count(sites.id) FROM sites, census_tracts WHERE AND >> census_tracts.population > 2000 AND ST_Contains(census_tracts.geometry, >> sites.location); >> >> But when I do this I get: psycopg2.InternalError: invalid join >> selectivity: 179531936.000000. >> >> Both of the relevant tables have been analyzed and vacuumed. >> >> The output of postgis_full_version() is >> >> POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 >> March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" >> LIBJSON="UNKNOWN" RASTER >> >> I'm using Windows 7. >> >> Does this ring a bell for anyone? >> >> Thanks very much! >> >> -Paul >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Bistrais at maine.gov Mon Sep 28 13:01:12 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Mon, 28 Sep 2015 20:01:12 +0000 Subject: [postgis-users] postgis-users Digest, Vol 163, Issue 11 In-Reply-To: <5608F409.9040204@ti.bund.de> References: <5608F409.9040204@ti.bund.de> Message-ID: Hello Birgit, I tried triple quoting my value as suggested. This works in the simple script. But when I try using it in a Select statement, it fails: declare @v; set @v = '''1'''; SELECT * from gradeschools_aroo where gradecode = @v; SELECT * from gradeschools_aroo where gradecode = ''1'' ERROR: syntax error at or near "1" -----Original Message----- From: Birgit Laggner [mailto:birgit.laggner at ti.bund.de] Sent: Monday, September 28, 2015 4:02 AM To: Bistrais, Bob; postgis-users at lists.osgeo.org; david.fawcett at gmail.com Subject: Re: postgis-users Digest, Vol 163, Issue 11 Hi Bob, now, I understand your problem. My suggestion would be to triple the single quotation marks as in the small example below: declare @v; set @v = '''1'''; print @v; I hope this works with your pgscript somehow... Regards, Birgit Am 25.09.2015 um 14:19 schrieb Bistrais, Bob: > Hi Birgit and David, > > Many thanks for your replies. I actually tried what you had suggested. Quoting the variable as '@myvariable' caused the liteal string, @myvariable, to be passed. I also tried casting, but the variable still got passed as an integer, without quots, causing an error. > > In order to make it work, I created another field which is an integer field. I populated the new field with the appropriate integer values. This worked, but I would still be interested in finding a way to pas numeric characters as text. > > > > ________________________________________ > From: postgis-users-bounces at lists.osgeo.org [postgis-users-bounces at lists.osgeo.org] on behalf of postgis-users-request at lists.osgeo.org [postgis-users-request at lists.osgeo.org] > Sent: Thursday, September 24, 2015 3:00 PM > To: postgis-users at lists.osgeo.org > Subject: postgis-users Digest, Vol 163, Issue 11 > > Send postgis-users mailing list submissions to > postgis-users at lists.osgeo.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > or, via email, send a message with subject or body 'help' to > postgis-users-request at lists.osgeo.org > > You can reach the person managing the list at > postgis-users-owner at lists.osgeo.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of postgis-users digest..." > > > Today's Topics: > > 1. Using string variables with PGScript (Bistrais, Bob) > 2. Re: Using string variables with PGScript (David Fawcett) > 3. Re: Using string variables with PGScript (Birgit Laggner) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 23 Sep 2015 21:26:32 +0000 > From: "Bistrais, Bob" > To: "postgis-users at lists.osgeo.org" > Subject: [postgis-users] Using string variables with PGScript > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > I am having trouble using a variable in a Select statement, using PGScript. I am trying to define a string variable, then use it in the Select statement. Something like this: > > DECLARE @MYSTRING; > SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a previous select > > SELECT * from mytable where myfield = @MYSTRING; > > -The variable is not quoted, so the select statement fails. How do I get the string variable to be enclosed in quotes? > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 23 Sep 2015 20:43:30 -0500 > From: David Fawcett > To: PostGIS Users Discussion > Subject: Re: [postgis-users] Using string variables with PGScript > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Bob, > > I haven't ever used PGScript, but I wonder one of the postgres quote > functions found on this page might work: > http://www.postgresql.org/docs/9.1/static/functions-string.html > > I would try quote_literal() > > David. > > On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > wrote: > >> I am having trouble using a variable in a Select statement, using >> PGScript. I am trying to define a string variable, then use it in the >> Select statement. Something like this: >> >> >> >> DECLARE @MYSTRING; >> >> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a >> previous select >> >> >> >> SELECT * from mytable where myfield = @MYSTRING; >> >> >> >> -The variable is not quoted, so the select statement fails. How do I get >> the string variable to be enclosed in quotes? >> >> >> >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Thu, 24 Sep 2015 15:22:42 +0200 > From: Birgit Laggner > To: postgis-users at lists.osgeo.org > Subject: Re: [postgis-users] Using string variables with PGScript > Message-ID: <5603F922.4090801 at ti.bund.de> > Content-Type: text/plain; charset="windows-1252"; Format="flowed" > > Hi Bob, > > I would recommend something as simple as > > SELECT * from mytable where myfield = '@MYSTRING'; > > I tried using a string variable in a PGScript once, too, and if I > remember correctly, quote_literal() did not work. > > Good luck and regards, > > Birgit > > > > > Am 24.09.2015 um 03:43 schrieb David Fawcett: >> Bob, >> >> I haven't ever used PGScript, but I wonder one of the postgres quote >> functions found on this page might work: >> http://www.postgresql.org/docs/9.1/static/functions-string.html >> >> I would try quote_literal() >> >> David. >> >> On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob > > wrote: >> >> I am having trouble using a variable in a Select statement, using >> PGScript. I am trying to define a string variable, then use it in >> the Select statement. Something like this: >> >> DECLARE @MYSTRING; >> >> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was >> set from a previous select >> >> SELECT * from mytable where myfield = @MYSTRING; >> >> -The variable is not quoted, so the select statement fails. How >> do I get the string variable to be enclosed in quotes? >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > End of postgis-users Digest, Vol 163, Issue 11 > ********************************************** > From Bob.Bistrais at maine.gov Mon Sep 28 13:05:38 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Mon, 28 Sep 2015 20:05:38 +0000 Subject: [postgis-users] Need to combine several multilinestrings into one Message-ID: I am trying to create one multilinestring from several multilinestrings. These are the geom results from a pgRouting query: SELECT pt.geom FROM pgr_dijkstra( 'SELECT gid AS id, sourceroute::integer as source, targetroute::integer as target, (feet / 5280)::double precision AS cost, feet::double precision as reverse_cost FROM ngrdsaroo2',2465,1713,false,true) as di JOIN ngrdsaroo2 pt on di.id2 = pt.gid -This returns many rows of multilinesting geometry. I want to combine these into one geometry, so that I can save it as a route for display. I've tried ST_Union, ST_LineMerge, and others, but can't seem to get anything to work, I keep getting errors. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Bistrais at maine.gov Mon Sep 28 13:46:30 2015 From: Bob.Bistrais at maine.gov (Bistrais, Bob) Date: Mon, 28 Sep 2015 20:46:30 +0000 Subject: [postgis-users] Problem updating geometry in a record Message-ID: I have been able to derive a geometry from a query. I want to insert that geometry into a Multilinestring field. I have some SQL code to do it. When I run the code, the output say that the query was successful. But I don't see the geometry inserted into the table. Here is the code: update highschools_aroo set routegeom = (SELECT ST_Union(geom) as mygeom from (SELECT pt.geom FROM pgr_dijkstra( 'SELECT gid AS id, sourceroute::integer as source, targetroute::integer as target, (feet / 5280)::double precision AS cost, feet::double precision as reverse_cost FROM ngrdsaroo2',2465,1713,false,true) as di JOIN ngrdsaroo2 pt on di.id2 = pt.gid) as foo) WHERE source_node = 2465 and target_node = 1713; -As mentioned, this runs with no errors, but the geometry field is not updated. Any suggestions? Thanks, Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgit.laggner at ti.bund.de Mon Sep 28 23:54:47 2015 From: birgit.laggner at ti.bund.de (Birgit Laggner) Date: Tue, 29 Sep 2015 08:54:47 +0200 Subject: [postgis-users] postgis-users Digest, Vol 163, Issue 11 In-Reply-To: References: <5608F409.9040204@ti.bund.de> Message-ID: <560A35B7.7010604@ti.bund.de> Hi Bob, you are right. What a mess... Now I tried using the quote_literal() which worked for the select statement: declare @v; set @v = '1'; SELECT * from gradeschools_aroo where gradecode = quote_literal(@v); So, it all comes down to Davids suggestion from the beginning. But the quote_literal() won't work if not used in a SELECT statement. Regards, Birgit Am 28.09.2015 um 22:01 schrieb Bistrais, Bob: > Hello Birgit, > > I tried triple quoting my value as suggested. This works in the simple script. But when I try using it in a Select statement, it fails: > > declare @v; > set @v = '''1'''; > SELECT * from gradeschools_aroo where gradecode = @v; > > SELECT * from gradeschools_aroo where gradecode = ''1'' > ERROR: syntax error at or near "1" > > > -----Original Message----- > From: Birgit Laggner [mailto:birgit.laggner at ti.bund.de] > Sent: Monday, September 28, 2015 4:02 AM > To: Bistrais, Bob; postgis-users at lists.osgeo.org; david.fawcett at gmail.com > Subject: Re: postgis-users Digest, Vol 163, Issue 11 > > Hi Bob, > > now, I understand your problem. My suggestion would be to triple the single quotation marks as in the small example below: > > > declare @v; > > set @v = '''1'''; > > print @v; > > > I hope this works with your pgscript somehow... > > Regards, > > Birgit > > > Am 25.09.2015 um 14:19 schrieb Bistrais, Bob: >> Hi Birgit and David, >> >> Many thanks for your replies. I actually tried what you had suggested. Quoting the variable as '@myvariable' caused the liteal string, @myvariable, to be passed. I also tried casting, but the variable still got passed as an integer, without quots, causing an error. >> >> In order to make it work, I created another field which is an integer field. I populated the new field with the appropriate integer values. This worked, but I would still be interested in finding a way to pas numeric characters as text. >> >> >> >> ________________________________________ >> From: postgis-users-bounces at lists.osgeo.org [postgis-users-bounces at lists.osgeo.org] on behalf of postgis-users-request at lists.osgeo.org [postgis-users-request at lists.osgeo.org] >> Sent: Thursday, September 24, 2015 3:00 PM >> To: postgis-users at lists.osgeo.org >> Subject: postgis-users Digest, Vol 163, Issue 11 >> >> Send postgis-users mailing list submissions to >> postgis-users at lists.osgeo.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> or, via email, send a message with subject or body 'help' to >> postgis-users-request at lists.osgeo.org >> >> You can reach the person managing the list at >> postgis-users-owner at lists.osgeo.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of postgis-users digest..." >> >> >> Today's Topics: >> >> 1. Using string variables with PGScript (Bistrais, Bob) >> 2. Re: Using string variables with PGScript (David Fawcett) >> 3. Re: Using string variables with PGScript (Birgit Laggner) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Wed, 23 Sep 2015 21:26:32 +0000 >> From: "Bistrais, Bob" >> To: "postgis-users at lists.osgeo.org" >> Subject: [postgis-users] Using string variables with PGScript >> Message-ID: >> >> >> Content-Type: text/plain; charset="us-ascii" >> >> I am having trouble using a variable in a Select statement, using PGScript. I am trying to define a string variable, then use it in the Select statement. Something like this: >> >> DECLARE @MYSTRING; >> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a previous select >> >> SELECT * from mytable where myfield = @MYSTRING; >> >> -The variable is not quoted, so the select statement fails. How do I get the string variable to be enclosed in quotes? >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 2 >> Date: Wed, 23 Sep 2015 20:43:30 -0500 >> From: David Fawcett >> To: PostGIS Users Discussion >> Subject: Re: [postgis-users] Using string variables with PGScript >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> Bob, >> >> I haven't ever used PGScript, but I wonder one of the postgres quote >> functions found on this page might work: >> http://www.postgresql.org/docs/9.1/static/functions-string.html >> >> I would try quote_literal() >> >> David. >> >> On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob >> wrote: >> >>> I am having trouble using a variable in a Select statement, using >>> PGScript. I am trying to define a string variable, then use it in the >>> Select statement. Something like this: >>> >>> >>> >>> DECLARE @MYSTRING; >>> >>> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was set from a >>> previous select >>> >>> >>> >>> SELECT * from mytable where myfield = @MYSTRING; >>> >>> >>> >>> -The variable is not quoted, so the select statement fails. How do I get >>> the string variable to be enclosed in quotes? >>> >>> >>> >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at lists.osgeo.org >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >>> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 24 Sep 2015 15:22:42 +0200 >> From: Birgit Laggner >> To: postgis-users at lists.osgeo.org >> Subject: Re: [postgis-users] Using string variables with PGScript >> Message-ID: <5603F922.4090801 at ti.bund.de> >> Content-Type: text/plain; charset="windows-1252"; Format="flowed" >> >> Hi Bob, >> >> I would recommend something as simple as >> >> SELECT * from mytable where myfield = '@MYSTRING'; >> >> I tried using a string variable in a PGScript once, too, and if I >> remember correctly, quote_literal() did not work. >> >> Good luck and regards, >> >> Birgit >> >> >> >> >> Am 24.09.2015 um 03:43 schrieb David Fawcett: >>> Bob, >>> >>> I haven't ever used PGScript, but I wonder one of the postgres quote >>> functions found on this page might work: >>> http://www.postgresql.org/docs/9.1/static/functions-string.html >>> >>> I would try quote_literal() >>> >>> David. >>> >>> On Wed, Sep 23, 2015 at 4:26 PM, Bistrais, Bob >> > wrote: >>> >>> I am having trouble using a variable in a Select statement, using >>> PGScript. I am trying to define a string variable, then use it in >>> the Select statement. Something like this: >>> >>> DECLARE @MYSTRING; >>> >>> SET @MYSTRING = CAST(@REC[0]['mycode'] AS STRING); -- at REC was >>> set from a previous select >>> >>> SELECT * from mytable where myfield = @MYSTRING; >>> >>> -The variable is not quoted, so the select statement fails. How >>> do I get the string variable to be enclosed in quotes? >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at lists.osgeo.org >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >>> >>> >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at lists.osgeo.org >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> >> End of postgis-users Digest, Vol 163, Issue 11 >> ********************************************** >> > > From birgit.laggner at ti.bund.de Tue Sep 29 00:00:22 2015 From: birgit.laggner at ti.bund.de (Birgit Laggner) Date: Tue, 29 Sep 2015 09:00:22 +0200 Subject: [postgis-users] Problem updating geometry in a record In-Reply-To: References: Message-ID: <560A3706.7000904@ti.bund.de> Hi Bob, I had the problem sometimes that st_union() result was NULL. Perhaps that's the case with your query, too? Is it necessary to use st_union()? Otherwise you could replace it with st_collect(), if you just want to collect all geometries into a multilinestring. That's more robust because no geoprocessing is needed... Regards, Birgit Am 28.09.2015 um 22:46 schrieb Bistrais, Bob: > > I have been able to derive a geometry from a query. I want to insert > that geometry into a Multilinestring field. I have some SQL code to > do it. When I run the code, the output say that the query was > successful. But I don?t see the geometry inserted into the table. > Here is the code: > > update highschools_aroo set routegeom = > > (SELECT ST_Union(geom) as mygeom from (SELECT pt.geom > > FROM pgr_dijkstra( > > 'SELECT gid AS id, > > sourceroute::integer as source, > > targetroute::integer as target, > > (feet / 5280)::double precision AS cost, > > feet::double precision as reverse_cost > > FROM ngrdsaroo2',2465,1713,false,true) > > as di > > JOIN ngrdsaroo2 pt on di.id2 = pt.gid) as foo) > > WHERE source_node = 2465 and target_node = 1713; > > -As mentioned, this runs with no errors, but the geometry field is not > updated. Any suggestions? > > > Thanks, > > Bob > > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.ribot at gmail.com Tue Sep 29 02:00:45 2015 From: nicolas.ribot at gmail.com (Nicolas Ribot) Date: Tue, 29 Sep 2015 11:00:45 +0200 Subject: [postgis-users] Need to combine several multilinestrings into one In-Reply-To: References: Message-ID: Hello, Use st_collect(pt.geom) Nicolas On 28 September 2015 at 22:05, Bistrais, Bob wrote: > I am trying to create one multilinestring from several multilinestrings. > These are the geom results from a pgRouting query: > > > > SELECT pt.geom > > FROM pgr_dijkstra( > > 'SELECT gid AS id, > > sourceroute::integer as > source, > > targetroute::integer as > target, > > (feet / 5280)::double > precision AS cost, > > feet::double precision as > reverse_cost > > FROM > ngrdsaroo2',2465,1713,false,true) > > as di > > JOIN ngrdsaroo2 pt on > di.id2 = pt.gid > > > > -This returns many rows of multilinesting geometry. I want to combine > these into one geometry, so that I can save it as a route for display. > I?ve tried ST_Union, ST_LineMerge, and others, but can?t seem to get > anything to work, I keep getting errors. > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zebekias at gmail.com Tue Sep 29 03:17:51 2015 From: zebekias at gmail.com (Kiriakos Georgiou) Date: Tue, 29 Sep 2015 13:17:51 +0300 Subject: [postgis-users] Is 2.1.8 stable? Message-ID: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> Hello, We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit PostgreSQL 9.4.4 + PostGIS 2.1.8. All the required packages for PostGIS were upgraded to their latest versions. This is on Solaris 10 with the gcc that ships by sun (v3.x) All went well, except when we did regression testing we noticed a complex spatial query that goes from geometry to geography and back (with SRID changes along the way) was crashing PostgreSQL. We broke down that code to simpler pieces and it worked, but later we found other code that worked before that would crash the database backend process too. Unfortunately our application is complex to the point that we haven't been able to distill the query down to something simple that I can open a ticket with. All I have are core dumps and my hunch that downgrading PostGIS might give some clues (if things go back to being stable.) Any experiences with 2.1.8 with regards to stability that you can share? We haven't tested 2.1.5, I'll update on how that goes. Regards, Kiriakos From caritj at gmail.com Tue Sep 29 07:52:01 2015 From: caritj at gmail.com (Paul J. Caritj) Date: Tue, 29 Sep 2015 10:52:01 -0400 Subject: [postgis-users] Is 2.1.8 stable? In-Reply-To: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> References: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> Message-ID: My 2 cents.: My recent [bad] experience with a Postgis bug, described in my email to this list last week, was on 2.1.8 (but running on Windows 7, not Solaris). Fortunately for me, I was just using it to do a little GIS hacking on my desktop. But after my experiences of the last few weeks, it would take a lot of convincing to get me to use Postgis 2.1.8 in a production environment. (Although, supposedly, the bug I encountered was also present in 2.1.2, so YMMV.) -Paul On Tue, Sep 29, 2015 at 6:17 AM, Kiriakos Georgiou wrote: > Hello, > > We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit > PostgreSQL 9.4.4 + PostGIS 2.1.8. All the required packages for PostGIS > were upgraded to their latest versions. This is on Solaris 10 with the gcc > that ships by sun (v3.x) > > All went well, except when we did regression testing we noticed a complex > spatial query that goes from geometry to geography and back (with SRID > changes along the way) was crashing PostgreSQL. We broke down that code to > simpler pieces and it worked, but later we found other code that worked > before that would crash the database backend process too. > > Unfortunately our application is complex to the point that we haven't been > able to distill the query down to something simple that I can open a ticket > with. All I have are core dumps and my hunch that downgrading PostGIS might > give some clues (if things go back to being stable.) > > Any experiences with 2.1.8 with regards to stability that you can share? > We haven't tested 2.1.5, I'll update on how that goes. > > Regards, > Kiriakos > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From strk at keybit.net Tue Sep 29 08:05:05 2015 From: strk at keybit.net (Sandro Santilli) Date: Tue, 29 Sep 2015 17:05:05 +0200 Subject: [postgis-users] Is 2.1.8 stable? In-Reply-To: References: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> Message-ID: <20150929150505.GA15803@localhost> Paul, that ticket is supposedly fixed in the 2.1 branch: https://trac.osgeo.org/postgis/ticket/2543 Kiriakos, the 2.1 branch is the current stable line, if you have a way to reproduce that crash it'll be very useful to fix it for 2.1.9 . --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html On Tue, Sep 29, 2015 at 10:52:01AM -0400, Paul J. Caritj wrote: > My 2 cents.: > > My recent [bad] experience with a Postgis bug, described in my email to > this list last week, was on 2.1.8 (but running on Windows 7, not Solaris). > Fortunately for me, I was just using it to do a little GIS hacking on my > desktop. But after my experiences of the last few weeks, it would take a > lot of convincing to get me to use Postgis 2.1.8 in a production > environment. (Although, supposedly, the bug I encountered was also present > in 2.1.2, so YMMV.) > > -Paul > > On Tue, Sep 29, 2015 at 6:17 AM, Kiriakos Georgiou > wrote: > > > Hello, > > > > We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit > > PostgreSQL 9.4.4 + PostGIS 2.1.8. All the required packages for PostGIS > > were upgraded to their latest versions. This is on Solaris 10 with the gcc > > that ships by sun (v3.x) > > > > All went well, except when we did regression testing we noticed a complex > > spatial query that goes from geometry to geography and back (with SRID > > changes along the way) was crashing PostgreSQL. We broke down that code to > > simpler pieces and it worked, but later we found other code that worked > > before that would crash the database backend process too. > > > > Unfortunately our application is complex to the point that we haven't been > > able to distill the query down to something simple that I can open a ticket > > with. All I have are core dumps and my hunch that downgrading PostGIS might > > give some clues (if things go back to being stable.) > > > > Any experiences with 2.1.8 with regards to stability that you can share? > > We haven't tested 2.1.5, I'll update on how that goes. > > > > Regards, > > Kiriakos From pella.samu at gmail.com Tue Sep 29 08:14:50 2015 From: pella.samu at gmail.com (Imre Samu) Date: Tue, 29 Sep 2015 17:14:50 +0200 Subject: [postgis-users] Is 2.1.8 stable? In-Reply-To: References: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> Message-ID: >We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit PostgreSQL 9.4.4 > ...was crashing PostgreSQL. 64bit Postgresql 9.4 is very strange on Solaris 7 and older. "15.7.6.4. 64-bit Build Sometimes Crashes" "On Solaris 7 and older, the 64-bit version of libc has a buggy vsnprintf routine, which leads to erratic core dumps in PostgreSQL. The simplest known workaround is .... " > http://www.postgresql.org/docs/9.4/static/installation-platform-notes.html Maybe this is related to (postgis) vsnprintf ? https://github.com/postgis/postgis/search?q=vsnprintf Regards, Imre 2015-09-29 16:52 GMT+02:00 Paul J. Caritj : > My 2 cents.: > > My recent [bad] experience with a Postgis bug, described in my email to > this list last week, was on 2.1.8 (but running on Windows 7, not Solaris). > Fortunately for me, I was just using it to do a little GIS hacking on my > desktop. But after my experiences of the last few weeks, it would take a > lot of convincing to get me to use Postgis 2.1.8 in a production > environment. (Although, supposedly, the bug I encountered was also present > in 2.1.2, so YMMV.) > > -Paul > > On Tue, Sep 29, 2015 at 6:17 AM, Kiriakos Georgiou > wrote: > >> Hello, >> >> We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit >> PostgreSQL 9.4.4 + PostGIS 2.1.8. All the required packages for PostGIS >> were upgraded to their latest versions. This is on Solaris 10 with the gcc >> that ships by sun (v3.x) >> >> All went well, except when we did regression testing we noticed a >> complex spatial query that goes from geometry to geography and back (with >> SRID changes along the way) was crashing PostgreSQL. We broke down that >> code to simpler pieces and it worked, but later we found other code that >> worked before that would crash the database backend process too. >> >> Unfortunately our application is complex to the point that we haven't >> been able to distill the query down to something simple that I can open a >> ticket with. All I have are core dumps and my hunch that downgrading >> PostGIS might give some clues (if things go back to being stable.) >> >> Any experiences with 2.1.8 with regards to stability that you can share? >> We haven't tested 2.1.5, I'll update on how that goes. >> >> Regards, >> Kiriakos >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zebekias at gmail.com Tue Sep 29 14:08:45 2015 From: zebekias at gmail.com (Kiriakos Georgiou) Date: Wed, 30 Sep 2015 00:08:45 +0300 Subject: [postgis-users] Is 2.1.8 stable? In-Reply-To: References: <2974EB2E-C766-48C8-BD56-A59E4835CEBB@gmail.com> Message-ID: Thanks so much! I rebuilt PostgreSQL 9.4.4 + PostGIS 2.1.8 with the Solaris 64bit libc vsnprintf workaround, and I?m keeping my fingers crossed that we don?t see crashes again during regression testing. thanks again, Kiriakos > On Sep 29, 2015, at 6:14 PM, Imre Samu wrote: > > >We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit PostgreSQL 9.4.4 > > ...was crashing PostgreSQL. > > 64bit Postgresql 9.4 is very strange on Solaris 7 and older. > "15.7.6.4. 64-bit Build Sometimes Crashes" > "On Solaris 7 and older, the 64-bit version of libc has a buggy vsnprintf routine, which leads to erratic core dumps in PostgreSQL. The simplest known workaround is .... " > http://www.postgresql.org/docs/9.4/static/installation-platform-notes.html > > Maybe this is related to (postgis) vsnprintf ? https://github.com/postgis/postgis/search?q=vsnprintf > > Regards, > Imre > > > > 2015-09-29 16:52 GMT+02:00 Paul J. Caritj >: > My 2 cents.: > > My recent [bad] experience with a Postgis bug, described in my email to this list last week, was on 2.1.8 (but running on Windows 7, not Solaris). Fortunately for me, I was just using it to do a little GIS hacking on my desktop. But after my experiences of the last few weeks, it would take a lot of convincing to get me to use Postgis 2.1.8 in a production environment. (Although, supposedly, the bug I encountered was also present in 2.1.2, so YMMV.) > > -Paul > > On Tue, Sep 29, 2015 at 6:17 AM, Kiriakos Georgiou > wrote: > Hello, > > We recently upgraded from 32bit PostgreSQL 9.3.4 + PostGIS 2.1.2 to 64bit PostgreSQL 9.4.4 + PostGIS 2.1.8. All the required packages for PostGIS were upgraded to their latest versions. This is on Solaris 10 with the gcc that ships by sun (v3.x) > > All went well, except when we did regression testing we noticed a complex spatial query that goes from geometry to geography and back (with SRID changes along the way) was crashing PostgreSQL. We broke down that code to simpler pieces and it worked, but later we found other code that worked before that would crash the database backend process too. > > Unfortunately our application is complex to the point that we haven't been able to distill the query down to something simple that I can open a ticket with. All I have are core dumps and my hunch that downgrading PostGIS might give some clues (if things go back to being stable.) > > Any experiences with 2.1.8 with regards to stability that you can share? We haven't tested 2.1.5, I'll update on how that goes. > > Regards, > Kiriakos > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From dharshan4help at gmail.com Tue Sep 29 21:59:00 2015 From: dharshan4help at gmail.com (Dharshan Bharathur) Date: Wed, 30 Sep 2015 10:29:00 +0530 Subject: [postgis-users] [Question] Point returned in ST_LineLocatePoint and ST_ClosestPoint is not able to detect in ST_Contains Message-ID: Hi all, Need experts advice. This is the same question I have asked here. I am using postgis's ST_LineLocatePoint to find out the closest point on a LineString to the given Point, and using ST_LineInterpolatePoint to extract a Point from the returned float number.(as referred here ) This is my ST_LineLocatePoint Query SELECT ST_AsText(ST_LineInterpolatePoint(foo.the_line, ST_LineLocatePoint(foo.the_line,ST_GeomFromText('POINT(12.962315 77.584841)')))) AS g FROM (SELECT ST_GeomFromText('LINESTRING(12.96145 77.58408,12.96219 77.58447,12.96302 77.58489,12.96316 77.58496,12.96348 77.58511)') AS the_line) AS foo; Output: g ------------------------------------------ POINT(12.9624389808159 77.5845959902924) Which exactly lies on the linestring I have passed. Demonstration is displayed here . query with St_Closest function also returns the same points. But when I check whether this point lies in the same linestring using ST_Contains it always return false, even though the point lies within. My ST_Contains Query: SELECT ST_Contains(ST_GeomFromText('LINESTRING(12.96145 77.58408,12.96219 77.58447,12.96302 77.58489, 12.96316 77.58496, 12.96348 77.58511)'), ST_GeomFromText('POINT(12.9624389808159 77.5845959902924)')); Output: st_contains ------------- f I am not getting where I am doing wrong, why I am getting false. Can anyone help me in this. I am using Postgresql : 9.4, postgis : 2.1 *Thanks & RegardsDharshan* -------------- next part -------------- An HTML attachment was scrubbed... URL: From pramsey at cleverelephant.ca Wed Sep 30 05:24:45 2015 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Wed, 30 Sep 2015 05:24:45 -0700 Subject: [postgis-users] [Question] Point returned in ST_LineLocatePoint and ST_ClosestPoint is not able to detect in ST_Contains In-Reply-To: References: Message-ID: Unfortunately, due to the vagaries of the IEEE double precision grid, your constructed point probably does not like *exactly* on your line, but ever-so-slightly off. Try testing instead for ST_DWithin(line, point, 0.00001) or something and it should work better. P On Tue, Sep 29, 2015 at 9:59 PM, Dharshan Bharathur wrote: > Hi all, Need experts advice. > > This is the same question I have asked here. > > I am using postgis's ST_LineLocatePoint to find out the closest point on a > LineString to the given Point, and using ST_LineInterpolatePoint to extract > a Point from the returned float number.(as referred here) > > This is my ST_LineLocatePoint Query > > SELECT ST_AsText(ST_LineInterpolatePoint(foo.the_line, > ST_LineLocatePoint(foo.the_line,ST_GeomFromText('POINT(12.962315 > 77.584841)')))) AS g FROM (SELECT > ST_GeomFromText('LINESTRING(12.96145 > 77.58408,12.96219 77.58447,12.96302 77.58489,12.96316 > 77.58496,12.96348 > 77.58511)') AS the_line) AS foo; > > > Output: > > g > ------------------------------------------ > POINT(12.9624389808159 77.5845959902924) > > Which exactly lies on the linestring I have passed. Demonstration is > displayed here. > > > query with St_Closest function also returns the same points. > > But when I check whether this point lies in the same linestring using > ST_Contains it always return false, even though the point lies within. > > My ST_Contains Query: > > SELECT ST_Contains(ST_GeomFromText('LINESTRING(12.96145 77.58408,12.96219 > 77.58447,12.96302 77.58489, 12.96316 77.58496, 12.96348 > 77.58511)'),ST_GeomFromText('POINT(12.9624389808159 77.5845959902924)')); > > Output: > > st_contains > ------------- > f > > I am not getting where I am doing wrong, why I am getting false. Can anyone > help me in this. > > > I am using Postgresql : 9.4, postgis : 2.1 > > > > > Thanks & Regards > Dharshan > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From dharshan4help at gmail.com Wed Sep 30 05:29:48 2015 From: dharshan4help at gmail.com (Dharshan Bharathur) Date: Wed, 30 Sep 2015 17:59:48 +0530 Subject: [postgis-users] [Question] Point returned in ST_LineLocatePoint and ST_ClosestPoint is not able to detect in ST_Contains In-Reply-To: References: Message-ID: Thanks for the reply, Yes, I tried with ST_DWithin and it is working fine now. But then, according to doc "closest point on LineString to the given Point" is wrong statement right? And in "ST_DWithin(line, point, 0.00001)" , 0.000001 is in meter? what is the least /last value we can use? *Thanks & RegardsDharshan* On Wed, Sep 30, 2015 at 5:54 PM, Paul Ramsey wrote: > Unfortunately, due to the vagaries of the IEEE double precision grid, > your constructed point probably does not like *exactly* on your line, > but ever-so-slightly off. Try testing instead for ST_DWithin(line, > point, 0.00001) or something and it should work better. > > P > > On Tue, Sep 29, 2015 at 9:59 PM, Dharshan Bharathur > wrote: > > Hi all, Need experts advice. > > > > This is the same question I have asked here. > > > > I am using postgis's ST_LineLocatePoint to find out the closest point on > a > > LineString to the given Point, and using ST_LineInterpolatePoint to > extract > > a Point from the returned float number.(as referred here) > > > > This is my ST_LineLocatePoint Query > > > > SELECT ST_AsText(ST_LineInterpolatePoint(foo.the_line, > > ST_LineLocatePoint(foo.the_line,ST_GeomFromText('POINT(12.962315 > > 77.584841)')))) AS g FROM (SELECT > > ST_GeomFromText('LINESTRING(12.96145 > > 77.58408,12.96219 77.58447,12.96302 77.58489,12.96316 > > 77.58496,12.96348 > > 77.58511)') AS the_line) AS foo; > > > > > > Output: > > > > g > > ------------------------------------------ > > POINT(12.9624389808159 77.5845959902924) > > > > Which exactly lies on the linestring I have passed. Demonstration is > > displayed here. > > > > > > query with St_Closest function also returns the same points. > > > > But when I check whether this point lies in the same linestring using > > ST_Contains it always return false, even though the point lies within. > > > > My ST_Contains Query: > > > > SELECT ST_Contains(ST_GeomFromText('LINESTRING(12.96145 77.58408,12.96219 > > 77.58447,12.96302 77.58489, 12.96316 77.58496, 12.96348 > > 77.58511)'),ST_GeomFromText('POINT(12.9624389808159 77.5845959902924)')); > > > > Output: > > > > st_contains > > ------------- > > f > > > > I am not getting where I am doing wrong, why I am getting false. Can > anyone > > help me in this. > > > > > > I am using Postgresql : 9.4, postgis : 2.1 > > > > > > > > > > Thanks & Regards > > Dharshan > > > > _______________________________________________ > > postgis-users mailing list > > postgis-users at lists.osgeo.org > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From senhor.neto at gmail.com Wed Sep 30 05:51:10 2015 From: senhor.neto at gmail.com (Alexandre Neto) Date: Wed, 30 Sep 2015 12:51:10 +0000 Subject: [postgis-users] [Question] Point returned in ST_LineLocatePoint and ST_ClosestPoint is not able to detect in ST_Contains In-Reply-To: References: Message-ID: The 0.00001 value is in your coordinate system units. From your example it's probably degrees and not meters. Alexandre Neto Em qua, 30 de set de 2015 ?s 13:29, Dharshan Bharathur < dharshan4help at gmail.com> escreveu: > Thanks for the reply, > > Yes, I tried with ST_DWithin and it is working fine now. > > But then, according to doc "closest point on LineString to the given > Point" is wrong statement right? > > And in "ST_DWithin(line, > point, 0.00001)" , 0.000001 is in meter? what is the least /last value we > can use? > > > > *Thanks & Regards* > > > *Dharshan* > > On Wed, Sep 30, 2015 at 5:54 PM, Paul Ramsey > wrote: > >> Unfortunately, due to the vagaries of the IEEE double precision grid, >> your constructed point probably does not like *exactly* on your line, >> but ever-so-slightly off. Try testing instead for ST_DWithin(line, >> point, 0.00001) or something and it should work better. >> >> P >> >> On Tue, Sep 29, 2015 at 9:59 PM, Dharshan Bharathur >> wrote: >> > Hi all, Need experts advice. >> > >> > This is the same question I have asked here. >> > >> > I am using postgis's ST_LineLocatePoint to find out the closest point >> on a >> > LineString to the given Point, and using ST_LineInterpolatePoint to >> extract >> > a Point from the returned float number.(as referred here) >> > >> > This is my ST_LineLocatePoint Query >> > >> > SELECT ST_AsText(ST_LineInterpolatePoint(foo.the_line, >> > >> ST_LineLocatePoint(foo.the_line,ST_GeomFromText('POINT(12.962315 >> > 77.584841)')))) AS g FROM (SELECT >> > ST_GeomFromText('LINESTRING(12.96145 >> > 77.58408,12.96219 77.58447,12.96302 77.58489,12.96316 >> > 77.58496,12.96348 >> > 77.58511)') AS the_line) AS foo; >> > >> > >> > Output: >> > >> > g >> > ------------------------------------------ >> > POINT(12.9624389808159 77.5845959902924) >> > >> > Which exactly lies on the linestring I have passed. Demonstration is >> > displayed here. >> > >> > >> > query with St_Closest function also returns the same points. >> > >> > But when I check whether this point lies in the same linestring using >> > ST_Contains it always return false, even though the point lies within. >> > >> > My ST_Contains Query: >> > >> > SELECT ST_Contains(ST_GeomFromText('LINESTRING(12.96145 >> 77.58408,12.96219 >> > 77.58447,12.96302 77.58489, 12.96316 77.58496, 12.96348 >> > 77.58511)'),ST_GeomFromText('POINT(12.9624389808159 >> 77.5845959902924)')); >> > >> > Output: >> > >> > st_contains >> > ------------- >> > f >> > >> > I am not getting where I am doing wrong, why I am getting false. Can >> anyone >> > help me in this. >> > >> > >> > I am using Postgresql : 9.4, postgis : 2.1 >> > >> > >> > >> > >> > Thanks & Regards >> > Dharshan >> > >> > _______________________________________________ >> > postgis-users mailing list >> > postgis-users at lists.osgeo.org >> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> _______________________________________________ >> postgis-users mailing list >> postgis-users at lists.osgeo.org >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >> > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From strk at keybit.net Wed Sep 30 06:03:49 2015 From: strk at keybit.net (Sandro Santilli) Date: Wed, 30 Sep 2015 15:03:49 +0200 Subject: [postgis-users] [Question] Point returned in ST_LineLocatePoint and ST_ClosestPoint is not able to detect in ST_Contains In-Reply-To: References: Message-ID: <20150930130349.GA8391@localhost> On Wed, Sep 30, 2015 at 05:59:48PM +0530, Dharshan Bharathur wrote: > Thanks for the reply, > > Yes, I tried with ST_DWithin and it is working fine now. > > But then, according to doc "closest point on LineString to the given Point" > is wrong statement right? Well, yes. It would be "closest representable point". I'm actually fighting with that right now here: https://trac.osgeo.org/postgis/ticket/3280 --strk; From guillaume.arnaud at cg82.fr Wed Sep 30 06:44:02 2015 From: guillaume.arnaud at cg82.fr (Guillaume ARNAUD (ancienne adresse)) Date: Wed, 30 Sep 2015 15:44:02 +0200 Subject: [postgis-users] =?utf-8?q?St=5Funion_with_group_by_faster?= Message-ID: <925378fde475dcbe4e5aef59512561be@cg82.fr> Hi all, I have a table in postgis which contains 6304 polygons. I need to make a view which union some of this polygon. I write this request : SELECT champ1, champ2, st_multi(st_union(geom))::geometry(MULTIPOLYGON, 2154) geom FROM table GROUP BY champ1, champ2, champ3, champ4, champ5 The request works 36 seconds and give me the results. I have created some index on champ1 and champ2. Have you a tip to get the request faster ? Thanks -- Guillaume ARNAUD Cellule SIGD Direction de l'Informatique Conseil D?partemental de Tarn-et-Garonne -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugues.francois at irstea.fr Wed Sep 30 06:57:02 2015 From: hugues.francois at irstea.fr (=?utf-8?Q?Fran=C3=A7ois_Hugues?=) Date: Wed, 30 Sep 2015 15:57:02 +0200 (CEST) Subject: [postgis-users] St_union with group by faster In-Reply-To: <925378fde475dcbe4e5aef59512561be@cg82.fr> References: <925378fde475dcbe4e5aef59512561be@cg82.fr> Message-ID: <82b199cf-b2f8-4a49-b6d1-41175a1bfaa3@email.android.com> An HTML attachment was scrubbed... URL: From pramsey at cleverelephant.ca Wed Sep 30 07:03:31 2015 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Wed, 30 Sep 2015 07:03:31 -0700 Subject: [postgis-users] St_union with group by faster In-Reply-To: <82b199cf-b2f8-4a49-b6d1-41175a1bfaa3@email.android.com> References: <925378fde475dcbe4e5aef59512561be@cg82.fr> <82b199cf-b2f8-4a49-b6d1-41175a1bfaa3@email.android.com> Message-ID: Indexes won't change anything, you're doing a full table scan. It's about as fast as it's going to get. Consider using a materialized view and just refreshing it on a schedule. On Wed, Sep 30, 2015 at 6:57 AM, Fran?ois Hugues wrote: > Hi, > > You're talking about index on attributes but did you use a gist index on > your geometries? > > Moreover, I'm not sure the casting is really useful but I don't know how > much it costs. > > HTH > > Hug > > Le 30 sept. 2015 3:50 PM, "Guillaume ARNAUD (ancienne adresse)" > a ?crit : > > Hi all, > > > I have a table in postgis which contains 6304 polygons. > > I need to make a view which union some of this polygon. > > I write this request : > > SELECT champ1, champ2, st_multi(st_union(geom))::geometry(MULTIPOLYGON, > 2154) geom > FROM table > GROUP BY champ1, champ2, champ3, champ4, champ5 > > The request works 36 seconds and give me the results. > > I have created some index on champ1 and champ2. > > Have you a tip to get the request faster ? > > Thanks > -- > Guillaume ARNAUD > Cellule SIGD > Direction de l'Informatique > Conseil D?partemental de Tarn-et-Garonne > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From lr at pcorp.us Wed Sep 30 21:26:48 2015 From: lr at pcorp.us (Paragon Corporation) Date: Thu, 1 Oct 2015 00:26:48 -0400 Subject: [postgis-users] St_union with group by faster In-Reply-To: References: <925378fde475dcbe4e5aef59512561be@cg82.fr> <82b199cf-b2f8-4a49-b6d1-41175a1bfaa3@email.android.com> Message-ID: <001301d0fc01$63848360$2a8d8a20$@pcorp.us> If you do a Materialized view and are using PostgreSQL 9.4, make sure to add a unique index on it and refresh with REFRESH MATERIALIZED VIEW COUNCURRENTLY That way your reads aren't blocked by building and might as well add a spatial index for faster spatial joins when used in queries So CREATE MATERIALIZED VIEW vw_mat_whatever AS SELECT champ1, champ2, st_multi(st_union(geom))::geometry(MULTIPOLYGON, 2154) AS geom FROM table GROUP BY champ1, champ2, champ3, champ4, champ5; CREATE UNIQUE INDEX idx_vw_mat_whatever ON vw_mat_whatever USING btree (champ1, champ2); CREATE INDEX idx_vw_mat_whatever_geom ON vw_mat_whatever USING gist(geom); -- then schedule a job to do this every so often -- REFRESH MATERIALIZED VIEW COUNCURRENTLY vw_mat_whatever; Hope that helps, Regina http://www.postgis.us http://postgis.net -----Original Message----- From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Paul Ramsey Sent: Wednesday, September 30, 2015 10:04 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] St_union with group by faster Indexes won't change anything, you're doing a full table scan. It's about as fast as it's going to get. Consider using a materialized view and just refreshing it on a schedule. On Wed, Sep 30, 2015 at 6:57 AM, Fran ois Hugues wrote: > Hi, > > You're talking about index on attributes but did you use a gist index > on your geometries? > > Moreover, I'm not sure the casting is really useful but I don't know > how much it costs. > > HTH > > Hug > > Le 30 sept. 2015 3:50 PM, "Guillaume ARNAUD (ancienne adresse)" > a crit : > > Hi all, > > > I have a table in postgis which contains 6304 polygons. > > I need to make a view which union some of this polygon. > > I write this request : > > SELECT champ1, champ2, > st_multi(st_union(geom))::geometry(MULTIPOLYGON, > 2154) geom > FROM table > GROUP BY champ1, champ2, champ3, champ4, champ5 > > The request works 36 seconds and give me the results. > > I have created some index on champ1 and champ2. > > Have you a tip to get the request faster ? > > Thanks > -- > Guillaume ARNAUD > Cellule SIGD > Direction de l'Informatique > Conseil D partemental de Tarn-et-Garonne > > > _______________________________________________ > postgis-users mailing list > postgis-users at lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users From Trang.Nguyen at inrix.com Wed Sep 30 22:27:41 2015 From: Trang.Nguyen at inrix.com (Trang Nguyen) Date: Thu, 1 Oct 2015 05:27:41 +0000 Subject: [postgis-users] Finding points of intersection of a linestring with another multiolygon and linestring Message-ID: <7BA3BA5B1126A649BF2B6E9A6C43B528E73152@COREXH11.inrix.corpnet.local> Hi forum, I have a LINESTRING represent the waypoints of a trip through road segments (LINESTRING) and zones (MULTIPOLYGON). For each segment and zone, I would like to find out the points in the waypoints which intersected the targeted zone/segment geometries. First and last intersection point into and exiting the zone or segment would the sufficient as well. I can use st_intersection to find the intersection each of waypoints to segment and zone geometries, but this returns a geometry that doesn't necessarily contain the subset of intersecting points in the linestring. The query will be run on large datasets, so performance is an important consideration. GIST indexes exist on all the geometries joined (zone_geom, segment_geom and waypoints). --------------------------- Query --------------------------- select st_transform(st_intersection(segment_geom, waypoints),4326) seg_wp_intersection, -- need subset of points in waypoints that intersected with segment_geom st_transform(st_intersection(zone_geom, waypoints),4326) zone_wp_intersection, -- need subset of points in waypoints that intersected with zone_geom trip_id, waypoints, zone_id, segment_id from od1.v_trip_zone_segment where startts>=TIMESTAMP '2015-01-16T12:20:29.000Z' and startts