From A.Strunck at gmx.net Tue Dec 1 00:58:32 2009 From: A.Strunck at gmx.net (Alexander Strunck) Date: Tue, 01 Dec 2009 09:58:32 +0100 Subject: [postgis-users] count points for every polygon Message-ID: <20091201085832.98760@gmx.net> hello i am new to postgis and sql. my problem is that i want to count the points that are in every polygon. the polygon table contains gid, id, geom. the points table contains id, geom. i found in the internet this sql > UPDATE polygon SET number_points = foo.count > FROM ( > SELECT polygon.name, count(point.gid) AS count > FROM point, polygon > WHERE ST_Contains(polygon.the_geom, point.the_geom) > GROUP BY polygon.name > ) AS foo > WHERE polygon.name = foo.name; but it don?t seem to work for me. Has anyone an idea how to make this work?? thx alex -- Endlich! Das Deb?t-Album von Pop-Diva Sarah Kreuz ist da! Jetzt bei GMX Musik Downloads. http://portal.gmx.net/de/go/musik01 From astrid.emde at wheregroup.com Tue Dec 1 01:23:38 2009 From: astrid.emde at wheregroup.com (Astrid Emde) Date: Tue, 1 Dec 2009 09:23:38 -0000 (UTC) Subject: [postgis-users] count points for every polygon In-Reply-To: <20091201085832.98760@gmx.net> References: <20091201085832.98760@gmx.net> Message-ID: <50777.93.89.10.129.1259659418.squirrel@troubadix.wheregroup.com> Hello Alexander, have a look at http://postgis.org/documentation/manual-1.4/ch07.html and try * ST_NumPoints - to get the Number of Points of a Linestring * ST_ExteriorRing - to get a linestring from your Polygon * if you have MULTIPOLYGONS you may need ST_NumGeometries, ST_GeometryN Best regards Astrid On Tue, December 1, 2009 8:58 am, Alexander Strunck wrote: > hello > > i am new to postgis and sql. my problem is that i want to count the > points that are in every polygon. the polygon table contains gid, id, > geom. the points table contains id, geom. i found in the internet this sql > >> UPDATE polygon SET number_points = foo.count >> FROM ( >> SELECT polygon.name, count(point.gid) AS count >> FROM point, polygon >> WHERE ST_Contains(polygon.the_geom, point.the_geom) >> GROUP BY polygon.name >> ) AS foo >> WHERE polygon.name = foo.name; >> > > but it don?t seem to work for me. > > Has anyone an idea how to make this work?? > > > thx > > alex -- > Endlich! Das Deb?t-Album von Pop-Diva Sarah Kreuz ist da! > Jetzt bei GMX Musik Downloads. http://portal.gmx.net/de/go/musik01 > _______________________________________________ > postgis-users mailing list postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From woodbri at swoodbridge.com Tue Dec 1 06:00:14 2009 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Tue, 01 Dec 2009 09:00:14 -0500 Subject: [postgis-users] merging linestrings between roadcrossings In-Reply-To: <200912010741.nB17fQkL028466@mail-core.space2u.com> References: <200912010741.nB17fQkL028466@mail-core.space2u.com> Message-ID: <4B15216E.9030806@swoodbridge.com> Nicklas Av?n wrote: > > Hallo > > I have a quite big dataset (approx 1.2 mill rows) with roads. What I > would like to to is merging all linestrings between crossings so I get > one linestring between two crossings or between a crossing and the end > of the road. Now there can be many small parts cut by a bridge or some > border. For quality I also have to check so no linestrings are just > passing a crossing too, but that is secondary because I don't think that > is a problem with this dataset. > > A while ago I saw a solution on this list which included merging all and > dumping, but I think that will be a little heavy in this case. > > I have been struggling some with recursive queries but I haven't found > the way. > How to do it? Nicklas, If I understand what you want correctly, the problem is probably best solved, by something like the following: 1) assign unique nodes to all segment end points and add start_node_id and end_node_id to all your edges. look at pgRouting this have code to do this already implemented. vertex_ids table uid, lat, lon 2) add a num_segments column to you unique node table 3) update vertex_ids set num_segments=(select count(*) from edges e where e.start_node_id=uid or e.end_node_id=uid); now num_segments will tell you what you need to know num_segments 0 - should not happen 1 - these are dead end streets 2 - these are joinable segments 3+ - these are crossing segments For the joinable segments create a new joined segment use the segments select * from edges where e.start_node_id= or e.end_node_id=; insert that, and delete the two old segments and fixup your node counts. -Steve From daniel.grum at unibw.de Tue Dec 1 06:21:59 2009 From: daniel.grum at unibw.de (Daniel Grum) Date: Tue, 01 Dec 2009 15:21:59 +0100 Subject: [postgis-users] merging linestrings between roadcrossings In-Reply-To: <4B15216E.9030806@swoodbridge.com> References: <200912010741.nB17fQkL028466@mail-core.space2u.com> <4B15216E.9030806@swoodbridge.com> Message-ID: <4B152687.40708@unibw.de> Stephen Woodbridge schrieb: > Nicklas Av?n wrote: >> >> Hallo >> >> I have a quite big dataset (approx 1.2 mill rows) with roads. What I >> would like to to is merging all linestrings between crossings so I >> get one linestring between two crossings or between a crossing and >> the end of the road. Now there can be many small parts cut by a >> bridge or some border. For quality I also have to check so no >> linestrings are just passing a crossing too, but that is secondary >> because I don't think that is a problem with this dataset. >> >> A while ago I saw a solution on this list which included merging all >> and dumping, but I think that will be a little heavy in this case. >> >> I have been struggling some with recursive queries but I haven't >> found the way. >> How to do it? > > Nicklas, > > If I understand what you want correctly, the problem is probably best > solved, by something like the following: > > 1) assign unique nodes to all segment end points and add start_node_id > and end_node_id to all your edges. look at pgRouting this have code to > do this already implemented. > > vertex_ids table > uid, lat, lon > > 2) add a num_segments column to you unique node table > 3) update vertex_ids set num_segments=(select count(*) from edges e > where e.start_node_id=uid or e.end_node_id=uid); > > now num_segments will tell you what you need to know > > num_segments > 0 - should not happen > 1 - these are dead end streets > 2 - these are joinable segments > 3+ - these are crossing segments > > For the joinable segments create a new joined segment use the segments > select * from edges > where e.start_node_id= > or e.end_node_id=; > > insert that, and delete the two old segments and fixup your node counts. > > -Steve > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > Hi I think I have the same problem! Are there any ideas how I can construct an SQL script that join streets-->merging linestrings that are not joined? So a user often build street, that endnodes are not joined with the other street. So, if the endnode is an a buffer to a digitized street-->the sql will join this line?! Is there a way to do this?! --daniel From woodbri at swoodbridge.com Tue Dec 1 07:06:50 2009 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Tue, 01 Dec 2009 10:06:50 -0500 Subject: [postgis-users] merging linestrings between roadcrossings In-Reply-To: <4B152687.40708@unibw.de> References: <200912010741.nB17fQkL028466@mail-core.space2u.com> <4B15216E.9030806@swoodbridge.com> <4B152687.40708@unibw.de> Message-ID: <4B15310A.4080609@swoodbridge.com> If you use the code from pgRouting to create the unique vertex ids you can assign a tolerance to use when matching nodes. then I would write a stored procedure to apply the test and rules that are appropriate to your data model. I don't have my postgis manual handy but there is a function the will allow you to merge two segments IIRC. If not it is pretty easy to extract the points of the two segments and create a new one combining the two sets. -Steve Daniel Grum wrote: > Stephen Woodbridge schrieb: >> Nicklas Av?n wrote: >>> >>> Hallo >>> >>> I have a quite big dataset (approx 1.2 mill rows) with roads. What I >>> would like to to is merging all linestrings between crossings so I >>> get one linestring between two crossings or between a crossing and >>> the end of the road. Now there can be many small parts cut by a >>> bridge or some border. For quality I also have to check so no >>> linestrings are just passing a crossing too, but that is secondary >>> because I don't think that is a problem with this dataset. >>> >>> A while ago I saw a solution on this list which included merging all >>> and dumping, but I think that will be a little heavy in this case. >>> >>> I have been struggling some with recursive queries but I haven't >>> found the way. >>> How to do it? >> >> Nicklas, >> >> If I understand what you want correctly, the problem is probably best >> solved, by something like the following: >> >> 1) assign unique nodes to all segment end points and add start_node_id >> and end_node_id to all your edges. look at pgRouting this have code to >> do this already implemented. >> >> vertex_ids table >> uid, lat, lon >> >> 2) add a num_segments column to you unique node table >> 3) update vertex_ids set num_segments=(select count(*) from edges e >> where e.start_node_id=uid or e.end_node_id=uid); >> >> now num_segments will tell you what you need to know >> >> num_segments >> 0 - should not happen >> 1 - these are dead end streets >> 2 - these are joinable segments >> 3+ - these are crossing segments >> >> For the joinable segments create a new joined segment use the segments >> select * from edges >> where e.start_node_id= >> or e.end_node_id=; >> >> insert that, and delete the two old segments and fixup your node counts. >> >> -Steve >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > Hi > > I think I have the same problem! > > Are there any ideas how I can construct an SQL script that join > streets-->merging linestrings that are not joined? > > So a user often build street, that endnodes are not joined with the > other street. So, if the endnode is an a buffer to a digitized > street-->the sql will join this line?! > > Is there a way to do this?! > > --daniel > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From nicklas.aven at jordogskog.no Tue Dec 1 07:21:45 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Tue, 1 Dec 2009 16:21:45 +0100 Subject: [postgis-users] merging linestrings between roadcrossings Message-ID: <200912011521.nB1FLj1b028503@mail-core.space2u.com> Hallo Stephen, thanks for answer I think I have been moving in the direction of your solution but with a little bit other approach. I don't want to modify my large table so I want to get some id (groupid) , identifying my new merged roads and then in the end merge them together to a new table. What I have got is a sql-query that seems to be working on smaller tables, but I have to run it over and over again until no more rows are affected. But it does about what you mentionwed Stephen if I get things right: update test set groupid = c.groupid from ( select max(groupid) as groupid , array_agg(groupid) as gidarray from ( select groupid, (st_dump(st_collect(startpoint(the_geom), endpoint(the_geom)))).geom as thepoint from ( select groupid, st_union(the_geom) as the_geom from test group by groupid ) a -- The lines unioned to not repeat the same thing again (this I guess is the weakest part ) b --All the start and end points group by thepoint having count(*) =2 ) c -- the highest of the included gids where test.groupid = any (gidarray) -- all roadparts in this array should get this highest gidvalue /Nicklas 2009-12-01 Stephen Woodbridge wrote: Nicklas Avén wrote: >> >> Hallo >> >> I have a quite big dataset (approx 1.2 mill rows) with roads. What I >> would like to to is merging all linestrings between crossings so I get >> one linestring between two crossings or between a crossing and the end >> of the road. Now there can be many small parts cut by a bridge or some >> border. For quality I also have to check so no linestrings are just >> passing a crossing too, but that is secondary because I don't think that >> is a problem with this dataset. >> >> A while ago I saw a solution on this list which included merging all and >> dumping, but I think that will be a little heavy in this case. >> >> I have been struggling some with recursive queries but I haven't found >> the way. >> How to do it? > >Nicklas, > >If I understand what you want correctly, the problem is probably best >solved, by something like the following: > >1) assign unique nodes to all segment end points and add start_node_id >and end_node_id to all your edges. look at pgRouting this have code to >do this already implemented. > >vertex_ids table >uid, lat, lon > >2) add a num_segments column to you unique node table >3) update vertex_ids set num_segments=(select count(*) from edges e >where e.start_node_id=uid or e.end_node_id=uid); > >now num_segments will tell you what you need to know > >num_segments > 0 - should not happen > 1 - these are dead end streets > 2 - these are joinable segments > 3+ - these are crossing segments > >For the joinable segments create a new joined segment use the segments > select * from edges > where e.start_node_id= > or e.end_node_id=; > >insert that, and delete the two old segments and fixup your node counts. > >-Steve >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.cave-ayland at siriusit.co.uk Tue Dec 1 07:46:39 2009 From: mark.cave-ayland at siriusit.co.uk (Mark Cave-Ayland) Date: Tue, 01 Dec 2009 15:46:39 +0000 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B13B585.50201@r3-gis.com> References: <4B13B585.50201@r3-gis.com> Message-ID: <4B153A5F.7070008@siriusit.co.uk> Peter Hopfgartner wrote: > Dear PostGIS devels, > > since we right in the middle of comparing interoperability of shape > files between some FOSS programs and ArcGIS, we encoutered also the > following: > > gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at ArcGIs > generated files, the max length for numbers is 19, compared to 20 for > integers and 32 for floating points as in pgsql2shp. This seems to be > confirmed by some Borland tools, when configured for dBase III+. > > Another limit seems to be that of text fields, that must be no longer > then 254. This is the maximum as given by ArcGIS and by the Borland tool. > > Another point is Boolean: ArcGIS seems to not allow the creation of > boolean fields and the Borland Tool ("Database Desktop") says that > Booleans have a length of 1. > > Regards, > > Peter Hi Peter, You've brought up some interesting points here. Can you actually clarify these changes with regard to parts of the official shapefile spec, or have they been found purely through experimentation? ATB, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs From warmerdam at pobox.com Tue Dec 1 08:11:45 2009 From: warmerdam at pobox.com (Frank Warmerdam) Date: Tue, 01 Dec 2009 11:11:45 -0500 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B153A5F.7070008@siriusit.co.uk> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> Message-ID: <4B154041.7000400@pobox.com> Mark Cave-Ayland wrote: > Hi Peter, > > You've brought up some interesting points here. Can you actually clarify > these changes with regard to parts of the official shapefile spec, or > have they been found purely through experimentation? Mark, I would note that the shapefile specification is essentially silent on the details of the .dbf file, apparently under the assumption that this is a well known format from other sources and does not need to be specified. Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent From peter.hopfgartner at r3-gis.com Tue Dec 1 08:28:09 2009 From: peter.hopfgartner at r3-gis.com (Peter Hopfgartner) Date: Tue, 01 Dec 2009 17:28:09 +0100 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B153A5F.7070008@siriusit.co.uk> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> Message-ID: <4B154419.2020805@r3-gis.com> Mark Cave-Ayland wrote: > Peter Hopfgartner wrote: > >> Dear PostGIS devels, >> >> since we right in the middle of comparing interoperability of shape >> files between some FOSS programs and ArcGIS, we encoutered also the >> following: >> >> gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at >> ArcGIs generated files, the max length for numbers is 19, compared to >> 20 for integers and 32 for floating points as in pgsql2shp. This >> seems to be confirmed by some Borland tools, when configured for >> dBase III+. >> >> Another limit seems to be that of text fields, that must be no longer >> then 254. This is the maximum as given by ArcGIS and by the Borland >> tool. >> >> Another point is Boolean: ArcGIS seems to not allow the creation of >> boolean fields and the Borland Tool ("Database Desktop") says that >> Booleans have a length of 1. >> >> Regards, >> >> Peter > > Hi Peter, > > You've brought up some interesting points here. Can you actually > clarify these changes with regard to parts of the official shapefile > spec, or have they been found purely through experimentation? > > > ATB, > > Mark. > Hi Mark, I do still have to figure out, if there are public specs for this. All I've found is, that attributes should be in data base files which are in dBase format (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). From the analysis of the file (and Wikipedia: http://en.wikipedia.org/wiki/Shapefile), it seems that this should be dBase III. I do not have any evidence that there is a public spec for dBase III. So all we did is basically gather some experimental data, where ArcGIS and gvSIG are our references. The first, because ESRI introduced the shape file format and gvSIG, because it is the desktop environment that we encourage our customers to use. Anyway, we have an old Borland/Inprise tool ("Database Desktop") here for managing dBase files and used it for our tests. Peter -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgartner at r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com ================================================================================ Venite a trovarci all'ASITA, dal 1 al 4 dicembre a Bari www.asita.it Besuchen Sie uns bei der Messe ASITA vom 1. bis 4. Dezember in Bari www.asita.it Visit us at ASITA, from 1st to 4th December in Bari www.asita.it ================================================================================ From chris.hermansen at timberline.ca Tue Dec 1 08:49:53 2009 From: chris.hermansen at timberline.ca (Chris Hermansen) Date: Tue, 01 Dec 2009 08:49:53 -0800 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B154419.2020805@r3-gis.com> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> <4B154419.2020805@r3-gis.com> Message-ID: <1259686193.1892.26.camel@temuko> Peter; The canonical description of DBase files seems to be http://www.clicketyclick.dk/databases/xbase/format/ On Tue, 2009-12-01 at 17:28 +0100, Peter Hopfgartner wrote: > Mark Cave-Ayland wrote: > > Peter Hopfgartner wrote: > > > >> Dear PostGIS devels, > >> > >> since we right in the middle of comparing interoperability of shape > >> files between some FOSS programs and ArcGIS, we encoutered also the > >> following: > >> > >> gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at > >> ArcGIs generated files, the max length for numbers is 19, compared to > >> 20 for integers and 32 for floating points as in pgsql2shp. This > >> seems to be confirmed by some Borland tools, when configured for > >> dBase III+. > >> > >> Another limit seems to be that of text fields, that must be no longer > >> then 254. This is the maximum as given by ArcGIS and by the Borland > >> tool. > >> > >> Another point is Boolean: ArcGIS seems to not allow the creation of > >> boolean fields and the Borland Tool ("Database Desktop") says that > >> Booleans have a length of 1. > >> > >> Regards, > >> > >> Peter > > > > Hi Peter, > > > > You've brought up some interesting points here. Can you actually > > clarify these changes with regard to parts of the official shapefile > > spec, or have they been found purely through experimentation? > > > > > > ATB, > > > > Mark. > > > Hi Mark, > > I do still have to figure out, if there are public specs for this. All > I've found is, that attributes should be in data base files which are in > dBase format > (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). From the > analysis of the file (and Wikipedia: > http://en.wikipedia.org/wiki/Shapefile), it seems that this should be > dBase III. I do not have any evidence that there is a public spec for > dBase III. > So all we did is basically gather some experimental data, where ArcGIS > and gvSIG are our references. The first, because ESRI introduced the > shape file format and gvSIG, because it is the desktop environment that > we encourage our customers to use. Anyway, we have an old > Borland/Inprise tool ("Database Desktop") here for managing dBase files > and used it for our tests. > > Peter > -- Regards, Chris Hermansen ? mailto:chris.hermansen at timberline.ca tel+1.604.714.2878 ? fax+1.604.733.0631 ? mob+1.778.840.4625 Timberline Natural Resource Group ? http://www.timberline.ca 401 ? 958 West 8th Avenue ? Vancouver BC ? Canada ? V5Z 1E5 From peter.hopfgartner at r3-gis.com Tue Dec 1 09:16:14 2009 From: peter.hopfgartner at r3-gis.com (Peter Hopfgartner) Date: Tue, 01 Dec 2009 18:16:14 +0100 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <1259686193.1892.26.camel@temuko> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> <4B154419.2020805@r3-gis.com> <1259686193.1892.26.camel@temuko> Message-ID: <4B154F5E.4030609@r3-gis.com> Chris Hermansen wrote: > Peter; > > The canonical description of DBase files seems to be > > http://www.clicketyclick.dk/databases/xbase/format/ > > Well, first of all, I do not know which dBase version is targeted by ArcGIS. Second, I doubt the exact values in http://www.clicketyclick.dk/databases/xbase/format/data_types.html#DATA_TYPES. From our tests, both dbase III and dBase IV can handle text fields <= 254 characters (and not < 254). Further, dBase III can handle numerics with <= 19 digits and not < 18 digits. dBase IV limits this to <= 20 digits. The above mentioned tool identifies ArcGIS generated files as dBase IV, in clear conflict on what is said in the above mentioned Wikipedia article. Cheers, Peter > On Tue, 2009-12-01 at 17:28 +0100, Peter Hopfgartner wrote: > >> Mark Cave-Ayland wrote: >> >>> Peter Hopfgartner wrote: >>> >>> >>>> Dear PostGIS devels, >>>> >>>> since we right in the middle of comparing interoperability of shape >>>> files between some FOSS programs and ArcGIS, we encoutered also the >>>> following: >>>> >>>> gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at >>>> ArcGIs generated files, the max length for numbers is 19, compared to >>>> 20 for integers and 32 for floating points as in pgsql2shp. This >>>> seems to be confirmed by some Borland tools, when configured for >>>> dBase III+. >>>> >>>> Another limit seems to be that of text fields, that must be no longer >>>> then 254. This is the maximum as given by ArcGIS and by the Borland >>>> tool. >>>> >>>> Another point is Boolean: ArcGIS seems to not allow the creation of >>>> boolean fields and the Borland Tool ("Database Desktop") says that >>>> Booleans have a length of 1. >>>> >>>> Regards, >>>> >>>> Peter >>>> >>> Hi Peter, >>> >>> You've brought up some interesting points here. Can you actually >>> clarify these changes with regard to parts of the official shapefile >>> spec, or have they been found purely through experimentation? >>> >>> >>> ATB, >>> >>> Mark. >>> >>> >> Hi Mark, >> >> I do still have to figure out, if there are public specs for this. All >> I've found is, that attributes should be in data base files which are in >> dBase format >> (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). From the >> analysis of the file (and Wikipedia: >> http://en.wikipedia.org/wiki/Shapefile), it seems that this should be >> dBase III. I do not have any evidence that there is a public spec for >> dBase III. >> So all we did is basically gather some experimental data, where ArcGIS >> and gvSIG are our references. The first, because ESRI introduced the >> shape file format and gvSIG, because it is the desktop environment that >> we encourage our customers to use. Anyway, we have an old >> Borland/Inprise tool ("Database Desktop") here for managing dBase files >> and used it for our tests. >> >> Peter >> >> > > > -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgartner at r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com ================================================================================ Venite a trovarci all'ASITA, dal 1 al 4 dicembre a Bari www.asita.it Besuchen Sie uns bei der Messe ASITA vom 1. bis 4. Dezember in Bari www.asita.it Visit us at ASITA, from 1st to 4th December in Bari www.asita.it ================================================================================ -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot-dbase-iii.dbf Type: application/x-dbf Size: 226 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot-dbase-iii.DBT Type: application/octet-stream Size: 4 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot-dbase-iii.png Type: image/png Size: 14427 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot-dbase-iv.dbf Type: application/x-dbf Size: 194 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot-dbase-iv.PNG Type: image/png Size: 14943 bytes Desc: not available URL: From gerry.creager at tamu.edu Tue Dec 1 09:30:27 2009 From: gerry.creager at tamu.edu (Gerald Creager) Date: Tue, 01 Dec 2009 11:30:27 -0600 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B154F5E.4030609@r3-gis.com> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> <4B154419.2020805@r3-gis.com> <1259686193.1892.26.camel@temuko> <4B154F5E.4030609@r3-gis.com> Message-ID: <4B1552B3.6030604@tamu.edu> My experience in the past (including some .dbf imports by several systems, including legaccy dBase IV, was that in fact, these are dB-IV .dbf's. The difference is small, as noted below, between v. III and v. IV. gerry Peter Hopfgartner wrote: > Chris Hermansen wrote: >> Peter; >> >> The canonical description of DBase files seems to be >> >> http://www.clicketyclick.dk/databases/xbase/format/ >> >> > Well, first of all, I do not know which dBase version is targeted by > ArcGIS. > > Second, I doubt the exact values in > http://www.clicketyclick.dk/databases/xbase/format/data_types.html#DATA_TYPES. > > > From our tests, both dbase III and dBase IV can handle text fields <= > 254 characters (and not < 254). > Further, dBase III can handle numerics with <= 19 digits and not < 18 > digits. dBase IV limits this to <= 20 digits. > > The above mentioned tool identifies ArcGIS generated files as dBase IV, > in clear conflict on what is said in the above mentioned Wikipedia article. > > Cheers, > > Peter >> On Tue, 2009-12-01 at 17:28 +0100, Peter Hopfgartner wrote: >> >>> Mark Cave-Ayland wrote: >>> >>>> Peter Hopfgartner wrote: >>>> >>>> >>>>> Dear PostGIS devels, >>>>> >>>>> since we right in the middle of comparing interoperability of shape >>>>> files between some FOSS programs and ArcGIS, we encoutered also the >>>>> following: >>>>> >>>>> gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at >>>>> ArcGIs generated files, the max length for numbers is 19, compared >>>>> to 20 for integers and 32 for floating points as in pgsql2shp. This >>>>> seems to be confirmed by some Borland tools, when configured for >>>>> dBase III+. >>>>> >>>>> Another limit seems to be that of text fields, that must be no >>>>> longer then 254. This is the maximum as given by ArcGIS and by the >>>>> Borland tool. >>>>> >>>>> Another point is Boolean: ArcGIS seems to not allow the creation of >>>>> boolean fields and the Borland Tool ("Database Desktop") says that >>>>> Booleans have a length of 1. >>>>> >>>>> Regards, >>>>> >>>>> Peter >>>>> >>>> Hi Peter, >>>> >>>> You've brought up some interesting points here. Can you actually >>>> clarify these changes with regard to parts of the official shapefile >>>> spec, or have they been found purely through experimentation? >>>> >>>> >>>> ATB, >>>> >>>> Mark. >>>> >>>> >>> Hi Mark, >>> >>> I do still have to figure out, if there are public specs for this. >>> All I've found is, that attributes should be in data base files which >>> are in dBase format >>> (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). From >>> the analysis of the file (and Wikipedia: >>> http://en.wikipedia.org/wiki/Shapefile), it seems that this should be >>> dBase III. I do not have any evidence that there is a public spec for >>> dBase III. >>> So all we did is basically gather some experimental data, where >>> ArcGIS and gvSIG are our references. The first, because ESRI >>> introduced the shape file format and gvSIG, because it is the desktop >>> environment that we encourage our customers to use. Anyway, we have >>> an old Borland/Inprise tool ("Database Desktop") here for managing >>> dBase files and used it for our tests. >>> >>> Peter >>> >>> >> >> >> > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From reid at umn.edu Tue Dec 1 12:35:23 2009 From: reid at umn.edu (Reid Priedhorsky) Date: Tue, 01 Dec 2009 14:35:23 -0600 Subject: [postgis-users] Cannot install 1.4.0 as non-root user Message-ID: <4B157E0B.4030606@umn.edu> Hi, We are currently running 1.3.5 and would like to upgrade to 1.4.0. However, we don't have root and thus the install fails (see bug #160, http://trac.osgeo.org/postgis/ticket/160). Bug #160 is marked WONTFIX. Are we stuck at 1.3.5 forever? Is there a workaround? Thanks, Reid From lr at pcorp.us Tue Dec 1 15:55:56 2009 From: lr at pcorp.us (Paragon Corporation) Date: Tue, 1 Dec 2009 18:55:56 -0500 Subject: [postgis-users] PostGIS 1.4.1rc2 and PostGIS 1.5.0 for windows In-Reply-To: <30fe546d0911281632r7aeaad78kdc761a15ffc67f3a@mail.gmail.com> References: <30fe546d0911281632r7aeaad78kdc761a15ffc67f3a@mail.gmail.com> Message-ID: For windows users wanting to try 1.4.1 rc2, we have these up compiled with GEOS 3.2.0 rc3 Also have fairly recent build of PostGIS 1.5 with new jazzy geography (Paul and Mark) and cool distance functions (ST_LongestLine, ST_MaxDistance, ShortestLine, ClosestPoint, improved ST_Distance and ST_Dwithin speed) (Thanks Nicklas Aven), GML/KML input functions -- GeomFromGML/KML (Thanks Olivier Courtin)) - :) http://www.postgis.org/documentation/manual-1.5SVN/ST_LongestLine.html You can get them here if you want to help us beta test before release http://www.postgis.org/download/windows/experimental.php Thanks, Leo and Regina -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul Ramsey Sent: Saturday, November 28, 2009 7:33 PM To: PostGIS Development Discussion; PostGIS Users Discussion Subject: [postgis-users] PostGIS 1.4.1rc2 There's a new release candidate available for testing at http://postgis.org/download/postgis-1.4.1rc2.tar.gz Please take it for a spin! P _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Tue Dec 1 22:49:25 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Tue, 01 Dec 2009 22:49:25 -0800 Subject: [postgis-users] Cannot install 1.4.0 as non-root user In-Reply-To: <4B157E0B.4030606@umn.edu> References: <4B157E0B.4030606@umn.edu> Message-ID: <4B160DF5.8010005@refractions.net> Hi Reid, I'm running Centos 5 and installing as non-root works fine for me. My steps are, as non-root: - install postgres, geos, and proj in my home directory. - update LD_LIBRARY_PATH to include the lib directories of each. - configure PostGIS, using --with-pgconfig, --with-geosconfig, --with-prodir - make and install PostGIS (which now only installs to the contrib directory in the postgres installation) Cheers, Kevin Reid Priedhorsky wrote: > Hi, > > We are currently running 1.3.5 and would like to upgrade to 1.4.0. > However, we don't have root and thus the install fails (see bug #160, > http://trac.osgeo.org/postgis/ticket/160). > > Bug #160 is marked WONTFIX. Are we stuck at 1.3.5 forever? Is there a > workaround? > > Thanks, > > Reid > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From nicklas.aven at jordogskog.no Wed Dec 2 00:01:29 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Wed, 2 Dec 2009 09:01:29 +0100 Subject: [postgis-users] PostGIS 1.4.1rc2 and PostGIS 1.5.0 for windows Message-ID: <200912020801.nB281Tdl030790@mail-core.space2u.com> Wow, what an artistic illustration to st_longestline :-) /Nicklas 2009-12-02 Paragon Corporation wrote: For windows users wanting to try 1.4.1 rc2, we have these up compiled with >GEOS 3.2.0 rc3 > > >Also have fairly recent build of PostGIS 1.5 with new jazzy geography (Paul >and Mark) and cool distance functions (ST_LongestLine, ST_MaxDistance, >ShortestLine, ClosestPoint, improved ST_Distance and ST_Dwithin speed) >(Thanks Nicklas Aven), GML/KML input functions -- GeomFromGML/KML (Thanks >Olivier Courtin)) - :) > >http://www.postgis.org/documentation/manual-1.5SVN/ST_LongestLine.html > >You can get them here if you want to help us beta test before release >http://www.postgis.org/download/windows/experimental.php > >Thanks, >Leo and Regina > >-----Original Message----- >From: postgis-users-bounces at postgis.refractions.net >[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul >Ramsey >Sent: Saturday, November 28, 2009 7:33 PM >To: PostGIS Development Discussion; PostGIS Users Discussion >Subject: [postgis-users] PostGIS 1.4.1rc2 > >There's a new release candidate available for testing at > >http://postgis.org/download/postgis-1.4.1rc2.tar.gz > >Please take it for a spin! > >P >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users > > > >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aigarsv at gmail.com Wed Dec 2 00:58:35 2009 From: aigarsv at gmail.com (Aigars V) Date: Wed, 2 Dec 2009 10:58:35 +0200 Subject: [postgis-users] Length of Bigint, Double and Text fields In-Reply-To: <4B1552B3.6030604@tamu.edu> References: <4B13B585.50201@r3-gis.com> <4B153A5F.7070008@siriusit.co.uk> <4B154419.2020805@r3-gis.com> <1259686193.1892.26.camel@temuko> <4B154F5E.4030609@r3-gis.com> <4B1552B3.6030604@tamu.edu> Message-ID: http://mixed.dans.knaw.nl/files/TI838D.txt 2009/12/1 Gerald Creager > My experience in the past (including some .dbf imports by several systems, > including legaccy dBase IV, was that in fact, these are dB-IV .dbf's. The > difference is small, as noted below, between v. III and v. IV. > > gerry > > Peter Hopfgartner wrote: > >> Chris Hermansen wrote: >> >>> Peter; >>> >>> The canonical description of DBase files seems to be >>> >>> http://www.clicketyclick.dk/databases/xbase/format/ >>> >>> >>> >> Well, first of all, I do not know which dBase version is targeted by >> ArcGIS. >> >> Second, I doubt the exact values in >> http://www.clicketyclick.dk/databases/xbase/format/data_types.html#DATA_TYPES. >> >> >> From our tests, both dbase III and dBase IV can handle text fields <= 254 >> characters (and not < 254). >> Further, dBase III can handle numerics with <= 19 digits and not < 18 >> digits. dBase IV limits this to <= 20 digits. >> >> The above mentioned tool identifies ArcGIS generated files as dBase IV, in >> clear conflict on what is said in the above mentioned Wikipedia article. >> >> Cheers, >> >> Peter >> >>> On Tue, 2009-12-01 at 17:28 +0100, Peter Hopfgartner wrote: >>> >>> >>>> Mark Cave-Ayland wrote: >>>> >>>> >>>>> Peter Hopfgartner wrote: >>>>> >>>>> >>>>> >>>>>> Dear PostGIS devels, >>>>>> >>>>>> since we right in the middle of comparing interoperability of shape >>>>>> files between some FOSS programs and ArcGIS, we encoutered also the >>>>>> following: >>>>>> >>>>>> gvSIG chokes on the Bigint as produced by pgsql2shp. Looking at ArcGIs >>>>>> generated files, the max length for numbers is 19, compared to 20 for >>>>>> integers and 32 for floating points as in pgsql2shp. This seems to be >>>>>> confirmed by some Borland tools, when configured for dBase III+. >>>>>> >>>>>> Another limit seems to be that of text fields, that must be no longer >>>>>> then 254. This is the maximum as given by ArcGIS and by the Borland tool. >>>>>> >>>>>> Another point is Boolean: ArcGIS seems to not allow the creation of >>>>>> boolean fields and the Borland Tool ("Database Desktop") says that Booleans >>>>>> have a length of 1. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Peter >>>>>> >>>>>> >>>>> Hi Peter, >>>>> >>>>> You've brought up some interesting points here. Can you actually >>>>> clarify these changes with regard to parts of the official shapefile spec, >>>>> or have they been found purely through experimentation? >>>>> >>>>> >>>>> ATB, >>>>> >>>>> Mark. >>>>> >>>>> >>>>> >>>> Hi Mark, >>>> >>>> I do still have to figure out, if there are public specs for this. All >>>> I've found is, that attributes should be in data base files which are in >>>> dBase format ( >>>> http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). From the >>>> analysis of the file (and Wikipedia: >>>> http://en.wikipedia.org/wiki/Shapefile), it seems that this should be >>>> dBase III. I do not have any evidence that there is a public spec for dBase >>>> III. >>>> So all we did is basically gather some experimental data, where ArcGIS >>>> and gvSIG are our references. The first, because ESRI introduced the shape >>>> file format and gvSIG, because it is the desktop environment that we >>>> encourage our customers to use. Anyway, we have an old Borland/Inprise tool >>>> ("Database Desktop") here for managing dBase files and used it for our >>>> tests. >>>> >>>> Peter >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From reid at umn.edu Wed Dec 2 06:58:17 2009 From: reid at umn.edu (Reid Priedhorsky) Date: Wed, 02 Dec 2009 08:58:17 -0600 Subject: [postgis-users] Cannot install 1.4.0 as non-root user In-Reply-To: <4B160DF5.8010005@refractions.net> References: <4B157E0B.4030606@umn.edu> <4B160DF5.8010005@refractions.net> Message-ID: <4B168089.1070507@umn.edu> I should have clarified. We are using the system Postgres and installing PostGIS and GEOS ourselves. In the past (1.3.5), we just compiled PostGIS with --prefix, --with-geos, and --with-pgsql* and it worked great, just like any other GNU-style "configure" software. Now... ???? (As an aside, it was also very frustrating that --prefix was silently ignored instead of failing at configure time with a coherent error message. We spent over an hour tracking that down.) We're on Ubuntu Hardy. * --with-pgsql was needed because we are on Postgres 8.2 but some of the 8.3 stuff is also installed because of unrelated dependencies. But in 1.4, install wants to put stuff in the 8.3 directories even though configure apparently found 8.2 with --with-pgconfig. So I don't see how we can install 1.4 even if we did have root. Reid On 12/02/09 00:49, Kevin Neufeld wrote: > Hi Reid, > > I'm running Centos 5 and installing as non-root works fine for me. My > steps are, as non-root: > - install postgres, geos, and proj in my home directory. > - update LD_LIBRARY_PATH to include the lib directories of each. > - configure PostGIS, using --with-pgconfig, --with-geosconfig, > --with-prodir > - make and install PostGIS (which now only installs to the contrib > directory in the postgres installation) > > Cheers, > Kevin > > Reid Priedhorsky wrote: >> Hi, >> >> We are currently running 1.3.5 and would like to upgrade to 1.4.0. >> However, we don't have root and thus the install fails (see bug #160, >> http://trac.osgeo.org/postgis/ticket/160). >> >> Bug #160 is marked WONTFIX. Are we stuck at 1.3.5 forever? Is there a >> workaround? >> >> Thanks, >> >> Reid >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From mark.cave-ayland at siriusit.co.uk Wed Dec 2 07:15:24 2009 From: mark.cave-ayland at siriusit.co.uk (Mark Cave-Ayland) Date: Wed, 02 Dec 2009 15:15:24 +0000 Subject: [postgis-users] Cannot install 1.4.0 as non-root user In-Reply-To: <4B168089.1070507@umn.edu> References: <4B157E0B.4030606@umn.edu> <4B160DF5.8010005@refractions.net> <4B168089.1070507@umn.edu> Message-ID: <4B16848C.6060807@siriusit.co.uk> Reid Priedhorsky wrote: Hi Reid, > I should have clarified. We are using the system Postgres and installing > PostGIS and GEOS ourselves. In the past (1.3.5), we just compiled > PostGIS with --prefix, --with-geos, and --with-pgsql* and it worked > great, just like any other GNU-style "configure" software. Now... ???? > > (As an aside, it was also very frustrating that --prefix was silently > ignored instead of failing at configure time with a coherent error > message. We spent over an hour tracking that down.) Thanks for the extra information. > We're on Ubuntu Hardy. > > * --with-pgsql was needed because we are on Postgres 8.2 but some of the > 8.3 stuff is also installed because of unrelated dependencies. But in > 1.4, install wants to put stuff in the 8.3 directories even though > configure apparently found 8.2 with --with-pgconfig. So I don't see how > we can install 1.4 even if we did have root. This sounds like the real problem here. I believe there is a bug in PostgreSQL 8.2's PGXS Makefile which means that it can pick the wrong pg_config if you have multiple versions in PATH. The quick fix is to temporarily override PATH when running "make" on PostGIS so that the directory containing the pg_config you really want to use is listed first like this: PATH=/path/to/8.2/install:$PATH make install HTH, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs From nicklas.aven at jordogskog.no Wed Dec 2 07:27:31 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Wed, 2 Dec 2009 16:27:31 +0100 Subject: [postgis-users] Cannot install 1.4.0 as non-root user Message-ID: <200912021527.nB2FRVMw031831@mail-core.space2u.com> Reid Little off topic. Have you successed in compiling geos 3.0 or higher in Hardy. I remember I had big problems with that when I first wanted to test 1.4 /Nicklas 2009-12-02 Mark Cave-Ayland wrote: Reid Priedhorsky wrote: > >Hi Reid, > >> I should have clarified. We are using the system Postgres and installing >> PostGIS and GEOS ourselves. In the past (1.3.5), we just compiled >> PostGIS with --prefix, --with-geos, and --with-pgsql* and it worked >> great, just like any other GNU-style "configure" software. Now... ???? >> >> (As an aside, it was also very frustrating that --prefix was silently >> ignored instead of failing at configure time with a coherent error >> message. We spent over an hour tracking that down.) > >Thanks for the extra information. > >> We're on Ubuntu Hardy. >> >> * --with-pgsql was needed because we are on Postgres 8.2 but some of the >> 8.3 stuff is also installed because of unrelated dependencies. But in >> 1.4, install wants to put stuff in the 8.3 directories even though >> configure apparently found 8.2 with --with-pgconfig. So I don't see how >> we can install 1.4 even if we did have root. > >This sounds like the real problem here. I believe there is a bug in >PostgreSQL 8.2's PGXS Makefile which means that it can pick the wrong >pg_config if you have multiple versions in PATH. The quick fix is to >temporarily override PATH when running "make" on PostGIS so that the >directory containing the pg_config you really want to use is listed >first like this: > >PATH=/path/to/8.2/install:$PATH make install > > >HTH, > >Mark. > >-- >Mark Cave-Ayland - Senior Technical Architect >PostgreSQL - PostGIS >Sirius Corporation plc - control through freedom >http://www.siriusit.co.uk >t: +44 870 608 0063 > >Sirius Labs: http://www.siriusit.co.uk/labs >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From reid at umn.edu Wed Dec 2 13:15:21 2009 From: reid at umn.edu (Reid Priedhorsky) Date: Wed, 02 Dec 2009 15:15:21 -0600 Subject: [postgis-users] Compiling GEOS 3.0+ in Ubuntu Hardy (was: Re: Cannot install 1.4.0 as non-root user) In-Reply-To: <200912021527.nB2FRVMw031831@mail-core.space2u.com> References: <200912021527.nB2FRVMw031831@mail-core.space2u.com> Message-ID: <4B16D8E9.2090709@umn.edu> On 12/02/2009 09:27 AM, Nicklas Av?n wrote: > > Reid Little off topic. Have you successed in compiling geos 3.0 or > higher in Hardy. I remember I had big problems with that when I first > wanted to test 1.4 /Nicklas Hi Nicklas, It worked fine for us. We are currently using GEOS 3.0.3 with PostGIS 1.3.5, and 3.1 also compiled and installed fine with the same version of PostGIS. PostGIS 1.4 did not work as I noted previously. There were no problems of note. configure, make, make install, edit ld.so.conf and run ldconfig. Reid From wwdevil at gmail.com Wed Dec 2 19:52:50 2009 From: wwdevil at gmail.com (wDevil wDevil) Date: Thu, 3 Dec 2009 09:52:50 +0600 Subject: [postgis-users] PostGIS 1.4. Polygon format. Migration from 1.3.6 Message-ID: <31ee4d090912021952wdcf992an5aa2405e67951cb7@mail.gmail.com> ERROR: geometry requires more points ?????????: "...9475,1472438 2999479,1472437 2999475)" <-- parse error at position 179 within geometry ????????: COPY group_2, ?????? 6410, ??????? location: "MULTIPOLYGON(((1472437 2999481,1472997 3002930,1471812 3003122,1471416 3000683,1465945 3000726,14659..." line: MULTIPOLYGON(((1472437 2999481,1472997 3002930,1471812 3003122,1471416 3000683,1465945 3000726,1465937 2999526,1472437 2999481)) in 1.3.6 works fine ERROR: geometry requires more points ?????????: "...7418,1638895 2987419,1638895 2987418)" <-- parse error at position 57 within geometry ????????: COPY group_2, ?????? 20340, ??????? location: "POLYGON((1638895 2987418,1638895 2987419,1638895 2987418))" line: POLYGON((1638895 2987418,1638895 2987419,1638895 2987418)); in 1.3.6 works fine Format of polygons has changed? From woodbri at swoodbridge.com Wed Dec 2 20:16:54 2009 From: woodbri at swoodbridge.com (Stephen Woodbridge) Date: Wed, 02 Dec 2009 23:16:54 -0500 Subject: [postgis-users] PostGIS 1.4. Polygon format. Migration from 1.3.6 In-Reply-To: <31ee4d090912021952wdcf992an5aa2405e67951cb7@mail.gmail.com> References: <31ee4d090912021952wdcf992an5aa2405e67951cb7@mail.gmail.com> Message-ID: <4B173BB6.8080609@swoodbridge.com> wDevil wDevil wrote: > ERROR: geometry requires more points > ?????????: "...9475,1472438 2999479,1472437 2999475)" <-- parse error > at position 179 within geometry > ????????: COPY group_2, ?????? 6410, ??????? location: > "MULTIPOLYGON(((1472437 2999481,1472997 3002930,1471812 > 3003122,1471416 3000683,1465945 3000726,14659..." > > line: MULTIPOLYGON(((1472437 2999481,1472997 3002930,1471812 > 3003122,1471416 3000683,1465945 3000726,1465937 2999526,1472437 > 2999481)) > in 1.3.6 works fine You do not have the same number of open parens (3) and close parens (2). MULTIPOLYGON((( ... ))) you have: MULTIPOLYGON((( ... )) -Steve > ERROR: geometry requires more points > ?????????: "...7418,1638895 2987419,1638895 2987418)" <-- parse error > at position 57 within geometry > ????????: COPY group_2, ?????? 20340, ??????? location: > "POLYGON((1638895 2987418,1638895 2987419,1638895 2987418))" > > line: POLYGON((1638895 2987418,1638895 2987419,1638895 2987418)); > in 1.3.6 works fine > > > Format of polygons has changed? > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From daniel.grum at unibw.de Thu Dec 3 06:38:05 2009 From: daniel.grum at unibw.de (Daniel Grum) Date: Thu, 03 Dec 2009 15:38:05 +0100 Subject: [postgis-users] trigger function Message-ID: <4B17CD4D.8060406@unibw.de> is there a way to build a simple INSERT trigger function like that: CREATE OR REPLACE FUNCTION einheitenstandort() RETURNS trigger AS $BODY$ BEGIN INSERT INTO einheitenstandort SELECT nextval('serial') AS GID, startpoint(line.the_geom) AS the_geom, line.name_der_einheit AS name_der_einheit, line.art AS art, (SELECT a.geschwindigkeit WHERE line.art = a.art) AS geschwindigkeit, localtimestamp AS zeitpunkt FROM public.einheiten_und_bewegungen line, public.art_der_einheit a, public.einheitenstandort es; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE COST 1000; ALTER FUNCTION einheitenstandort() OWNER TO postgres; Or are more infos need to be in the triggerfunction???? The trigger of the table einheiten_und_bewegungen is: CREATE TRIGGER my_trigger AFTER INSERT OR UPDATE OR DELETE ON einheiten_und_bewegungen FOR EACH ROW EXECUTE PROCEDURE einheitenstandort(); The idea is, that everytime when a new "einheitenbewegung" was digitized over the WFS-T an INSERT was made in the table einheitenstandort-->the actual position of the unit. Thanks for all ideas! --daniel From birgit.laggner at vti.bund.de Thu Dec 3 09:25:47 2009 From: birgit.laggner at vti.bund.de (Birgit Laggner) Date: Thu, 03 Dec 2009 18:25:47 +0100 Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX Message-ID: <4B17F49B.2040801@vti.bund.de> Dear list, I have written a pl/pgsql function (see below) for st_difference which in short should sequentially scan a geometric table (a) if there are intersections with geometric table (b) and if there are, it writes the intersecting polygons of table (b) into an extra table and then executes the st_difference for the actual polygon of table (a) and all polygons of table (b ) written in the extra table as a sequence always using the product of the last difference as the input (instead of the table (a) polygon) of the next difference. I hope everybody understands my way of thinking ;-) My problem is now, that at polygon 451 of table (a), the function stops with the following error message: ERROR: could not open relation with OID 25736 SQL Status:XX000 Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE Strange is, that the function did run successfully for more than 100 difference-loops. In an older PostGres version (8.1...), I have had a similar problem, but then always in the 2nd loop, because of the cashing-problem of the query planner. This are the PostGIS/PostgreSQL versions I am using: PostGIS: 8.4.1-2.1 PostgreSQL: 1.4.0-10.1 Here, the last few message rows of the running function, perhaps this helps with understanding the problem (sorry because it's partly in German, I hope it doesn't matter): NOTICE: Beginn Difference f?r dlm07-Polygon 450 NOTICE: Anzahl Intersection-Polygone: 1 NOTICE: CREATE TABLE erstellt implizit eine Sequenz ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte ?test_diff_dlm07_tmp.gid? CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung NOTICE: recordset_object2a: (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E9438704156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D7929CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A417049385130415641D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E93B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD9833664156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F74650597441564112500996C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F91415641579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) NOTICE: recordset_object1: (450,0103000020EB7A00000100000022000000CC72F1149A3C4A41000000002B415641295C8F229A3C4A4185EB51582B4156413E0AD7A3983C4A41000000002B415641351D7C68833C4A41000000002B415641F6285C2F7E3C4A410000001031415641B81E856B913C4A41A4703D6A354156413E0AD723AD3C4A41AE47E17A3B415641B81E850BAE3C4A4114AE47E13E415641E17A144EAF3C4A417B14AEE74341564152B81EA5B03C4A410AD7A3B04741564114AE4721BB3C4A41EC51B82E474156417B14AE67CC3C4A41AE47E17A46415641B81E852BD83C4A411F85EB014641564166666646D73C4A4185EB51B8454156413E0AD783D63C4A41666666664541564114AE4761D53C4A41B81E85DB44415641295C8F02D53C4A418FC2F548444156413E0AD703D53C4A41666666C6434156419A999979D53C4A41AE47E1CA424156410AD7A330D63C4A41713D0AA741415641A4703D8AD73C4A41B81E859B40415641A4703DEAD93C4A41E17A14CE3E415641713D0A17DB3C4A41B81E85DB3D415641CDCCCC8CDC3C4A41F6285CAF3C415641E17A148EDF3C4A41AE47E10A3B4156419A999959E13C4A410AD7A3103A4156413E0AD7E3E23C4A4148E17AC438415641A4703D0AE43C4A41AE47E13A38415641A4703DCAEB3C4A4114AE47213841564100000060EC3C4A413E0AD7D33241564114AE47E1E03C4A41D7A370AD324156419A999979E33C4A417B14AE772E415641882F554CE43C4A41000000002B415641CC72F1149A3C4A41000000002B415641) NOTICE: recordset_object2a: (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E9438704156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D7929CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A417049385130415641D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E93B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD9833664156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F74650597441564112500996C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F91415641579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) NOTICE: Intersection-Polygon 1 verarbeitet. NOTICE: Difference-Polygon dlm07 450 ist fertig. NOTICE: Beginn Difference f?r dlm07-Polygon 451 NOTICE: Anzahl Intersection-Polygone: 1 NOTICE: CREATE TABLE erstellt implizit eine Sequenz ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte ?test_diff_dlm07_tmp.gid? CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung NOTICE: recordset_object2a: (242405,0103000020EB7A00000100000093000000A5D6BC7F113B4A41DA9C414B8C44564150FAAEDD133B4A419F49202D8B4456412FF0D7391B3B4A41168EC19286445641E5C111791C3B4A412DEE6FD88D44564193716BA71F3B4A41527950589B4456413706B5B4203B4A411CA7E1639F4456417F264CED223B4A410BDF111DA544564195B45007273B4A410C80CF17AE44564123394005293B4A41D9F53FC8B34456417B6AB9082D3B4A415F147142B4445641B5FC2FAC303B4A412935E853B4445641C323EFF1373B4A41C18C5DAAB34456412A8D25813F3B4A41C33BF4E5B2445641022A8ED84C3B4A4118E6FF5DB2445641F237A3BB5D3B4A414C7E863FB244564191C97352653B4A410E9B8A5CB1445641529A25D6633B4A41C47E2DB7AD445641B5D7BDEA5E3B4A4160BF3DD7A4445641064DA2335A3B4A41B397823D9B445641468081F5693B4A412AAF71059B445641745B60647B3B4A4188667A919A4456411E7579487A3B4A41BA466E559944564131F2D4F87E3B4A41C9563A27994456414A570C2C893B4A41CC1B91F797445641FAD2C8BCA33B4A419EEF66159544564194F74682CE3B4A41C8A7A28090445641F677AA51E53B4A41C3AC804A8E4456419D16B333023C4A4145B4DB368B4456412CD4AE17083C4A4172F829968A4456418E660AAB223C4A41424103B9874456414F5B3AF4233C4A4100517DEF92445641F472B68E233C4A41C56C4F989344564102FCF859223C4A415E932D9A95445641EFCC195F113C4A41DB4F155BA64456415457E1A40E3C4A4151BCC460A9445641115545C6083C4A41DC02CB19B14456418064136EF33B4A413F76BCD1AC445641DB6389DCF13B4A41BFE689EFB344564126807354EB3B4A4183EC2AACBD445641C5F5579DFA3B4A4121A624F3BF445641D717C6EBF73B4A41ABBB2195C744564161A21A04F33B4A41FB77D15FD5445641D0D839DB053C4A41B7831098D84456410A907C33073C4A414244DACED044564148A334A9163C4A41547CEC36D1445641BF7B60D5363C4A41BCF33468D1445641F68B9DFE393C4A411283312ADA445641B45CC31A4C3C4A41F6A929D1D744564185C3D2CE563C4A4146BC02D9D64456410E266F8E503C4A41256BD10AC544564178A04D1C4E3C4A416E50306BBD4456417ED898E54C3C4A41A3F1EA24B6445641C11890CB4D3C4A4185584DDFAE445641100E678C503C4A41447D8CC1A8445641C8EA7258533C4A41D025F919A4445641F45E60645B3C4A41F11D115B9B445641769EB3136B3C4A41DD06E5858D44564175B35E1A703C4A41CBE002D8874456418EE0827A743C4A41A399728D80445641C2DE7203773C4A4116C1F4C579445641BF3B192A783C4A41250884A571445641B465A72D773C4A41317A276E5C4456414FFAB66E6C3C4A41EE3D4D3554445641D8E3F8AF613C4A41CC142A074A445641C4DD74D9493C4A41E18223504A44564149E72F02203C4A416083AE4C4B445641BB020316163C4A417AD8A6804D44564115A108B7023C4A4133B9970352445641667D32D4FA3B4A413B9DE3AB52445641206FE7D0EF3B4A410F12217D524456416EAA545EE83B4A41E4AAF88E51445641C242D969DD3B4A41BC9873F84F44564159773A65CF3B4A410D0595C04B445641B4F85B10CF3B4A4187C6CA374A445641883CC8C0C73B4A419A306D07464456419595327EBB3B4A41A5F9E0843F445641A4113DFEA83B4A4120D2EB1E36445641576BBF8A9D3B4A41334EA22D30445641F52DD12E9C3B4A411BEEF45232445641A4E92DF3973B4A413F90FFD13444564143331E7A943B4A41F761391136445641A69D4CB1903B4A414DC4100837445641267AE7258C3B4A41A46AA98B37445641AFD254247C3B4A41E986946E384456417541D6286D3B4A416D1F52DB3944564158B4E7076B3B4A412A3AF20F3A4456419F2AFEC4623B4A41450828DC3A44564109C6A7D5613B4A416D1F52DB39445641E9BFB312583B4A413FC197913B44564137F356324D3B4A4145E438BF3E445641A69714F4243B4A41FF1C9DC249445641F8194AC2133B4A4129F0221B4F445641FA42FB2D133B4A41A2CCF75B54445641616D3114153B4A419CB61B4C58445641BF8B0E1D183B4A418E3130FA5B4456415BD1C57B1F3B4A41AE6C11205E445641EBC43854353B4A4112AAE30063445641F4DE50CD423B4A41B562C8B96C4456417E0F5D25413B4A41BA301B6C6D445641CBDFD71D343B4A41E66F8A9663445641805C16E81C3B4A41F872CAAB5E445641433BF7F3173B4A41BAB368095D4456413F29FF2F143B4A41D805CA755A445641C55526D1103B4A4158A7F41B554456415BF92622113B4A41885AA7994F4456416402759FF53A4A4116623BE750445641F6FFBDB0F23A4A415EB061555044564131A5403BE93A4A418CC63CFA4C4456412FFBA344E43A4A418D36F0724C4456415DB86386B33A4A41BFA5FE494D445641A5FD702CAD3A4A417D8DBFBC4D445641A2967FC9A33A4A41E508260650445641FAC39BD16C3A4A419ABBC11F5F445641E2C7B9E9683A4A413EFFA1685F44564170F2B498613A4A41F872CAAB5E44564192C7B713423A4A41D76C65915B445641F5A23B242A3A4A41F4F96F2D5A445641DAD3B5921B3A4A4168628F5858445641AF0DF4EC133A4A41F038A8CC56445641807AF58D0D3A4A41F80F4C3D56445641641AB90A073A4A412046A47557445641764EC9D5013A4A417192BBD758445641C1CD4D37FE394A418E16E7775B445641E07DDC1AFA394A418AE5C1E55E445641783329A1F1394A411EEC95816444564171FF88C2E8394A41BB6F1AAA694456411A500F6DD9394A414D4590527244564160B99CAEE8394A41D4C6E9F3744456411E15301DF4394A41E6F51C60794456416CD799DEF7394A41A3D453B37A4456411D105594103A4A41CC5FFA667E44564136C98BE8183A4A4147B12789804456414A49D33C213A4A41B381F8C8814456414633A250283A4A41AA794B4182445641223F70313C3A4A415F233FEA82445641B5899402483A4A410904F70B8344564117DDEFEC5C3A4A41E541706483445641E6247DF6713A4A417E1B589683445641A219CD66933A4A41372C3C378444564146FD76AECD3A4A41F5171BC28644564129A670D9D23A4A41BB8934F98744564136C565B1D63A4A4104824C3A89445641265EE8E6E03A4A41B0E45ABC8D44564141F89B25EA3A4A416D9A8BC792445641E1B6AC97EC3A4A41EE52A9E19444564164801FAAFA3A4A414E05B8289A445641A5D6BC7F113B4A41DA9C414B8C445641,1) NOTICE: recordset_object1: (451,0103000020EB7A00000100000007000000F6285CEF5D3C4A413E0AD7134A445641D7A370DD733C4A411F85EB0159445641C2F5283C7C3C4A413E0AD72359445641EC51B8FE7A3C4A41D7A370FD47445641EC51B8FE733C4A413E0AD76348445641713D0A57663C4A418FC2F54849445641F6285CEF5D3C4A413E0AD7134A445641) ERROR: could not open relation with OID 25736 CONTEXT: PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE If anybody has suggestions, I would be very happy. If you need more information or the two tables in question, please tell me. Many thanks, Birgit. CREATE OR REPLACE FUNCTION _laggner_b_pgdifference_a() RETURNS void AS $BODY$ DECLARE counter integer; recordset_object1 RECORD; recordset_object2 RECORD; recordset_object2a RECORD; recordset_object3 RECORD; i integer; n integer; j integer; m integer; BEGIN --4. Difference a (dlm07): counter := 0; i := 0; n := count(dlm07_id) from birgit.ni_dlm07_clip2; FOR i in 1..n LOOP --LOOP 1 RAISE NOTICE 'Beginn Difference f?r dlm07-Polygon % ', i; SELECT dlm07_id, the_geom INTO recordset_object1 from birgit.ni_dlm07_clip2 where dlm07_id=i; SELECT b.inv07_id as inv07_id, b.the_geom as the_geom INTO recordset_object2 from birgit.ni_dlm07_clip2 a, birgit.ni_inv07_clip2 b where a.dlm07_id=i and st_relate(a.the_geom, b.the_geom, '2********'); m := count(recordset_object2.inv07_id); RAISE NOTICE 'Anzahl Intersection-Polygone: % ', m; IF m > 0 THEN execute 'create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);'; insert into birgit.test_diff_dlm07_tmp (inv07_id, the_geom) select recordset_object2.inv07_id, recordset_object2.the_geom; SELECT a.inv07_id as inv07_id, a.the_geom as the_geom, a.gid as gid INTO recordset_object2a FROM birgit.test_diff_dlm07_tmp a; RAISE NOTICE 'recordset_object2a: %', recordset_object2a; execute 'drop table birgit.test_diff_dlm07_tmp;'; j := 0; FOR j in 1..m LOOP --LOOP 2 RAISE NOTICE 'recordset_object1: %', recordset_object1; RAISE NOTICE 'recordset_object2a: %', recordset_object2a; SELECT recordset_object1.dlm07_id as dlm07_id, st_difference(recordset_object1.the_geom, recordset_object2a.the_geom) as the_geom INTO recordset_object3 WHERE recordset_object2a.gid=j; SELECT recordset_object3.dlm07_id as dlm07_id, recordset_object3.the_geom as the_geom INTO recordset_object1; RAISE NOTICE 'Intersection-Polygon % verarbeitet. ', j; END LOOP; --END LOOP 2 IF st_isempty(recordset_object1.the_geom)='f' then INSERT INTO birgit.test_diff_dlm07 (dlm07_id, inv07_id, the_geom) VALUES ( recordset_object1.dlm07_id, NULL, recordset_object1.the_geom); END IF; RAISE NOTICE 'Difference-Polygon dlm07 % ist fertig. ', i ; ELSE RAISE NOTICE 'Kein Difference berechnet. '; END IF; counter := counter + 1; END LOOP; --END LOOP 1 END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION _laggner_b_pgdifference_a() OWNER TO postgres; From lr at pcorp.us Thu Dec 3 11:20:44 2009 From: lr at pcorp.us (Paragon Corporation) Date: Thu, 3 Dec 2009 14:20:44 -0500 Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX In-Reply-To: <4B17F49B.2040801@vti.bund.de> References: <4B17F49B.2040801@vti.bund.de> Message-ID: Birgit, I suspect as you alluded to that you are a victim of the dreaded cached plan and your OID issue is because the new table doesn't have the same OID as the old table. 8.4 is supposed to be smart enough to invalidate plans in these situations, thought maybe not. One possible work around is instead of creating and dropping the table, why don't you just TRUNCATE the table and reset the sequence So something like TRUNCATE TABLE birgit.test_diff_dlm07_tmp; ALTER SEQUENCE birgit.test_diff_dlm07_tmp.gid RESTART WITH 1; You could also use CREATE TEMP TABLE instead of CREATE TABLE. I suspect temp table oids may not be cached. Leo -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Birgit Laggner Sent: Thursday, December 03, 2009 12:26 PM To: PostGIS Users Discussion Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX Dear list, I have written a pl/pgsql function (see below) for st_difference which in short should sequentially scan a geometric table (a) if there are intersections with geometric table (b) and if there are, it writes the intersecting polygons of table (b) into an extra table and then executes the st_difference for the actual polygon of table (a) and all polygons of table (b ) written in the extra table as a sequence always using the product of the last difference as the input (instead of the table (a) polygon) of the next difference. I hope everybody understands my way of thinking ;-) My problem is now, that at polygon 451 of table (a), the function stops with the following error message: ERROR: could not open relation with OID 25736 SQL Status:XX000 Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE Strange is, that the function did run successfully for more than 100 difference-loops. In an older PostGres version (8.1...), I have had a similar problem, but then always in the 2nd loop, because of the cashing-problem of the query planner. This are the PostGIS/PostgreSQL versions I am using: PostGIS: 8.4.1-2.1 PostgreSQL: 1.4.0-10.1 Here, the last few message rows of the running function, perhaps this helps with understanding the problem (sorry because it's partly in German, I hope it doesn't matter): NOTICE: Beginn Difference f?r dlm07-Polygon 450 NOTICE: Anzahl Intersection-Polygone: 1 NOTICE: CREATE TABLE erstellt implizit eine Sequenz ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte ?test_diff_dlm07_tmp.gid? CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung NOTICE: recordset_object2a: (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121 B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E943870 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D792 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A4170493851304156 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E9 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD983366 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F746505974415641125009 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F914156 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) NOTICE: recordset_object1: (450,0103000020EB7A00000100000022000000CC72F1149A3C4A41000000002B415641295C8 F229A3C4A4185EB51582B4156413E0AD7A3983C4A41000000002B415641351D7C68833C4A410 00000002B415641F6285C2F7E3C4A410000001031415641B81E856B913C4A41A4703D6A35415 6413E0AD723AD3C4A41AE47E17A3B415641B81E850BAE3C4A4114AE47E13E415641E17A144EA F3C4A417B14AEE74341564152B81EA5B03C4A410AD7A3B04741564114AE4721BB3C4A41EC51B 82E474156417B14AE67CC3C4A41AE47E17A46415641B81E852BD83C4A411F85EB01464156416 6666646D73C4A4185EB51B8454156413E0AD783D63C4A41666666664541564114AE4761D53C4 A41B81E85DB44415641295C8F02D53C4A418FC2F548444156413E0AD703D53C4A41666666C64 34156419A999979D53C4A41AE47E1CA424156410AD7A330D63C4A41713D0AA741415641A4703 D8AD73C4A41B81E859B40415641A4703DEAD93C4A41E17A14CE3E415641713D0A17DB3C4A41B 81E85DB3D415641CDCCCC8CDC3C4A41F6285CAF3C415641E17A148EDF3C4A41AE47E10A3B415 6419A999959E13C4A410AD7A3103A4156413E0AD7E3E23C4A4148E17AC438415641A4703D0AE 43C4A41AE47E13A38415641A4703DCAEB3C4A4114AE47213841564100000060EC3C4A413E0AD 7D33241564114AE47E1E03C4A41D7A370AD324156419A999979E33C4A417B14AE772E4156418 82F554CE43C4A41000000002B415641CC72F1149A3C4A41000000002B415641) NOTICE: recordset_object2a: (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121 B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E943870 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D792 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A4170493851304156 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E9 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD983366 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F746505974415641125009 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F914156 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) NOTICE: Intersection-Polygon 1 verarbeitet. NOTICE: Difference-Polygon dlm07 450 ist fertig. NOTICE: Beginn Difference f?r dlm07-Polygon 451 NOTICE: Anzahl Intersection-Polygone: 1 NOTICE: CREATE TABLE erstellt implizit eine Sequenz ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte ?test_diff_dlm07_tmp.gid? CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung NOTICE: recordset_object2a: (242405,0103000020EB7A00000100000093000000A5D6BC7F113B4A41DA9C414B8C44564150 FAAEDD133B4A419F49202D8B4456412FF0D7391B3B4A41168EC19286445641E5C111791C3B4A 412DEE6FD88D44564193716BA71F3B4A41527950589B4456413706B5B4203B4A411CA7E1639F 4456417F264CED223B4A410BDF111DA544564195B45007273B4A410C80CF17AE445641233940 05293B4A41D9F53FC8B34456417B6AB9082D3B4A415F147142B4445641B5FC2FAC303B4A4129 35E853B4445641C323EFF1373B4A41C18C5DAAB34456412A8D25813F3B4A41C33BF4E5B24456 41022A8ED84C3B4A4118E6FF5DB2445641F237A3BB5D3B4A414C7E863FB244564191C9735265 3B4A410E9B8A5CB1445641529A25D6633B4A41C47E2DB7AD445641B5D7BDEA5E3B4A4160BF3D D7A4445641064DA2335A3B4A41B397823D9B445641468081F5693B4A412AAF71059B44564174 5B60647B3B4A4188667A919A4456411E7579487A3B4A41BA466E559944564131F2D4F87E3B4A 41C9563A27994456414A570C2C893B4A41CC1B91F797445641FAD2C8BCA33B4A419EEF661595 44564194F74682CE3B4A41C8A7A28090445641F677AA51E53B4A41C3AC804A8E4456419D16B3 33023C4A4145B4DB368B4456412CD4AE17083C4A4172F829968A4456418E660AAB223C4A4142 4103B9874456414F5B3AF4233C4A4100517DEF92445641F472B68E233C4A41C56C4F98934456 4102FCF859223C4A415E932D9A95445641EFCC195F113C4A41DB4F155BA64456415457E1A40E 3C4A4151BCC460A9445641115545C6083C4A41DC02CB19B14456418064136EF33B4A413F76BC D1AC445641DB6389DCF13B4A41BFE689EFB344564126807354EB3B4A4183EC2AACBD445641C5 F5579DFA3B4A4121A624F3BF445641D717C6EBF73B4A41ABBB2195C744564161A21A04F33B4A 41FB77D15FD5445641D0D839DB053C4A41B7831098D84456410A907C33073C4A414244DACED0 44564148A334A9163C4A41547CEC36D1445641BF7B60D5363C4A41BCF33468D1445641F68B9D FE393C4A411283312ADA445641B45CC31A4C3C4A41F6A929D1D744564185C3D2CE563C4A4146 BC02D9D64456410E266F8E503C4A41256BD10AC544564178A04D1C4E3C4A416E50306BBD4456 417ED898E54C3C4A41A3F1EA24B6445641C11890CB4D3C4A4185584DDFAE445641100E678C50 3C4A41447D8CC1A8445641C8EA7258533C4A41D025F919A4445641F45E60645B3C4A41F11D11 5B9B445641769EB3136B3C4A41DD06E5858D44564175B35E1A703C4A41CBE002D8874456418E E0827A743C4A41A399728D80445641C2DE7203773C4A4116C1F4C579445641BF3B192A783C4A 41250884A571445641B465A72D773C4A41317A276E5C4456414FFAB66E6C3C4A41EE3D4D3554 445641D8E3F8AF613C4A41CC142A074A445641C4DD74D9493C4A41E18223504A44564149E72F 02203C4A416083AE4C4B445641BB020316163C4A417AD8A6804D44564115A108B7023C4A4133 B9970352445641667D32D4FA3B4A413B9DE3AB52445641206FE7D0EF3B4A410F12217D524456 416EAA545EE83B4A41E4AAF88E51445641C242D969DD3B4A41BC9873F84F44564159773A65CF 3B4A410D0595C04B445641B4F85B10CF3B4A4187C6CA374A445641883CC8C0C73B4A419A306D 07464456419595327EBB3B4A41A5F9E0843F445641A4113DFEA83B4A4120D2EB1E3644564157 6BBF8A9D3B4A41334EA22D30445641F52DD12E9C3B4A411BEEF45232445641A4E92DF3973B4A 413F90FFD13444564143331E7A943B4A41F761391136445641A69D4CB1903B4A414DC4100837 445641267AE7258C3B4A41A46AA98B37445641AFD254247C3B4A41E986946E384456417541D6 286D3B4A416D1F52DB3944564158B4E7076B3B4A412A3AF20F3A4456419F2AFEC4623B4A4145 0828DC3A44564109C6A7D5613B4A416D1F52DB39445641E9BFB312583B4A413FC197913B4456 4137F356324D3B4A4145E438BF3E445641A69714F4243B4A41FF1C9DC249445641F8194AC213 3B4A4129F0221B4F445641FA42FB2D133B4A41A2CCF75B54445641616D3114153B4A419CB61B 4C58445641BF8B0E1D183B4A418E3130FA5B4456415BD1C57B1F3B4A41AE6C11205E445641EB C43854353B4A4112AAE30063445641F4DE50CD423B4A41B562C8B96C4456417E0F5D25413B4A 41BA301B6C6D445641CBDFD71D343B4A41E66F8A9663445641805C16E81C3B4A41F872CAAB5E 445641433BF7F3173B4A41BAB368095D4456413F29FF2F143B4A41D805CA755A445641C55526 D1103B4A4158A7F41B554456415BF92622113B4A41885AA7994F4456416402759FF53A4A4116 623BE750445641F6FFBDB0F23A4A415EB061555044564131A5403BE93A4A418CC63CFA4C4456 412FFBA344E43A4A418D36F0724C4456415DB86386B33A4A41BFA5FE494D445641A5FD702CAD 3A4A417D8DBFBC4D445641A2967FC9A33A4A41E508260650445641FAC39BD16C3A4A419ABBC1 1F5F445641E2C7B9E9683A4A413EFFA1685F44564170F2B498613A4A41F872CAAB5E44564192 C7B713423A4A41D76C65915B445641F5A23B242A3A4A41F4F96F2D5A445641DAD3B5921B3A4A 4168628F5858445641AF0DF4EC133A4A41F038A8CC56445641807AF58D0D3A4A41F80F4C3D56 445641641AB90A073A4A412046A47557445641764EC9D5013A4A417192BBD758445641C1CD4D 37FE394A418E16E7775B445641E07DDC1AFA394A418AE5C1E55E445641783329A1F1394A411E EC95816444564171FF88C2E8394A41BB6F1AAA694456411A500F6DD9394A414D459052724456 4160B99CAEE8394A41D4C6E9F3744456411E15301DF4394A41E6F51C60794456416CD799DEF7 394A41A3D453B37A4456411D105594103A4A41CC5FFA667E44564136C98BE8183A4A4147B127 89804456414A49D33C213A4A41B381F8C8814456414633A250283A4A41AA794B418244564122 3F70313C3A4A415F233FEA82445641B5899402483A4A410904F70B8344564117DDEFEC5C3A4A 41E541706483445641E6247DF6713A4A417E1B589683445641A219CD66933A4A41372C3C3784 44564146FD76AECD3A4A41F5171BC28644564129A670D9D23A4A41BB8934F98744564136C565 B1D63A4A4104824C3A89445641265EE8E6E03A4A41B0E45ABC8D44564141F89B25EA3A4A416D 9A8BC792445641E1B6AC97EC3A4A41EE52A9E19444564164801FAAFA3A4A414E05B8289A4456 41A5D6BC7F113B4A41DA9C414B8C445641,1) NOTICE: recordset_object1: (451,0103000020EB7A00000100000007000000F6285CEF5D3C4A413E0AD7134A445641D7A37 0DD733C4A411F85EB0159445641C2F5283C7C3C4A413E0AD72359445641EC51B8FE7A3C4A41D 7A370FD47445641EC51B8FE733C4A413E0AD76348445641713D0A57663C4A418FC2F54849445 641F6285CEF5D3C4A413E0AD7134A445641) ERROR: could not open relation with OID 25736 CONTEXT: PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE If anybody has suggestions, I would be very happy. If you need more information or the two tables in question, please tell me. Many thanks, Birgit. CREATE OR REPLACE FUNCTION _laggner_b_pgdifference_a() RETURNS void AS $BODY$ DECLARE counter integer; recordset_object1 RECORD; recordset_object2 RECORD; recordset_object2a RECORD; recordset_object3 RECORD; i integer; n integer; j integer; m integer; BEGIN --4. Difference a (dlm07): counter := 0; i := 0; n := count(dlm07_id) from birgit.ni_dlm07_clip2; FOR i in 1..n LOOP --LOOP 1 RAISE NOTICE 'Beginn Difference f?r dlm07-Polygon % ', i; SELECT dlm07_id, the_geom INTO recordset_object1 from birgit.ni_dlm07_clip2 where dlm07_id=i; SELECT b.inv07_id as inv07_id, b.the_geom as the_geom INTO recordset_object2 from birgit.ni_dlm07_clip2 a, birgit.ni_inv07_clip2 b where a.dlm07_id=i and st_relate(a.the_geom, b.the_geom, '2********'); m := count(recordset_object2.inv07_id); RAISE NOTICE 'Anzahl Intersection-Polygone: % ', m; IF m > 0 THEN execute 'create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, the_geom geometry);'; insert into birgit.test_diff_dlm07_tmp (inv07_id, the_geom) select recordset_object2.inv07_id, recordset_object2.the_geom; SELECT a.inv07_id as inv07_id, a.the_geom as the_geom, a.gid as gid INTO recordset_object2a FROM birgit.test_diff_dlm07_tmp a; RAISE NOTICE 'recordset_object2a: %', recordset_object2a; execute 'drop table birgit.test_diff_dlm07_tmp;'; j := 0; FOR j in 1..m LOOP --LOOP 2 RAISE NOTICE 'recordset_object1: %', recordset_object1; RAISE NOTICE 'recordset_object2a: %', recordset_object2a; SELECT recordset_object1.dlm07_id as dlm07_id, st_difference(recordset_object1.the_geom, recordset_object2a.the_geom) as the_geom INTO recordset_object3 WHERE recordset_object2a.gid=j; SELECT recordset_object3.dlm07_id as dlm07_id, recordset_object3.the_geom as the_geom INTO recordset_object1; RAISE NOTICE 'Intersection-Polygon % verarbeitet. ', j; END LOOP; --END LOOP 2 IF st_isempty(recordset_object1.the_geom)='f' then INSERT INTO birgit.test_diff_dlm07 (dlm07_id, inv07_id, the_geom) VALUES ( recordset_object1.dlm07_id, NULL, recordset_object1.the_geom); END IF; RAISE NOTICE 'Difference-Polygon dlm07 % ist fertig. ', i ; ELSE RAISE NOTICE 'Kein Difference berechnet. '; END IF; counter := counter + 1; END LOOP; --END LOOP 1 END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION _laggner_b_pgdifference_a() OWNER TO postgres; _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Thu Dec 3 11:33:21 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Thu, 03 Dec 2009 11:33:21 -0800 Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX In-Reply-To: References: <4B17F49B.2040801@vti.bund.de> Message-ID: <4B181281.1060209@refractions.net> Yeah, I agree. What I've done to get around the caching problem that seems to work is to define all table names as variables at the top of the function. All the sql statements used throughout the function then reference a variable instead of an actual table. The planner can't cache the query plan since the query is adhoc ... no OID referencing problem. -- Kevin Paragon Corporation wrote: > Birgit, > > I suspect as you alluded to that you are a victim of the dreaded cached plan > and your OID issue is because the new table doesn't have the same OID as the > old table. 8.4 is supposed to be smart enough to invalidate plans in these > situations, thought maybe not. > > One possible work around is instead of creating and dropping the table, why > don't you just TRUNCATE the table and reset the sequence > > So something like > > > TRUNCATE TABLE birgit.test_diff_dlm07_tmp; > ALTER SEQUENCE birgit.test_diff_dlm07_tmp.gid RESTART WITH 1; > > > You could also use CREATE TEMP TABLE instead of CREATE TABLE. I suspect > temp table oids may not be cached. > > Leo > > > -----Original Message----- > From: postgis-users-bounces at postgis.refractions.net > [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Birgit > Laggner > Sent: Thursday, December 03, 2009 12:26 PM > To: PostGIS Users Discussion > Subject: [postgis-users] problem with plpgsql function - ERROR: could not > open relation with OID XXX > > Dear list, > > I have written a pl/pgsql function (see below) for st_difference which in > short should sequentially scan a geometric table (a) if there are > intersections with geometric table (b) and if there are, it writes the > intersecting polygons of table (b) into an extra table and then executes the > st_difference for the actual polygon of table (a) and all polygons of table > (b ) written in the extra table as a sequence always using the product of > the last difference as the input (instead of the table (a) > polygon) of the next difference. I hope everybody understands my way of > thinking ;-) > > My problem is now, that at polygon 451 of table (a), the function stops with > the following error message: > > ERROR: could not open relation with OID 25736 SQL Status:XX000 > Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE > > Strange is, that the function did run successfully for more than 100 > difference-loops. In an older PostGres version (8.1...), I have had a > similar problem, but then always in the 2nd loop, because of the > cashing-problem of the query planner. > > This are the PostGIS/PostgreSQL versions I am using: > PostGIS: 8.4.1-2.1 > PostgreSQL: 1.4.0-10.1 > > Here, the last few message rows of the running function, perhaps this helps > with understanding the problem (sorry because it's partly in German, I hope > it doesn't matter): > > NOTICE: Beginn Difference f?r dlm07-Polygon 450 > NOTICE: Anzahl Intersection-Polygone: 1 > NOTICE: CREATE TABLE erstellt implizit eine Sequenz > ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte > ?test_diff_dlm07_tmp.gid? > CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid > serial, inv07_id integer, the_geom geometry);? PL/pgSQL function > "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung > NOTICE: recordset_object2a: > (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121 > B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A > 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E943870 > 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D792 > 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142 > 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A4170493851304156 > 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E9 > 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015 > 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE > 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A > 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD983366 > 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F746505974415641125009 > 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B > 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F914156 > 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) > NOTICE: recordset_object1: > (450,0103000020EB7A00000100000022000000CC72F1149A3C4A41000000002B415641295C8 > F229A3C4A4185EB51582B4156413E0AD7A3983C4A41000000002B415641351D7C68833C4A410 > 00000002B415641F6285C2F7E3C4A410000001031415641B81E856B913C4A41A4703D6A35415 > 6413E0AD723AD3C4A41AE47E17A3B415641B81E850BAE3C4A4114AE47E13E415641E17A144EA > F3C4A417B14AEE74341564152B81EA5B03C4A410AD7A3B04741564114AE4721BB3C4A41EC51B > 82E474156417B14AE67CC3C4A41AE47E17A46415641B81E852BD83C4A411F85EB01464156416 > 6666646D73C4A4185EB51B8454156413E0AD783D63C4A41666666664541564114AE4761D53C4 > A41B81E85DB44415641295C8F02D53C4A418FC2F548444156413E0AD703D53C4A41666666C64 > 34156419A999979D53C4A41AE47E1CA424156410AD7A330D63C4A41713D0AA741415641A4703 > D8AD73C4A41B81E859B40415641A4703DEAD93C4A41E17A14CE3E415641713D0A17DB3C4A41B > 81E85DB3D415641CDCCCC8CDC3C4A41F6285CAF3C415641E17A148EDF3C4A41AE47E10A3B415 > 6419A999959E13C4A410AD7A3103A4156413E0AD7E3E23C4A4148E17AC438415641A4703D0AE > 43C4A41AE47E13A38415641A4703DCAEB3C4A4114AE47213841564100000060EC3C4A413E0AD > 7D33241564114AE47E1E03C4A41D7A370AD324156419A999979E33C4A417B14AE772E4156418 > 82F554CE43C4A41000000002B415641CC72F1149A3C4A41000000002B415641) > NOTICE: recordset_object2a: > (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC87519141564121 > B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6AD773D4A > 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD0E943870 > 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F050415641D2D792 > 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD3C4A4142 > 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A4170493851304156 > 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163BDF058E9 > 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A419F2015 > 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49415641EE > 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F642C703C4A > 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111FD983366 > 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F746505974415641125009 > 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB3C4A418B > 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C8F914156 > 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1) > NOTICE: Intersection-Polygon 1 verarbeitet. > NOTICE: Difference-Polygon dlm07 450 ist fertig. > NOTICE: Beginn Difference f?r dlm07-Polygon 451 > NOTICE: Anzahl Intersection-Polygone: 1 > NOTICE: CREATE TABLE erstellt implizit eine Sequenz > ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte > ?test_diff_dlm07_tmp.gid? > CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp (gid > serial, inv07_id integer, the_geom geometry);? PL/pgSQL function > "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung > NOTICE: recordset_object2a: > (242405,0103000020EB7A00000100000093000000A5D6BC7F113B4A41DA9C414B8C44564150 > FAAEDD133B4A419F49202D8B4456412FF0D7391B3B4A41168EC19286445641E5C111791C3B4A > 412DEE6FD88D44564193716BA71F3B4A41527950589B4456413706B5B4203B4A411CA7E1639F > 4456417F264CED223B4A410BDF111DA544564195B45007273B4A410C80CF17AE445641233940 > 05293B4A41D9F53FC8B34456417B6AB9082D3B4A415F147142B4445641B5FC2FAC303B4A4129 > 35E853B4445641C323EFF1373B4A41C18C5DAAB34456412A8D25813F3B4A41C33BF4E5B24456 > 41022A8ED84C3B4A4118E6FF5DB2445641F237A3BB5D3B4A414C7E863FB244564191C9735265 > 3B4A410E9B8A5CB1445641529A25D6633B4A41C47E2DB7AD445641B5D7BDEA5E3B4A4160BF3D > D7A4445641064DA2335A3B4A41B397823D9B445641468081F5693B4A412AAF71059B44564174 > 5B60647B3B4A4188667A919A4456411E7579487A3B4A41BA466E559944564131F2D4F87E3B4A > 41C9563A27994456414A570C2C893B4A41CC1B91F797445641FAD2C8BCA33B4A419EEF661595 > 44564194F74682CE3B4A41C8A7A28090445641F677AA51E53B4A41C3AC804A8E4456419D16B3 > 33023C4A4145B4DB368B4456412CD4AE17083C4A4172F829968A4456418E660AAB223C4A4142 > 4103B9874456414F5B3AF4233C4A4100517DEF92445641F472B68E233C4A41C56C4F98934456 > 4102FCF859223C4A415E932D9A95445641EFCC195F113C4A41DB4F155BA64456415457E1A40E > 3C4A4151BCC460A9445641115545C6083C4A41DC02CB19B14456418064136EF33B4A413F76BC > D1AC445641DB6389DCF13B4A41BFE689EFB344564126807354EB3B4A4183EC2AACBD445641C5 > F5579DFA3B4A4121A624F3BF445641D717C6EBF73B4A41ABBB2195C744564161A21A04F33B4A > 41FB77D15FD5445641D0D839DB053C4A41B7831098D84456410A907C33073C4A414244DACED0 > 44564148A334A9163C4A41547CEC36D1445641BF7B60D5363C4A41BCF33468D1445641F68B9D > FE393C4A411283312ADA445641B45CC31A4C3C4A41F6A929D1D744564185C3D2CE563C4A4146 > BC02D9D64456410E266F8E503C4A41256BD10AC544564178A04D1C4E3C4A416E50306BBD4456 > 417ED898E54C3C4A41A3F1EA24B6445641C11890CB4D3C4A4185584DDFAE445641100E678C50 > 3C4A41447D8CC1A8445641C8EA7258533C4A41D025F919A4445641F45E60645B3C4A41F11D11 > 5B9B445641769EB3136B3C4A41DD06E5858D44564175B35E1A703C4A41CBE002D8874456418E > E0827A743C4A41A399728D80445641C2DE7203773C4A4116C1F4C579445641BF3B192A783C4A > 41250884A571445641B465A72D773C4A41317A276E5C4456414FFAB66E6C3C4A41EE3D4D3554 > 445641D8E3F8AF613C4A41CC142A074A445641C4DD74D9493C4A41E18223504A44564149E72F > 02203C4A416083AE4C4B445641BB020316163C4A417AD8A6804D44564115A108B7023C4A4133 > B9970352445641667D32D4FA3B4A413B9DE3AB52445641206FE7D0EF3B4A410F12217D524456 > 416EAA545EE83B4A41E4AAF88E51445641C242D969DD3B4A41BC9873F84F44564159773A65CF > 3B4A410D0595C04B445641B4F85B10CF3B4A4187C6CA374A445641883CC8C0C73B4A419A306D > 07464456419595327EBB3B4A41A5F9E0843F445641A4113DFEA83B4A4120D2EB1E3644564157 > 6BBF8A9D3B4A41334EA22D30445641F52DD12E9C3B4A411BEEF45232445641A4E92DF3973B4A > 413F90FFD13444564143331E7A943B4A41F761391136445641A69D4CB1903B4A414DC4100837 > 445641267AE7258C3B4A41A46AA98B37445641AFD254247C3B4A41E986946E384456417541D6 > 286D3B4A416D1F52DB3944564158B4E7076B3B4A412A3AF20F3A4456419F2AFEC4623B4A4145 > 0828DC3A44564109C6A7D5613B4A416D1F52DB39445641E9BFB312583B4A413FC197913B4456 > 4137F356324D3B4A4145E438BF3E445641A69714F4243B4A41FF1C9DC249445641F8194AC213 > 3B4A4129F0221B4F445641FA42FB2D133B4A41A2CCF75B54445641616D3114153B4A419CB61B > 4C58445641BF8B0E1D183B4A418E3130FA5B4456415BD1C57B1F3B4A41AE6C11205E445641EB > C43854353B4A4112AAE30063445641F4DE50CD423B4A41B562C8B96C4456417E0F5D25413B4A > 41BA301B6C6D445641CBDFD71D343B4A41E66F8A9663445641805C16E81C3B4A41F872CAAB5E > 445641433BF7F3173B4A41BAB368095D4456413F29FF2F143B4A41D805CA755A445641C55526 > D1103B4A4158A7F41B554456415BF92622113B4A41885AA7994F4456416402759FF53A4A4116 > 623BE750445641F6FFBDB0F23A4A415EB061555044564131A5403BE93A4A418CC63CFA4C4456 > 412FFBA344E43A4A418D36F0724C4456415DB86386B33A4A41BFA5FE494D445641A5FD702CAD > 3A4A417D8DBFBC4D445641A2967FC9A33A4A41E508260650445641FAC39BD16C3A4A419ABBC1 > 1F5F445641E2C7B9E9683A4A413EFFA1685F44564170F2B498613A4A41F872CAAB5E44564192 > C7B713423A4A41D76C65915B445641F5A23B242A3A4A41F4F96F2D5A445641DAD3B5921B3A4A > 4168628F5858445641AF0DF4EC133A4A41F038A8CC56445641807AF58D0D3A4A41F80F4C3D56 > 445641641AB90A073A4A412046A47557445641764EC9D5013A4A417192BBD758445641C1CD4D > 37FE394A418E16E7775B445641E07DDC1AFA394A418AE5C1E55E445641783329A1F1394A411E > EC95816444564171FF88C2E8394A41BB6F1AAA694456411A500F6DD9394A414D459052724456 > 4160B99CAEE8394A41D4C6E9F3744456411E15301DF4394A41E6F51C60794456416CD799DEF7 > 394A41A3D453B37A4456411D105594103A4A41CC5FFA667E44564136C98BE8183A4A4147B127 > 89804456414A49D33C213A4A41B381F8C8814456414633A250283A4A41AA794B418244564122 > 3F70313C3A4A415F233FEA82445641B5899402483A4A410904F70B8344564117DDEFEC5C3A4A > 41E541706483445641E6247DF6713A4A417E1B589683445641A219CD66933A4A41372C3C3784 > 44564146FD76AECD3A4A41F5171BC28644564129A670D9D23A4A41BB8934F98744564136C565 > B1D63A4A4104824C3A89445641265EE8E6E03A4A41B0E45ABC8D44564141F89B25EA3A4A416D > 9A8BC792445641E1B6AC97EC3A4A41EE52A9E19444564164801FAAFA3A4A414E05B8289A4456 > 41A5D6BC7F113B4A41DA9C414B8C445641,1) > NOTICE: recordset_object1: > (451,0103000020EB7A00000100000007000000F6285CEF5D3C4A413E0AD7134A445641D7A37 > 0DD733C4A411F85EB0159445641C2F5283C7C3C4A413E0AD72359445641EC51B8FE7A3C4A41D > 7A370FD47445641EC51B8FE733C4A413E0AD76348445641713D0A57663C4A418FC2F54849445 > 641F6285CEF5D3C4A413E0AD7134A445641) > > ERROR: could not open relation with OID 25736 > CONTEXT: PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at RAISE > > If anybody has suggestions, I would be very happy. If you need more > information or the two tables in question, please tell me. > > Many thanks, > > Birgit. > > CREATE OR REPLACE FUNCTION _laggner_b_pgdifference_a() > RETURNS void AS > $BODY$ > > DECLARE > counter integer; > recordset_object1 RECORD; > recordset_object2 RECORD; > recordset_object2a RECORD; > recordset_object3 RECORD; > i integer; > n integer; > j integer; > m integer; > > BEGIN > > --4. Difference a (dlm07): > > counter := 0; > i := 0; > n := count(dlm07_id) from birgit.ni_dlm07_clip2; > > FOR i in 1..n LOOP --LOOP 1 > > RAISE NOTICE 'Beginn Difference f?r dlm07-Polygon % ', i; > > SELECT dlm07_id, the_geom INTO recordset_object1 from > birgit.ni_dlm07_clip2 where dlm07_id=i; > > SELECT b.inv07_id as inv07_id, b.the_geom as the_geom INTO > recordset_object2 > from birgit.ni_dlm07_clip2 a, > birgit.ni_inv07_clip2 b > where a.dlm07_id=i and > st_relate(a.the_geom, b.the_geom, '2********'); > > m := count(recordset_object2.inv07_id); > > RAISE NOTICE 'Anzahl Intersection-Polygone: % ', m; > > IF m > 0 THEN > > execute > 'create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id integer, > the_geom geometry);'; > > insert into birgit.test_diff_dlm07_tmp (inv07_id, the_geom) > select recordset_object2.inv07_id, recordset_object2.the_geom; > > SELECT a.inv07_id as inv07_id, > a.the_geom as the_geom, > a.gid as gid > INTO recordset_object2a > FROM birgit.test_diff_dlm07_tmp a; > > RAISE NOTICE 'recordset_object2a: %', recordset_object2a; > > execute > 'drop table birgit.test_diff_dlm07_tmp;'; > > j := 0; > > FOR j in 1..m LOOP --LOOP 2 > > RAISE NOTICE 'recordset_object1: %', recordset_object1; RAISE NOTICE > 'recordset_object2a: %', recordset_object2a; > > SELECT recordset_object1.dlm07_id as dlm07_id, > st_difference(recordset_object1.the_geom, recordset_object2a.the_geom) as > the_geom > INTO recordset_object3 > WHERE recordset_object2a.gid=j; > > SELECT recordset_object3.dlm07_id as dlm07_id, recordset_object3.the_geom > as the_geom INTO recordset_object1; > > RAISE NOTICE 'Intersection-Polygon % verarbeitet. ', j; > > END LOOP; --END LOOP 2 > > IF st_isempty(recordset_object1.the_geom)='f' then > > INSERT INTO birgit.test_diff_dlm07 (dlm07_id, inv07_id, the_geom) > VALUES ( > recordset_object1.dlm07_id, > NULL, > recordset_object1.the_geom); > > END IF; > > RAISE NOTICE 'Difference-Polygon dlm07 % ist fertig. ', i ; > > ELSE RAISE NOTICE 'Kein Difference berechnet. '; > > END IF; > > counter := counter + 1; > > END LOOP; --END LOOP 1 > > END; > $BODY$ > LANGUAGE 'plpgsql' VOLATILE; > ALTER FUNCTION _laggner_b_pgdifference_a() OWNER TO postgres; > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From deby at itc.nl Fri Dec 4 03:31:02 2009 From: deby at itc.nl (Rolf de By) Date: Fri, 4 Dec 2009 12:31:02 +0100 Subject: [postgis-users] st_isvalidreason crashes server Message-ID: <4B18F2F6.9020206@itc.nl> All, Working my way through a large batch of externally obtained polygon data, and attempting to repair topo errors like ring self-intersections, I ran into a server crash with the following query: select *, st_isvalidreason(st_makepolygon(geom)) from tempgeo tempgeo holds rings from original polygons as linestrings. This query has worked me through 75% of the errrors, but crashes now on one. I have discovered that the linestring on which this happens is just over 64,000 points. Is this a known limitation? I am running on a PG 8.4.1 on a Windows Vista box, postgis_full_version="POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS" regards, Rolf International Institute for Geo-Information Science and Earth Observation (ITC) Chamber of Commerce: 410 27 560 E-mail disclaimer The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission. From daniel.grum at unibw.de Fri Dec 4 04:39:59 2009 From: daniel.grum at unibw.de (Daniel Grum) Date: Fri, 04 Dec 2009 13:39:59 +0100 Subject: [postgis-users] problems with UPDATE Message-ID: <4B19031F.4050000@unibw.de> Hi I want to update a geometry table with polygon geometries: UPDATE wald_by SET the_geom = ST_BuildArea(ST_Collect(ST_Intersection(poly.the_geom,ST_Expand(pt.the_geom, 2000)),poly.the_geom)) FROM public.wald_by poly, public.holzfaeller pt, public.runden i WHERE poly.the_geom && ST_Expand(pt.the_geom, 2000) AND pt.style=2 AND i%10=0; Every 10th round this Update will be startet and only for this that have the style=2 -->lumberjacks that clear wood and not work regenerative like style=1. Info to the attributes of the table: gid serial NOT NULL, id integer, the_geom geometry, flaeche double precision, flaeche_ges double precision, CONSTRAINT wald_by_pkey PRIMARY KEY (gid), CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2), CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL), CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 31467) The Update don't works because: ERROR: new line for relation ?wald_by? breaches Check-Constraint ?enforce_geotype_the_geom? So I thing the new geometry is no MULTIPOLYGON???!!! Are there any ideas? --daniel From epailty at googlemail.com Fri Dec 4 04:51:11 2009 From: epailty at googlemail.com (Brian Modra) Date: Fri, 4 Dec 2009 14:51:11 +0200 Subject: [postgis-users] problems with UPDATE In-Reply-To: <4B19031F.4050000@unibw.de> References: <4B19031F.4050000@unibw.de> Message-ID: <5a9699850912040451ubde6be7v2991736348d123c2@mail.gmail.com> 009/12/4 Daniel Grum : > Hi > > I want to update a geometry table with polygon geometries: > > UPDATE wald_by > SET the_geom = > ST_BuildArea(ST_Collect(ST_Intersection(poly.the_geom,ST_Expand(pt.the_geom, > 2000)),poly.the_geom)) > FROM public.wald_by poly, public.holzfaeller pt, public.runden i > WHERE poly.the_geom && ST_Expand(pt.the_geom, 2000) AND pt.style=2 AND > i%10=0; > > Every 10th round this Update will be startet and only for this that have the > style=2 -->lumberjacks that clear wood and not work regenerative like > style=1. > > Info to the attributes of the table: > gid serial NOT NULL, ?id integer, ?the_geom geometry, ?flaeche double > precision, ?flaeche_ges double precision, > ?CONSTRAINT wald_by_pkey PRIMARY KEY (gid), > ?CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2), > ?CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = > 'MULTIPOLYGON'::text OR the_geom IS NULL), > ?CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 31467) > > The Update don't works because: > ERROR: ?new line for relation ?wald_by? breaches Check-Constraint > ?enforce_geotype_the_geom? > > So I thing the new geometry is no MULTIPOLYGON???!!! The return type can be a Polygon or MultiPolygon, depending on input > Are there any ideas? ST_Multi(ST_BuildArea(ST_Collect(ST_Intersection(poly.the_geom,ST_Expand(pt.the_geom,2000)),poly.the_geom))) > > --daniel > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Brian Modra Land line: +27 23 5411 462 Mobile: +27 79 69 77 082 5 Jan Louw Str, Prince Albert, 6930 Postal: P.O. Box 2, Prince Albert 6930 South Africa http://www.zwartberg.com/ From nicklas.aven at jordogskog.no Fri Dec 4 06:13:49 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Fri, 4 Dec 2009 15:13:49 +0100 Subject: [postgis-users] st_union and simple line merge Message-ID: <200912041413.nB4EDnCR026411@mail-core.space2u.com> Hallo I found that st_union makes no effort to avoid multilinestring from st_union(linestring, linestring) Is this expected? an example: select st_astext(st_union('LINESTRING(1 1, 5 5)'::geometry, 'LINESTRING(5 5, 10 5)'::geometry)); returns MULTILINESTRING((1 1,5 5),(5 5,10 5)) and worst for practical cases if we input the linestrings in opposite order select st_astext(st_union( 'LINESTRING(5 5, 10 5)'::geometry, 'LINESTRING(1 1, 5 5)'::geometry)); we get: "MULTILINESTRING((5 5,10 5),(1 1,5 5))" This is not described in the documentation but it says that st_union will try to dissolv boudaries, and I can't imagine any simplier case to dissolv boundaries than this. Is this the expected bahavior, is there any other way to merge simple linestrings to new linestrings? Thanks Nicklas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicklas.aven at jordogskog.no Fri Dec 4 06:34:09 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Fri, 4 Dec 2009 15:34:09 +0100 Subject: [postgis-users] st_union and simple line merge Message-ID: <200912041434.nB4EY9sA030930@mail-core.space2u.com> ok, I found:ST_LineMerge() I just expected that funtionality to be built in st_union but it will solve my problem :-) /Nicklas 2009-12-04 Nicklas Avén wrote: > Hallo> > I found that st_union makes no effort to avoid multilinestring from st_union(linestring, linestring)> > Is this expected?> > an example:> select st_astext(st_union('LINESTRING(1 1, 5 5)'::geometry, 'LINESTRING(5 5, 10 5)'::geometry));> > returns MULTILINESTRING((1 1,5 5),(5 5,10 5))> > and worst for practical cases if we input the linestrings in opposite order> > select st_astext(st_union( 'LINESTRING(5 5, 10 5)'::geometry, 'LINESTRING(1 1, 5 5)'::geometry));> > we get:> > "MULTILINESTRING((5 5,10 5),(1 1,5 5))" >> This is not described in the documentation but it says that st_union will try to dissolv boudaries, and I can't imagine any simplier case to dissolv boundaries than this. > > Is this the expected bahavior, is there any other way to merge simple linestrings to new linestrings?> > Thanks> Nicklas> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pramsey at cleverelephant.ca Fri Dec 4 08:24:43 2009 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Fri, 4 Dec 2009 08:24:43 -0800 Subject: [postgis-users] st_isvalidreason crashes server In-Reply-To: <4B18F2F6.9020206@itc.nl> References: <4B18F2F6.9020206@itc.nl> Message-ID: <30fe546d0912040824x70bdc70bv726739f4b69e6ca4@mail.gmail.com> Hi Rolf, We don't believe in known limitations, we believe in fixing them :) If you can zip up the offending geometry and I can replicate the crash we'll fix it in the next release. create table badgeom as select * from mytable where gid = 'the gid of hte bad geom'; pg_dump -t badgeom mydatabase > dump.sql bzip2 dump.sql Then attach that dump file to a fresh ticket in trac http://trac.osgeo.org/postgis Thanks, P On Fri, Dec 4, 2009 at 3:31 AM, Rolf de By wrote: > All, > > Working my way through a large batch of externally obtained polygon data, > and attempting to repair topo errors like ring self-intersections, I ran > into a server crash with the following query: > > select *, st_isvalidreason(st_makepolygon(geom)) > from tempgeo > > tempgeo holds rings from original polygons as linestrings. ?This query has > worked me through 75% of the errrors, but crashes now on one. > I have discovered that the linestring on which this happens is just over > 64,000 points. ?Is this a known limitation? > > I am running on a PG 8.4.1 on a Windows Vista box, > postgis_full_version="POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. > 4.6.1, 21 August 2008" USE_STATS" > > regards, > > Rolf > > International Institute for Geo-Information Science and Earth Observation > (ITC) > Chamber of Commerce: 410 27 560 > > E-mail disclaimer > The information in this e-mail, including any attachments, is intended for > the addressee only. If you are not the intended recipient, you are hereby > notified that any disclosure, copying, distribution or action in relation to > the content of this information is strictly prohibited. If you have received > this e-mail by mistake, please delete the message and any attachment and > inform the sender by return e-mail. ITC accepts no liability for any error > or omission in the message content or for damage of any kind that may arise > as a result of e-mail transmission. > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From pramsey at cleverelephant.ca Fri Dec 4 08:26:49 2009 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Fri, 4 Dec 2009 08:26:49 -0800 Subject: [postgis-users] st_union and simple line merge In-Reply-To: <200912041413.nB4EDnCR026411@mail-core.space2u.com> References: <200912041413.nB4EDnCR026411@mail-core.space2u.com> Message-ID: <30fe546d0912040826i2b426b7rc4a73b8f1688d47c@mail.gmail.com> ST_LineMerge dissolves linestrings the way you want... We're inheriting the semantics of Union from JTS. It's possible that we should be delegating to linemerge in line/line cases. That would be a big behavior change, however. P On Fri, Dec 4, 2009 at 6:13 AM, Nicklas Av?n wrote: > Hallo > > I found that st_union makes no effort to avoid multilinestring from > st_union(linestring, linestring) > > Is this expected? > > an example: > select st_astext(st_union('LINESTRING(1 1, 5 5)'::geometry, 'LINESTRING(5 5, > 10 5)'::geometry)); > > returns MULTILINESTRING((1 1,5 5),(5 5,10 5)) > > and worst for practical cases if we input the linestrings in opposite order > > select st_astext(st_union( 'LINESTRING(5 5, 10 5)'::geometry, 'LINESTRING(1 > 1, 5 5)'::geometry)); > > we get: > > "MULTILINESTRING((5 5,10 5),(1 1,5 5))" > This is not described in the documentation but it says that st_union will > try to dissolv boudaries, and I can't imagine any simplier case to dissolv > boundaries than this. > > Is this the expected bahavior, is there any other way to merge simple > linestrings to new linestrings? > > Thanks > Nicklas > > > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From david.fawcett at gmail.com Fri Dec 4 08:48:08 2009 From: david.fawcett at gmail.com (David Fawcett) Date: Fri, 4 Dec 2009 10:48:08 -0600 Subject: [postgis-users] st_isvalidreason crashes server In-Reply-To: <30fe546d0912040824x70bdc70bv726739f4b69e6ca4@mail.gmail.com> References: <4B18F2F6.9020206@itc.nl> <30fe546d0912040824x70bdc70bv726739f4b69e6ca4@mail.gmail.com> Message-ID: Not something that I often (ever) see on the Oracle or ESRI lists... ; / On Fri, Dec 4, 2009 at 10:24 AM, Paul Ramsey wrote: > Hi Rolf, > > We don't believe in known limitations, we believe in fixing them :) From ahmettemiz88 at gmail.com Fri Dec 4 11:39:27 2009 From: ahmettemiz88 at gmail.com (ahmet temiz) Date: Fri, 4 Dec 2009 21:39:27 +0200 Subject: [postgis-users] postgis dump Message-ID: <37ee0090912041139s47312323g7c784a07554f39be@mail.gmail.com> hello I was wondering if it was possible to dump postgis database other than using pgsql2shp. kind regards Ahmet Temiz From lr at pcorp.us Fri Dec 4 12:10:03 2009 From: lr at pcorp.us (Paragon Corporation) Date: Fri, 4 Dec 2009 15:10:03 -0500 Subject: [postgis-users] postgis dump In-Reply-To: <37ee0090912041139s47312323g7c784a07554f39be@mail.gmail.com> References: <37ee0090912041139s47312323g7c784a07554f39be@mail.gmail.com> Message-ID: <626DE90B413E422897ABED00BF3D4CFE@A> Yes just use pg_dump. You backup PostGIS data like any other PostgreSQL data. Leo -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of ahmet temiz Sent: Friday, December 04, 2009 2:39 PM To: postgis-users at postgis.refractions.net Subject: [postgis-users] postgis dump hello I was wondering if it was possible to dump postgis database other than using pgsql2shp. kind regards Ahmet Temiz _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From dave.potts at pinan.co.uk Sun Dec 6 02:31:28 2009 From: dave.potts at pinan.co.uk (David Potts) Date: Sun, 6 Dec 2009 10:31:28 -0000 (UTC) Subject: [postgis-users] Making a Polygon from Points In-Reply-To: <200912041413.nB4EDnCR026411@mail-core.space2u.com> References: <200912041413.nB4EDnCR026411@mail-core.space2u.com> Message-ID: <57990.91.181.122.171.1260095488.squirrel@dp2642.force9.co.uk> Hi I trying to make a polygon or closed linestring from a list of points. I can say something like insert into lines(the_geom) select ST_MakeLine(foo.the_geom) from(select the_geom from hack where generation=1 and circle=0 ) as foo; This results in a open line that runs through all off the points, I am trying to generate either a closed line or a polygon. Using functions like ST_Polygonize, generate an empty goetry collection. Does anybody have any suggestions on how I generate a closed linestring or a polygon? regards Dave. -- Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of the Pinan Software From j.l.h.hartmann at uva.nl Sun Dec 6 02:48:44 2009 From: j.l.h.hartmann at uva.nl (Jan Hartmann) Date: Sun, 06 Dec 2009 11:48:44 +0100 Subject: [postgis-users] Making a Polygon from Points In-Reply-To: <57990.91.181.122.171.1260095488.squirrel@dp2642.force9.co.uk> References: <200912041413.nB4EDnCR026411@mail-core.space2u.com> <57990.91.181.122.171.1260095488.squirrel@dp2642.force9.co.uk> Message-ID: <4B1B8C0C.1060809@uva.nl> Hi David, I do it like this: select geometryfromtext ('Polygon ((' || array_to_string (array ( (select x(crd) || ' ' || y(crd) from points order by nr ) union all (select x(crd) || ' ' || y(crd) from points order by nr limit 1 ) ),',' ) || '))',srid ) as the_geom First put the points in an array, add the first point at the last position, and convert the array to a GEOMETRY string. You need a column to orders the points (nr in this case). Jan David Potts wrote: > Hi > > I trying to make a polygon or closed linestring from a list of points. > > I can say something like > > > insert into lines(the_geom) select ST_MakeLine(foo.the_geom) from(select > the_geom from hack where generation=1 and circle=0 ) as foo; > > This results in a open line that runs through all off the points, I am > trying to generate either a closed line or a polygon. > > Using functions like ST_Polygonize, generate an empty goetry collection. > > Does anybody have any suggestions on how I generate a closed linestring or > a polygon? > regards > > Dave. > From dave.potts at pinan.co.uk Sun Dec 6 04:04:28 2009 From: dave.potts at pinan.co.uk (David Potts) Date: Sun, 6 Dec 2009 12:04:28 -0000 (UTC) Subject: [postgis-users] Making a Polygon from Points In-Reply-To: <4B1B8C0C.1060809@uva.nl> References: <200912041413.nB4EDnCR026411@mail-core.space2u.com> <57990.91.181.122.171.1260095488.squirrel@dp2642.force9.co.uk> <4B1B8C0C.1060809@uva.nl> Message-ID: <52555.87.65.84.64.1260101068.squirrel@dp2642.force9.co.uk> Thanks Jan, Worked a treat:-) Dave. > Hi David, > > I do it like this: > > select geometryfromtext > ('Polygon ((' || array_to_string > (array > ( > (select x(crd) || ' ' || y(crd) > from points > order by nr > ) > union all > (select x(crd) || ' ' || y(crd) > from points > order by nr > limit 1 > ) > ),',' > ) || '))',srid > ) as the_geom > > First put the points in an array, add the first point at the last > position, and convert the array to a GEOMETRY string. You need a column > to orders the points (nr in this case). > > Jan > > > David Potts wrote: >> Hi >> >> I trying to make a polygon or closed linestring from a list of points. >> >> I can say something like >> >> >> insert into lines(the_geom) select ST_MakeLine(foo.the_geom) >> from(select >> the_geom from hack where generation=1 and circle=0 ) as foo; >> >> This results in a open line that runs through all off the points, I am >> trying to generate either a closed line or a polygon. >> >> Using functions like ST_Polygonize, generate an empty goetry >> collection. >> >> Does anybody have any suggestions on how I generate a closed linestring >> or >> a polygon? >> regards >> >> Dave. >> > -- Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of the Pinan Software From daniel.grum at unibw.de Sun Dec 6 09:43:08 2009 From: daniel.grum at unibw.de (Daniel Grum) Date: Sun, 06 Dec 2009 18:43:08 +0100 Subject: [postgis-users] problems with generated points Message-ID: <4B1BED2C.8040201@unibw.de> hi, I have a problem with the points that are generated by postigs functions. The points where saved in a PostgreSQL table and tshs table is the source for the feature type of my geoserver WMS. If I activate the layer in mapbender my comlete WMS can not be shown and if I deactivate it my WMS works normaly with no problems. The points and lines i digitize with my WFS-T(geoserver) work fine, but than when I use the postgis functions, f.e. calculate the startpoint of a line and save this point to the table: st_startpoint(ST_LineMerge(line.the_geom)) AS the_geom The complete SQL is: DELETE FROM einheitenstandort WHERE GID > 1; INSERT INTO einheitenstandort SELECT nextval('serial') AS GID, st_startpoint(ST_LineMerge(line.the_geom)) AS the_geom, line.name_der_einheit AS name_der_einheit, (SELECT line.art) AS art, (SELECT a.geschwindigkeit WHERE line.art = a.art) AS geschwindigkeit, localtimestamp AS zeitpunkt FROM public.einheiten_und_bewegungen line, public.art_der_einheit a, public.einheitenstandort es GROUP BY line.name_der_einheit, line.art, a.geschwindigkeit, a.art, line.the_geom; -->I have to use st_linemerge() because line.the_geom are MULTILINESTRING gemetries. -->I think the calculated point make the trouble, Because the digitized points generated no failure! Thanks for every help, daniel From deby at itc.nl Mon Dec 7 01:03:45 2009 From: deby at itc.nl (Rolf de By) Date: Mon, 7 Dec 2009 10:03:45 +0100 Subject: [postgis-users] st_isvalidreason crashes server Message-ID: <4B1CC4F1.3060007@itc.nl> Dear all, I have been unable to repeat the crash with st_isvalidreason reported last week. Silly: the culprit data had already been cleaned, and going back to the originals didn't give me the same problem again. I suspect that interwoven data access (edits on the geometry through QGIS with queries from pgAdmin) may have had something to do with this. regards Rolf International Institute for Geo-Information Science and Earth Observation (ITC) Chamber of Commerce: 410 27 560 E-mail disclaimer The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission. From pramsey at cleverelephant.ca Mon Dec 7 08:00:21 2009 From: pramsey at cleverelephant.ca (Paul Ramsey) Date: Mon, 7 Dec 2009 08:00:21 -0800 Subject: [postgis-users] FOSS4G 2009 Videos Message-ID: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Last message from 2009, the videos of sessions have been linked into the main website now and are all online, have a look, especially at the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a grand conference, I hope all you members of the PostGIS family are working on your travel plans to head to Barcelona for 2010. --------- Sydney, Australia. 7 December 2009. http://2009.foss4g.org Presentations, videos and posters from the international conference for Free and Open Source Software for GeoSpatial are now online. So if you missed the conference, or couldn't attend all the sessions, you now have a second chance to participate. In particular, I strongly recommend viewing Paul Ramsey's thought provoking and entertaining keynote speech, " Beyond Nerds Bearing Gifts: The Future of the Open Source Economy", http://2009.foss4g.org/speakers/#Paul_Ramsey . Almost all presentations, tutorials and workshop material has been collected, and we have videos of 2/3 of all the presentations. Presentations, workshops and tutorials and videos are linked from abstract descriptions at: http://2009.foss4g.org/schedule/ . * Videos can also be found at: http://blip.tv/search?q=fosslc * Posters: http://wiki.osgeo.org/wiki/FOSS4G_2009_Posters * Ignight Spatial lightening talk videos: http://www.ignitespatial.com/?page_id=181 * Photos: http://www.flickr.com/photos/tags/foss4g2009/ About FOSS4G http://2009.foss4g.org FOSS4G is an international Free and Open Source Software for Geospatial conference, which was held in Sydney, Australia, 20-23 October 2009. FOSS4G offered presentations, workshops, demos, an install-fest, and a code sprint. It was presented by the world's best Developers, Policy Makers, Sponsors and Geospatial Professionals and included the latest geospatial applications, standards, government programs, business processes and case studies. Topics included mobile platforms, location based applications, crowd sourcing, cloud computing, development, spatial standards, integration of cross-agency data, Spatial Data Infrastructures, Sensor Webs, Web Processing Services, Integration of Open Source and Proprietary Software and more. Media Sponsors Position Magazine: http://www.positionmag.com.au/ Asian Surveying and Mapping Newsletter: http://www.asmmag.com Geoconnexions Magazine: http://www.geoconnexion.com/ Directions Magazine: http://directionsmag.com/ GIS Development: http://gisdevelopment.net/ Baliz Media: http://www.BALIZ-MEDIA.com/ Slashgeo: http://slashgeo.org From j.l.h.hartmann at uva.nl Mon Dec 7 08:39:27 2009 From: j.l.h.hartmann at uva.nl (Jan Hartmann) Date: Mon, 07 Dec 2009 17:39:27 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Message-ID: <4B1D2FBF.6040807@uva.nl> Great talk Paul. If I had know that it would be so good, I would have come to Sidney. Jan Paul Ramsey wrote: > Last message from 2009, the videos of sessions have been linked into > the main website now and are all online, have a look, especially at > the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a > grand conference, I hope all you members of the PostGIS family are > working on your travel plans to head to Barcelona for 2010. > > --------- > > Sydney, Australia. 7 December 2009. http://2009.foss4g.org > > Presentations, videos and posters from the international conference > for Free and Open Source Software for GeoSpatial are now online. So if > you missed the conference, or couldn't attend all the sessions, you > now have a second chance to participate. In particular, I strongly > recommend viewing Paul Ramsey's thought provoking and entertaining > keynote speech, " Beyond Nerds Bearing Gifts: The Future of the Open > Source Economy", http://2009.foss4g.org/speakers/#Paul_Ramsey . > > Almost all presentations, tutorials and workshop material has been > collected, and we have videos of 2/3 of all the presentations. > Presentations, workshops and tutorials and videos are linked from > abstract descriptions at: http://2009.foss4g.org/schedule/ . > > * Videos can also be found at: http://blip.tv/search?q=fosslc > * Posters: http://wiki.osgeo.org/wiki/FOSS4G_2009_Posters > * Ignight Spatial lightening talk videos: > http://www.ignitespatial.com/?page_id=181 > * Photos: http://www.flickr.com/photos/tags/foss4g2009/ > > About FOSS4G > > http://2009.foss4g.org > > FOSS4G is an international Free and Open Source Software for > Geospatial conference, which was held in Sydney, Australia, 20-23 > October 2009. FOSS4G offered presentations, workshops, demos, an > install-fest, and a code sprint. It was presented by the world's best > Developers, Policy Makers, Sponsors and Geospatial Professionals and > included the latest geospatial applications, standards, government > programs, business processes and case studies. Topics included mobile > platforms, location based applications, crowd sourcing, cloud > computing, development, spatial standards, integration of cross-agency > data, Spatial Data Infrastructures, Sensor Webs, Web Processing > Services, Integration of Open Source and Proprietary Software and > more. > > Media Sponsors > > Position Magazine: http://www.positionmag.com.au/ > Asian Surveying and Mapping Newsletter: http://www.asmmag.com > Geoconnexions Magazine: http://www.geoconnexion.com/ > Directions Magazine: http://directionsmag.com/ > GIS Development: http://gisdevelopment.net/ > Baliz Media: http://www.BALIZ-MEDIA.com/ > Slashgeo: http://slashgeo.org > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From j.l.h.hartmann at uva.nl Mon Dec 7 08:43:33 2009 From: j.l.h.hartmann at uva.nl (Jan Hartmann) Date: Mon, 07 Dec 2009 17:43:33 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Message-ID: <4B1D30B5.9030405@uva.nl> Great talk Paul. If I had know that it would be so good, I would have come to Sidney :-). Keynote address was even better: http://blog.cleverelephant.ca/2009/10/foss4g-2009-keynote.html Jan Paul Ramsey wrote: > Last message from 2009, the videos of sessions have been linked into > the main website now and are all online, have a look, especially at > the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a > grand conference, I hope all you members of the PostGIS family are > working on your travel plans to head to Barcelona for 2010. > > --------- > > Sydney, Australia. 7 December 2009. http://2009.foss4g.org > > Presentations, videos and posters from the international conference > for Free and Open Source Software for GeoSpatial are now online. So if > you missed the conference, or couldn't attend all the sessions, you > now have a second chance to participate. In particular, I strongly > recommend viewing Paul Ramsey's thought provoking and entertaining > keynote speech, " Beyond Nerds Bearing Gifts: The Future of the Open > Source Economy", http://2009.foss4g.org/speakers/#Paul_Ramsey . > > Almost all presentations, tutorials and workshop material has been > collected, and we have videos of 2/3 of all the presentations. > Presentations, workshops and tutorials and videos are linked from > abstract descriptions at: http://2009.foss4g.org/schedule/ . > > * Videos can also be found at: http://blip.tv/search?q=fosslc > * Posters: http://wiki.osgeo.org/wiki/FOSS4G_2009_Posters > * Ignight Spatial lightening talk videos: > http://www.ignitespatial.com/?page_id=181 > * Photos: http://www.flickr.com/photos/tags/foss4g2009/ > > About FOSS4G > > http://2009.foss4g.org > > FOSS4G is an international Free and Open Source Software for > Geospatial conference, which was held in Sydney, Australia, 20-23 > October 2009. FOSS4G offered presentations, workshops, demos, an > install-fest, and a code sprint. It was presented by the world's best > Developers, Policy Makers, Sponsors and Geospatial Professionals and > included the latest geospatial applications, standards, government > programs, business processes and case studies. Topics included mobile > platforms, location based applications, crowd sourcing, cloud > computing, development, spatial standards, integration of cross-agency > data, Spatial Data Infrastructures, Sensor Webs, Web Processing > Services, Integration of Open Source and Proprietary Software and > more. > > Media Sponsors > > Position Magazine: http://www.positionmag.com.au/ > Asian Surveying and Mapping Newsletter: http://www.asmmag.com > Geoconnexions Magazine: http://www.geoconnexion.com/ > Directions Magazine: http://directionsmag.com/ > GIS Development: http://gisdevelopment.net/ > Baliz Media: http://www.BALIZ-MEDIA.com/ > Slashgeo: http://slashgeo.org > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From j.l.h.hartmann at uva.nl Mon Dec 7 08:44:12 2009 From: j.l.h.hartmann at uva.nl (Jan Hartmann) Date: Mon, 07 Dec 2009 17:44:12 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Message-ID: <4B1D30DC.4070005@uva.nl> Great talk Paul. If I had know that it would be so good, I would have come to Sidney :-). Keynote address was even better: http://blog.cleverelephant.ca/2009/10/foss4g-2009-keynote.html Jan Paul Ramsey wrote: > Last message from 2009, the videos of sessions have been linked into > the main website now and are all online, have a look, especially at > the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a > grand conference, I hope all you members of the PostGIS family are > working on your travel plans to head to Barcelona for 2010. > > --------- > > Sydney, Australia. 7 December 2009. http://2009.foss4g.org > > Presentations, videos and posters from the international conference > for Free and Open Source Software for GeoSpatial are now online. So if > you missed the conference, or couldn't attend all the sessions, you > now have a second chance to participate. In particular, I strongly > recommend viewing Paul Ramsey's thought provoking and entertaining > keynote speech, " Beyond Nerds Bearing Gifts: The Future of the Open > Source Economy", http://2009.foss4g.org/speakers/#Paul_Ramsey . > > Almost all presentations, tutorials and workshop material has been > collected, and we have videos of 2/3 of all the presentations. > Presentations, workshops and tutorials and videos are linked from > abstract descriptions at: http://2009.foss4g.org/schedule/ . > > * Videos can also be found at: http://blip.tv/search?q=fosslc > * Posters: http://wiki.osgeo.org/wiki/FOSS4G_2009_Posters > * Ignight Spatial lightening talk videos: > http://www.ignitespatial.com/?page_id=181 > * Photos: http://www.flickr.com/photos/tags/foss4g2009/ > > About FOSS4G > > http://2009.foss4g.org > > FOSS4G is an international Free and Open Source Software for > Geospatial conference, which was held in Sydney, Australia, 20-23 > October 2009. FOSS4G offered presentations, workshops, demos, an > install-fest, and a code sprint. It was presented by the world's best > Developers, Policy Makers, Sponsors and Geospatial Professionals and > included the latest geospatial applications, standards, government > programs, business processes and case studies. Topics included mobile > platforms, location based applications, crowd sourcing, cloud > computing, development, spatial standards, integration of cross-agency > data, Spatial Data Infrastructures, Sensor Webs, Web Processing > Services, Integration of Open Source and Proprietary Software and > more. > > Media Sponsors > > Position Magazine: http://www.positionmag.com.au/ > Asian Surveying and Mapping Newsletter: http://www.asmmag.com > Geoconnexions Magazine: http://www.geoconnexion.com/ > Directions Magazine: http://directionsmag.com/ > GIS Development: http://gisdevelopment.net/ > Baliz Media: http://www.BALIZ-MEDIA.com/ > Slashgeo: http://slashgeo.org > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From maxime at altribe.org Mon Dec 7 09:05:34 2009 From: maxime at altribe.org (Maxime van Noppen) Date: Mon, 07 Dec 2009 18:05:34 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Message-ID: <4B1D35DE.5070100@altribe.org> Paul Ramsey wrote: > Last message from 2009, the videos of sessions have been linked into > the main website now and are all online, have a look, especially at > the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a > grand conference, I hope all you members of the PostGIS family are > working on your travel plans to head to Barcelona for 2010. Great talk ! Can't wait for PostGIS 2.0 ;) -- Maxime From Pierre.Racine at sbf.ulaval.ca Mon Dec 7 12:27:02 2009 From: Pierre.Racine at sbf.ulaval.ca (Pierre Racine) Date: Mon, 7 Dec 2009 15:27:02 -0500 Subject: [postgis-users] Suggestion Needed In-Reply-To: <866185.97516.qm@web45913.mail.sp1.yahoo.com> References: <866185.97516.qm@web45913.mail.sp1.yahoo.com> Message-ID: <87A96661E65C5541AB4D20721C2DD7F84D014C7ED7@EXCH-MBX-A.ulaval.ca> Mukesh, Sorry for the late answer. You can give a try to WKT Raster. You will have to compile it though. Loading Geotiff should then be straightforward using gdal2wktraster.py. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of mukesh karanwal Sent: 25 novembre 2009 06:30 To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Hi.. thanks for the reply. i did it but still it is showing the same error! I actually want to store a Geotiff file in the databse, could you please tell, is there any other way to do this? or where am i doing mistake, if any? Thanks --- On Tue, 11/24/09, Luigi Castro Cardeles wrote: From: Luigi Castro Cardeles Subject: Re: [postgis-users] Suggestion Needed To: "PostGIS Users Discussion" Date: Tuesday, November 24, 2009, 10:17 PM Hi, to "bypass" the password, you can make the .pgpass file and fill that with your connection params (hostname:port:database_name:user:password). If you are using windows, the path is: C:\Users\\AppData\Roaming\postgresql\.pgpass best regards Luigi Castro Cardeles 2009/11/24 mukesh karanwal > Hey Everyone, I am trying to store raster data in Postgis/PostgrSQL using "geotiff2pgrstaer.exe". but evertime i get an error that "when making connection to PostgreSQL: fe_sendauth: no password supplied", though i am supplying all the information. The command i am giving is like: C:\..> geotiff2pgraster -h localhost -p 5432 -d postgis -U postgres -P data.tif(strored at this location only) tablename Kindly tell the remedy for the above problem and also is there any other way out to store raster data until now? Thanks in anticipation -- With Regards, Mukesh _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From gis.foster at gmail.com Mon Dec 7 19:08:50 2009 From: gis.foster at gmail.com (Bruce Foster) Date: Tue, 8 Dec 2009 08:38:50 +0530 Subject: [postgis-users] PostGIS vs Oracle Spatial/MS SQL2008 In-Reply-To: <44073894.124451259390217998.JavaMail.root@mail.thehumanjourney.net> References: <1219808224.124421259390104524.JavaMail.root@mail.thehumanjourney.net> <44073894.124451259390217998.JavaMail.root@mail.thehumanjourney.net> Message-ID: All, I was out on business trip. Thanks for the debate on the topic. I see lot of very valuable information and insights. It going to take a while for me to digest all the information and draw the fine line between the said DB's. Obviously, as I mentioned earlier, I'm more inclined to PostGIS as recommendation but need to justify that. Had a quick look at Bostongis comparison and that seems quite interesting. Thanks for for everyone who contributed. Will take few days to summarize the contributions. Thanks Bruce NSW Australia Bruce On Sat, Nov 28, 2009 at 12:06 PM, Chris Puttick wrote: > > I'm showing my bias here, but there is one major consideration your client should include: strategy. > > Obviously if they have a strategy that says "I don't care what it costs, now or in the future" they should choose the one with the most features right now, just in case the features are something they might use; or if they have a strategy that says "if Microsoft make it, we like it" (popular in the UK, that one), then MSSQL is the only option. > > But if they have a strategy that is interested in future choice and flexibility, about reducing costs in the long term, and/or a desire to reduce risk, then (if it right now has, or by the time the project has been implemented will have, the features they need) PostGIS is the best option. > > If of interest, the detail of how those strategic issues result in the open choice can be expanded upon. > > Regards > > Chris > > ----- postgis-users-request at postgis.refractions.net wrote: > >> Send postgis-users mailing list submissions to >> ? ? ? postgis-users at postgis.refractions.net >> >> Date: Fri, 27 Nov 2009 13:18:06 +0100 >> From: Peter Hopfgartner >> Subject: Re: [postgis-users] PostGIS vs Oracle Spatial/MS SQL2008 >> To: PostGIS Users Discussion >> Message-ID: <4B0FC37E.3070806 at r3-gis.com> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Based on my current project, I would split down the decision as: >> >> 1) Is there any know how on administering PostgreSQL or Oracle at your >> >> client side? >> >> The human factor is crucial. Databases are often vital and the >> confidence that you have in dumping/restoring/optimizing/planning >> deployment is an important factor. >> >> 2) Which tools will be used for accessing the database. PostGIS is >> typically better supported in Open Source tools. You can directly >> access >> PostGIS in QGIS, gvSIG, MapServer etc., whereas for Oracle you >> typically >> have to recompile (MapServer) or use some plugin (gvSIG), which may >> not >> be up to date, etc. >> >> 3) Which features do you need. Oracle has some features that might >> take >> it apart, among those are: robust topology implementation, routing >> (pgRouting is the PostGIS-based alternative), raster (will come with >> PostGIS in some future version), geography (earth as a sphere, instead >> >> as a plane, but will be included in the next version of PostGIS, >> too). >> >> 4) Which platform will host your database. If you run some common >> Linux >> distro, PostgreSQL/PostGIS is much better integrated and updating is a >> >> no minder. For running Oracle you will have to change some kernel >> parameters, disable SE-Linux and have some "blog" that lives completly >> >> outside of your well managed RPM packging. If you use some kind of >> Ubuntu, Oracle is not certified. On Windows, this is not an issue. >> >> My very personal ?impression is, that PostgreSQL/PostGIS has fewer >> features, but does them very well and I find it's SQL implementation >> more elegant ?and consistent. Oracle frequently feels like a >> many-tons-truck, which is ok, if you need a many-tons-truck. But not, >> if >> you are fine with a lighter vehicle. >> >> Peter >> Bruce Foster wrote: >> > Hi, >> > >> > I'm in middle of making a decision for a client of mine, where I'm >> > inclined to PostGIS. >> > >> > Now to convince the client, I really need to show the value that >> out >> > weight Oracle Spatial and MS SQL2008. We are not talking cost here, >> so >> > that option is not considered. >> > >> > I searched for some comparison on net but not much to my delight. >> So, >> > let me ask the user community and I really hope to get some >> > interesting facts about PostGIS so I can hold to my thesis with the >> > customer. >> > >> > a. Read somewhere on Topology. Hope someone throw more light on >> this. >> > b. Versioning, which is not available in Postgres >> > >> > On a related note, can we edit directly on PostGIS using MapInfo, >> > ArcGIS Desktop, AutoCad Map3D etc. >> > >> > uDIG, QGIS allow direct connectivity to PostGIS, hope they allow >> > direct file editing too. >> > >> > >> > >> -- >> >> Dott. Peter Hopfgartner >> >> R3 GIS Srl - GmbH >> Via Johann Kravogl-Str. 2 >> I-39012 Meran/Merano (BZ) >> Email: peter.hopfgartner at r3-gis.com >> Tel. : +39 0473 494949 >> Fax ?: +39 0473 069902 >> www ?: http://www.r3-gis.com >> > > > ------ > Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information. > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Thanks Bruce NSW Australia From lr at pcorp.us Mon Dec 7 19:37:33 2009 From: lr at pcorp.us (Paragon Corporation) Date: Mon, 7 Dec 2009 22:37:33 -0500 Subject: [postgis-users] Suggestion Needed In-Reply-To: <87A96661E65C5541AB4D20721C2DD7F84D014C7ED7@EXCH-MBX-A.ulaval.ca> References: <866185.97516.qm@web45913.mail.sp1.yahoo.com> <87A96661E65C5541AB4D20721C2DD7F84D014C7ED7@EXCH-MBX-A.ulaval.ca> Message-ID: <676DAF322ADD42998BEB03342DC7567B@A> FWIW for Windows users, we do have fairly recent compiled WKT Raster as of December 4th, 2009. Give it a try. I haven't had chance to try WKT Raster yet, but hopefully this will encourage people to give it a try. http://www.postgis.org/download/windows/experimental.php Hope that helps, Regina _____ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Pierre Racine Sent: Monday, December 07, 2009 3:27 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Mukesh, Sorry for the late answer. You can give a try to WKT Raster. You will have to compile it though. Loading Geotiff should then be straightforward using gdal2wktraster.py. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of mukesh karanwal Sent: 25 novembre 2009 06:30 To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Hi.. thanks for the reply. i did it but still it is showing the same error! I actually want to store a Geotiff file in the databse, could you please tell, is there any other way to do this? or where am i doing mistake, if any? Thanks --- On Tue, 11/24/09, Luigi Castro Cardeles wrote: From: Luigi Castro Cardeles Subject: Re: [postgis-users] Suggestion Needed To: "PostGIS Users Discussion" Date: Tuesday, November 24, 2009, 10:17 PM Hi, to "bypass" the password, you can make the .pgpass file and fill that with your connection params (hostname:port:database_name:user:password). If you are using windows, the path is: C:\Users\\AppData\Roaming\postgresql\.pgpass best regards Luigi Castro Cardeles 2009/11/24 mukesh karanwal > Hey Everyone, I am trying to store raster data in Postgis/PostgrSQL using "geotiff2pgrstaer.exe". but evertime i get an error that "when making connection to PostgreSQL: fe_sendauth: no password supplied", though i am supplying all the information. The command i am giving is like: C:\..> geotiff2pgraster -h localhost -p 5432 -d postgis -U postgres -P data.tif(strored at this location only) tablename Kindly tell the remedy for the above problem and also is there any other way out to store raster data until now? Thanks in anticipation -- With Regards, Mukesh _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steve.Toutant at inspq.qc.ca Tue Dec 8 06:46:36 2009 From: Steve.Toutant at inspq.qc.ca (Steve.Toutant at inspq.qc.ca) Date: Tue, 8 Dec 2009 09:46:36 -0500 Subject: [postgis-users] Suggestion Needed In-Reply-To: <676DAF322ADD42998BEB03342DC7567B@A> Message-ID: I know nothing about compiling, dll'S, etc.. So, I'm willing to try this. But My current version of postgres is 8.3 and postgis 1.3. I guess I need to upgrade to postgis 1.4. Should I upgrade postgres also? Is this procedure is the best and safest way to upgrade postgis? http://www.postgis.org/download/windows/index.php using stack builder. I only have one postgres server and users are using it, so I need a safe procedure to upgrade. thanks steve "Paragon Corporation" @postgis.refractions.net Envoy? par : postgis-users-bounces at postgis.refractions.net 07/12/2009 10:37 PM Veuillez r?pondre ? PostGIS Users Discussion A "'PostGIS Users Discussion'" cc Objet Re: [postgis-users] Suggestion Needed FWIW for Windows users, we do have fairly recent compiled WKT Raster as of December 4th, 2009. Give it a try. I haven't had chance to try WKT Raster yet, but hopefully this will encourage people to give it a try. http://www.postgis.org/download/windows/experimental.php Hope that helps, Regina From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Pierre Racine Sent: Monday, December 07, 2009 3:27 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Mukesh, Sorry for the late answer. You can give a try to WKT Raster. You will have to compile it though. Loading Geotiff should then be straightforward using gdal2wktraster.py. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of mukesh karanwal Sent: 25 novembre 2009 06:30 To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Hi.. thanks for the reply. i did it but still it is showing the same error! I actually want to store a Geotiff file in the databse, could you please tell, is there any other way to do this? or where am i doing mistake, if any? Thanks --- On Tue, 11/24/09, Luigi Castro Cardeles wrote: From: Luigi Castro Cardeles Subject: Re: [postgis-users] Suggestion Needed To: "PostGIS Users Discussion" Date: Tuesday, November 24, 2009, 10:17 PM Hi, to "bypass" the password, you can make the .pgpass file and fill that with your connection params (hostname:port:database_name:user:password). If you are using windows, the path is: C:\Users\\AppData\Roaming\postgresql\.pgpass best regards Luigi Castro Cardeles 2009/11/24 mukesh karanwal Hey Everyone, I am trying to store raster data in Postgis/PostgrSQL using " geotiff2pgrstaer.exe". but evertime i get an error that "when making connection to PostgreSQL: fe_sendauth: no password supplied", though i am supplying all the information. The command i am giving is like: C:\..> geotiff2pgraster -h localhost -p 5432 -d postgis -U postgres -P data.tif(strored at this location only) tablename Kindly tell the remedy for the above problem and also is there any other way out to store raster data until now? Thanks in anticipation -- With Regards, Mukesh _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxime at altribe.org Tue Dec 8 08:10:57 2009 From: maxime at altribe.org (Maxime van Noppen) Date: Tue, 08 Dec 2009 17:10:57 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> Message-ID: <4B1E7A91.4000106@altribe.org> Paul Ramsey wrote: > Last message from 2009, the videos of sessions have been linked into > the main website now and are all online, have a look, especially at > the State of PostGIS :) http://blip.tv/file/2788616/ Sydney was a > grand conference, I hope all you members of the PostGIS family are > working on your travel plans to head to Barcelona for 2010. I was thinking about your talk and I have question. I am quite interested by all the geography stuff. Do you consider having a generic geography support for other planets than earth ? -- Maxime From pramsey at opengeo.org Tue Dec 8 08:31:25 2009 From: pramsey at opengeo.org (Paul Ramsey) Date: Tue, 8 Dec 2009 08:31:25 -0800 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <4B1E7A91.4000106@altribe.org> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> Message-ID: <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> On Tue, Dec 8, 2009 at 8:10 AM, Maxime van Noppen wrote: > Paul Ramsey wrote: >> Last message from 2009, the videos of sessions have been linked into >> the main website now and are all online, have a look, especially at >> the State of PostGIS :) ?http://blip.tv/file/2788616/ ? Sydney was a >> grand conference, I hope all you members of the PostGIS family are >> working on your travel plans to head to Barcelona for 2010. > > I was thinking about your talk and I have question. I am quite > interested by all the geography stuff. Do you consider having a generic > geography support for other planets than earth ? Other planets could be handled when arbitrary SRID values are allowed. So, it's an obvious extension, but one which someone is going to probably have to step up and fund. However, even with the current version, you could support Mars or Venus at compile time, easily enough, by altering the constants for major- and semi-major- axis before building PostGIS. P. From maxime at altribe.org Tue Dec 8 08:39:06 2009 From: maxime at altribe.org (Maxime van Noppen) Date: Tue, 08 Dec 2009 17:39:06 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> Message-ID: <4B1E812A.1030707@altribe.org> Paul Ramsey wrote: > Other planets could be handled when arbitrary SRID values are allowed. > So, it's an obvious extension, but one which someone is going to > probably have to step up and fund. However, even with the current > version, you could support Mars or Venus at compile time, easily > enough, by altering the constants for major- and semi-major- axis > before building PostGIS. I'm a game developer and my company works on world-wide strategy games. But the planets where the action takes place are completely fictive and we have a planet generator. So it would be interesting for us to be able to teach PostGIS about our new planets at runtime. Currently we're working with a projected view of the world and we're very happy with that. Though we expect the need for the generic geography support to arise by 2011. -- Maxime From Pierre.Racine at sbf.ulaval.ca Tue Dec 8 09:16:58 2009 From: Pierre.Racine at sbf.ulaval.ca (Pierre Racine) Date: Tue, 8 Dec 2009 12:16:58 -0500 Subject: [postgis-users] Suggestion Needed In-Reply-To: References: <676DAF322ADD42998BEB03342DC7567B@A> Message-ID: <87A96661E65C5541AB4D20721C2DD7F84D014C7F32@EXCH-MBX-A.ulaval.ca> Salut Steve, I would first give it a try with PostGIS 1.3... Let me know if it works. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: 8 d?cembre 2009 09:47 To: PostGIS Users Discussion Cc: 'PostGIS Users Discussion'; postgis-users-bounces at postgis.refractions.net Subject: Re: [postgis-users] Suggestion Needed I know nothing about compiling, dll'S, etc.. So, I'm willing to try this. But My current version of postgres is 8.3 and postgis 1.3. I guess I need to upgrade to postgis 1.4. Should I upgrade postgres also? Is this procedure is the best and safest way to upgrade postgis? http://www.postgis.org/download/windows/index.php using stack builder. I only have one postgres server and users are using it, so I need a safe procedure to upgrade. thanks steve "Paragon Corporation" @postgis.refractions.net Envoy? par : postgis-users-bounces at postgis.refractions.net 07/12/2009 10:37 PM Veuillez r?pondre ? PostGIS Users Discussion A "'PostGIS Users Discussion'" cc Objet Re: [postgis-users] Suggestion Needed FWIW for Windows users, we do have fairly recent compiled WKT Raster as of December 4th, 2009. Give it a try. I haven't had chance to try WKT Raster yet, but hopefully this will encourage people to give it a try. http://www.postgis.org/download/windows/experimental.php Hope that helps, Regina ________________________________ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Pierre Racine Sent: Monday, December 07, 2009 3:27 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Mukesh, Sorry for the late answer. You can give a try to WKT Raster. You will have to compile it though. Loading Geotiff should then be straightforward using gdal2wktraster.py. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of mukesh karanwal Sent: 25 novembre 2009 06:30 To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Hi.. thanks for the reply. i did it but still it is showing the same error! I actually want to store a Geotiff file in the databse, could you please tell, is there any other way to do this? or where am i doing mistake, if any? Thanks --- On Tue, 11/24/09, Luigi Castro Cardeles wrote: From: Luigi Castro Cardeles Subject: Re: [postgis-users] Suggestion Needed To: "PostGIS Users Discussion" Date: Tuesday, November 24, 2009, 10:17 PM Hi, to "bypass" the password, you can make the .pgpass file and fill that with your connection params (hostname:port:database_name:user:password). If you are using windows, the path is: C:\Users\\AppData\Roaming\postgresql\.pgpass best regards Luigi Castro Cardeles 2009/11/24 mukesh karanwal > Hey Everyone, I am trying to store raster data in Postgis/PostgrSQL using "geotiff2pgrstaer.exe". but evertime i get an error that "when making connection to PostgreSQL: fe_sendauth: no password supplied", though i am supplying all the information. The command i am giving is like: C:\..> geotiff2pgraster -h localhost -p 5432 -d postgis -U postgres -P data.tif(strored at this location only) tablename Kindly tell the remedy for the above problem and also is there any other way out to store raster data until now? Thanks in anticipation -- With Regards, Mukesh _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From pramsey at opengeo.org Tue Dec 8 10:01:38 2009 From: pramsey at opengeo.org (Paul Ramsey) Date: Tue, 8 Dec 2009 10:01:38 -0800 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <4B1E812A.1030707@altribe.org> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> <4B1E812A.1030707@altribe.org> Message-ID: <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> Well, if they're fictive, then there's no reason you can't use WGS84. Fun, who gets to be Slartibartfast and design your world :) P On Tue, Dec 8, 2009 at 8:39 AM, Maxime van Noppen wrote: > Paul Ramsey wrote: >> Other planets could be handled when arbitrary SRID values are allowed. >> So, it's an obvious extension, but one which someone is going to >> probably have to step up and fund. However, even with the current >> version, you could support Mars or Venus at compile time, easily >> enough, by altering the constants for major- and semi-major- axis >> before building PostGIS. > > I'm a game developer and my company works on world-wide strategy games. > But the planets where the action takes place are completely fictive and > we have a planet generator. So it would be interesting for us to be able > to teach PostGIS about our new planets at runtime. > > Currently we're working with a projected view of the world and we're > very happy with that. Though we expect the need for the generic > geography support to arise by 2011. > > -- > Maxime > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From maxime at altribe.org Tue Dec 8 10:01:10 2009 From: maxime at altribe.org (Maxime van Noppen) Date: Tue, 08 Dec 2009 19:01:10 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> <4B1E812A.1030707@altribe.org> <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> Message-ID: <4B1E9466.7090504@altribe.org> Paul Ramsey wrote: > Well, if they're fictive, then there's no reason you can't use WGS84. > Fun, who gets to be Slartibartfast and design your world :) I don't get the point. Doesn't WGS84 only apply to the Earth ? -- Maxime From graham.rick at gmail.com Tue Dec 8 10:27:55 2009 From: graham.rick at gmail.com (Rick) Date: Tue, 8 Dec 2009 13:27:55 -0500 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <4B1E9466.7090504@altribe.org> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> <4B1E812A.1030707@altribe.org> <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> <4B1E9466.7090504@altribe.org> Message-ID: <18569e000912081027j387db8a0lb8452bca4cbbe68f@mail.gmail.com> WGS84 defines an ellipsoid that is used for a reference to approximate the shape of the earth. If you are talking about a fictional planet, you can use anything, a sphere. A real planet, at least one that is out of round enough, and with data good enough, for the data available to be in error, will have to have it's own ellipsoid defined. (A sphere would probably do for most of these for some time to come as well) Your problem would be the radius, unless all your planets are the same size. But you could do a scaling fixup fairly easily (I believe) to server your purposes. On Tue, Dec 8, 2009 at 1:01 PM, Maxime van Noppen wrote: > Paul Ramsey wrote: >> Well, if they're fictive, then there's no reason you can't use WGS84. >> Fun, who gets to be Slartibartfast and design your world :) > > I don't get the point. Doesn't WGS84 only apply to the Earth ? > > -- > Maxime > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Cheers! Rick From maxime at altribe.org Tue Dec 8 10:38:12 2009 From: maxime at altribe.org (Maxime van Noppen) Date: Tue, 08 Dec 2009 19:38:12 +0100 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <18569e000912081027j387db8a0lb8452bca4cbbe68f@mail.gmail.com> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> <4B1E812A.1030707@altribe.org> <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> <4B1E9466.7090504@altribe.org> <18569e000912081027j387db8a0lb8452bca4cbbe68f@mail.gmail.com> Message-ID: <4B1E9D14.7020905@altribe.org> Rick wrote: > WGS84 defines an ellipsoid that is used for a reference to approximate > the shape of the earth. If you are talking about a fictional planet, > you can use anything, a sphere. > > A real planet, at least one that is out of round enough, and with data > good enough, for the data available to be in error, will have to have > it's own ellipsoid defined. (A sphere would probably do for most of > these for some time to come as well) Hmmm, ok. > Your problem would be the radius, unless all your planets are the same > size. But you could do a scaling fixup fairly easily (I believe) to > server your purposes. They have different radiuses indeed. I'll investigate a bit more the question. When we made our technical choices more than a year ago PostGIS/Geos didn't seem to be as comfortable with spheric coordinates than with plain cartesian ones. For example this post : http://lin-ear-th-inking.blogspot.com/2007/09/geodetic-data-in-postgis-spherical.html -- Maxime From lr at pcorp.us Tue Dec 8 11:49:40 2009 From: lr at pcorp.us (Paragon Corporation) Date: Tue, 8 Dec 2009 14:49:40 -0500 Subject: [postgis-users] Suggestion Needed In-Reply-To: <87A96661E65C5541AB4D20721C2DD7F84D014C7F32@EXCH-MBX-A.ulaval.ca> References: <676DAF322ADD42998BEB03342DC7567B@A> <87A96661E65C5541AB4D20721C2DD7F84D014C7F32@EXCH-MBX-A.ulaval.ca> Message-ID: <139A179248DB4D949B152729F7CB4383@b> Steve, I think the binaries we have compiled for 8.3 and 8.4 should work with 1.3 since as I recall, I don't think there is any binary dependency between PostGIS and WKT Raster. So give those experimental ones a try with your 1.3 install. But use the one that says for PostgreSQL 8.3 http://www.postgis.org/download/windows/experimental.php To answer your question -- yes Stack Builder is the safest upgrade path and PostGIS 1.3 and PostGIS 1.4 can coexist on Windows -- so if you wanted to give PostGIS 1.4 a try on a new database, you can install that as well and it won't mess up your existing PostGIS 1.3 installs. I have both running on my servers in different databases. Hope that helps, Regina _____ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Pierre Racine Sent: Tuesday, December 08, 2009 12:17 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Salut Steve, I would first give it a try with PostGIS 1.3 Let me know if it works. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Steve.Toutant at inspq.qc.ca Sent: 8 d?cembre 2009 09:47 To: PostGIS Users Discussion Cc: 'PostGIS Users Discussion'; postgis-users-bounces at postgis.refractions.net Subject: Re: [postgis-users] Suggestion Needed I know nothing about compiling, dll'S, etc.. So, I'm willing to try this. But My current version of postgres is 8.3 and postgis 1.3. I guess I need to upgrade to postgis 1.4. Should I upgrade postgres also? Is this procedure is the best and safest way to upgrade postgis? http://www.postgis.org/download/windows/index.php using stack builder. I only have one postgres server and users are using it, so I need a safe procedure to upgrade. thanks steve "Paragon Corporation" @postgis.refractions.net Envoy? par : postgis-users-bounces at postgis.refractions.net 07/12/2009 10:37 PM Veuillez r?pondre ? PostGIS Users Discussion A "'PostGIS Users Discussion'" cc Objet Re: [postgis-users] Suggestion Needed FWIW for Windows users, we do have fairly recent compiled WKT Raster as of December 4th, 2009. Give it a try. I haven't had chance to try WKT Raster yet, but hopefully this will encourage people to give it a try. http://www.postgis.org/download/windows/experimental.php Hope that helps, Regina _____ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Pierre Racine Sent: Monday, December 07, 2009 3:27 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Mukesh, Sorry for the late answer. You can give a try to WKT Raster. You will have to compile it though. Loading Geotiff should then be straightforward using gdal2wktraster.py. Pierre From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of mukesh karanwal Sent: 25 novembre 2009 06:30 To: PostGIS Users Discussion Subject: Re: [postgis-users] Suggestion Needed Hi.. thanks for the reply. i did it but still it is showing the same error! I actually want to store a Geotiff file in the databse, could you please tell, is there any other way to do this? or where am i doing mistake, if any? Thanks --- On Tue, 11/24/09, Luigi Castro Cardeles wrote: From: Luigi Castro Cardeles Subject: Re: [postgis-users] Suggestion Needed To: "PostGIS Users Discussion" Date: Tuesday, November 24, 2009, 10:17 PM Hi, to "bypass" the password, you can make the .pgpass file and fill that with your connection params (hostname:port:database_name:user:password). If you are using windows, the path is: C:\Users\\AppData\Roaming\postgresql\.pgpass best regards Luigi Castro Cardeles 2009/11/24 mukesh karanwal > Hey Everyone, I am trying to store raster data in Postgis/PostgrSQL using "geotiff2pgrstaer.exe". but evertime i get an error that "when making connection to PostgreSQL: fe_sendauth: no password supplied", though i am supplying all the information. The command i am giving is like: C:\..> geotiff2pgraster -h localhost -p 5432 -d postgis -U postgres -P data.tif(strored at this location only) tablename Kindly tell the remedy for the above problem and also is there any other way out to store raster data until now? Thanks in anticipation -- With Regards, Mukesh _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerry.creager at tamu.edu Tue Dec 8 12:20:10 2009 From: gerry.creager at tamu.edu (Gerald Creager) Date: Tue, 08 Dec 2009 14:20:10 -0600 Subject: [postgis-users] FOSS4G 2009 Videos In-Reply-To: <4B1E9466.7090504@altribe.org> References: <30fe546d0912070800o33cd2d95m30e1adfbea79ac1a@mail.gmail.com> <4B1E7A91.4000106@altribe.org> <30fe546d0912080831v4beee424x76821bc435a657a3@mail.gmail.com> <4B1E812A.1030707@altribe.org> <30fe546d0912081001q2b81cbe4kb5c76fd20082a617@mail.gmail.com> <4B1E9466.7090504@altribe.org> Message-ID: <4B1EB4FA.6060600@tamu.edu> I guess, if your planet was appropriately sized and oriented, you could use WGS84 with another body... gerry Maxime van Noppen wrote: > Paul Ramsey wrote: >> Well, if they're fictive, then there's no reason you can't use WGS84. >> Fun, who gets to be Slartibartfast and design your world :) > > I don't get the point. Doesn't WGS84 only apply to the Earth ? > From pschweitzer at usgs.gov Tue Dec 8 20:01:43 2009 From: pschweitzer at usgs.gov (Peter N. Schweitzer) Date: Tue, 08 Dec 2009 23:01:43 -0500 Subject: [postgis-users] Trouble after upgrade to 1.4.0 Message-ID: <4B1F2127.6090400@usgs.gov> I just upgraded from 8.3.7/1.3.5 to 8.4.1/1.4.0 I now get an error when running the following query: select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom),4267),3395)) from ingeol_poly ERROR: function st_setsrid(box3d_extent, integer) does not exist LINE 1: select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom),... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. But I can do a number of ST_ functions, and mapserver seems to work with postgis/postgresql. So I assume I'm using the wrong combination of magic words to get the information I want from the database. What I'm trying to do is get the extent, in mercator, of all of the polygons in a layer "ingeol_poly" whose native coordinate system is geographic NAD27. Corrections of my misunderstanding would be very helpful! Here's the postgis_full_version(): sgmc=# select postgis_full_version(); POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS Peter -- Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192) (703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov From lr at pcorp.us Tue Dec 8 20:56:53 2009 From: lr at pcorp.us (Paragon Corporation) Date: Tue, 8 Dec 2009 23:56:53 -0500 Subject: [postgis-users] Trouble after upgrade to 1.4.0 In-Reply-To: <4B1F2127.6090400@usgs.gov> References: <4B1F2127.6090400@usgs.gov> Message-ID: <68547A33261D49A3BEC1EEA28D941D7E@A> Peter, No,but it looks like you are just being bitten by the missing autocast in the upgrade script which I think we have fixed in 1.4.1 See my comment here http://trac.osgeo.org/postgis/ticket/223 So short answer -- your problems should be solved if you run the below CREATE CAST (box3d_extent AS box3d) WITH FUNCTION st_box3d_extent(box3d_extent) AS IMPLICIT; There is another problem I ran into I describe which hopefully I'm the only one in the world affected by this other change. Thanks, Regina -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Peter N. Schweitzer Sent: Tuesday, December 08, 2009 11:02 PM To: postgis-users at lists.refractions.net Subject: [postgis-users] Trouble after upgrade to 1.4.0 I just upgraded from 8.3.7/1.3.5 to 8.4.1/1.4.0 I now get an error when running the following query: select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom),4267),3395)) from ingeol_poly ERROR: function st_setsrid(box3d_extent, integer) does not exist LINE 1: select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom),... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. But I can do a number of ST_ functions, and mapserver seems to work with postgis/postgresql. So I assume I'm using the wrong combination of magic words to get the information I want from the database. What I'm trying to do is get the extent, in mercator, of all of the polygons in a layer "ingeol_poly" whose native coordinate system is geographic NAD27. Corrections of my misunderstanding would be very helpful! Here's the postgis_full_version(): sgmc=# select postgis_full_version(); POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS Peter -- Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192) (703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From helpmisterx at googlemail.com Wed Dec 9 04:31:50 2009 From: helpmisterx at googlemail.com (MisterX) Date: Wed, 9 Dec 2009 13:31:50 +0100 Subject: [postgis-users] shp2pgsql option -k Message-ID: <2119adb60912090431m5268accdkf4eca77b83510a0@mail.gmail.com> Hi everybody, I'm a question for use the shp2pgsql loader. Have anybody an example for the option -k. How can I use this option? Thank you very much for your answer. Greating MisterX -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.diericx at natuurpunt.be Wed Dec 9 05:31:16 2009 From: christophe.diericx at natuurpunt.be (Christophe Diericx) Date: Wed, 9 Dec 2009 14:31:16 +0100 Subject: [postgis-users] invalid geometry crashes postgres when trying to use buffer Message-ID: <974EAA0F18CB944EA1751F245E4714AD03B4B452@gandalf.natuurpunt.be> Hello everyone, Issuing the following query (while trying to repair an invalid geometry): ** select buffer(ST_GeomFromText('mypoly',32767),0) crashes postgresql hard (extract from the postgresql error-log here: http://paste.pocoo.org/show/155923/). 'mypoly' can be seen here: http://paste.pocoo.org/show/155921/. 32767 corresponds to the following proj4 string: "+proj=lcc +lat_1=49.8333333333 +lat_2=51.1666666667 +lat_0=90 +lon_0=4.3569397222 +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl +towgs84=81,120,129,0,0,0,0 +units=m +no_defs" Some more information about my setup: -- select postgis_full_version() "POSTGIS="1.3.5" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.6.0, 21 Dec 2007" USE_STATS" -- select version() "PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)" Is this a known issue and is this fixed in later builds? Does anyone have an idea for a workaround with my current versions? Thanks in advance for all reactions! Christophe From daniel.grum at unibw.de Wed Dec 9 05:48:55 2009 From: daniel.grum at unibw.de (Daniel Grum) Date: Wed, 09 Dec 2009 14:48:55 +0100 Subject: [postgis-users] problems with the postgis functions ST_BuildArea(), St_Collect() and ST_Union() Message-ID: <4B1FAAC7.8040602@unibw.de> Hi, I want to create an fog of war. I use a start-polygon and in this should be the area screened transparent where the user has build some buildings. Here is the SQL-script that works if the user has a building of every building-type but if he only has an "haupthaus" no geom will be created???!!! But at the beginning the user only has the building: haupthaus-->and for this starting situation a fog of war has to be created. UPDATE fog_of_war SET the_geom = (SELECT ST_BuildArea(St_Collect(grenze_by.the_geom,ST_Union( ST_Union(ST_Union( ST_Union(ST_Union(ST_Expand(holzfaeller.the_geom, 2000)), ST_Union(ST_Expand(steinbruch.the_geom,2000))), ST_Union(ST_Union(ST_Expand(erzmine.the_geom, 2000)), ST_Union(ST_Expand(kaserne.the_geom,2000)))), ST_Union( ST_Union(ST_Union(ST_Expand(wohnhaus.the_geom, 2000)), ST_Union(ST_Expand(saegewerk.the_geom,2000))), ST_Union(ST_Union(ST_Expand(strassen.the_geom, 1000)), ST_Union(ST_Expand(haupthaus.the_geom,6000))))), ST_Union( ST_Union(ST_Expand(wachturm.the_geom, 3000)), ST_Union(ST_Expand(lager.the_geom,2000)))))) FROM public.grenze_by grenze_by,public.holzfaeller holzfaeller, public.steinbruch steinbruch,public.erzmine erzmine,public.kaserne kaserne, public.wohnhaus wohnhaus, public.saegewerk saegewerk, public.strassen strassen, public.haupthaus haupthaus, public.lager lager,public.wachturm wachturm GROUP BY grenze_by.the_geom); I know that the functions are very convoluted, but for me there is no other way to union/collect the different areas of the buildings. Please give me some tips how I can solve the problem? Are there other PostGIS functions that can solve this problem better than the function st_union? Thanks, --daniel From pschweitzer at usgs.gov Wed Dec 9 06:56:22 2009 From: pschweitzer at usgs.gov (Peter N. Schweitzer) Date: Wed, 09 Dec 2009 09:56:22 -0500 Subject: [postgis-users] Trouble after upgrade to 1.4.0 In-Reply-To: <68547A33261D49A3BEC1EEA28D941D7E@A> References: <4B1F2127.6090400@usgs.gov> <68547A33261D49A3BEC1EEA28D941D7E@A> Message-ID: <4B1FBA96.2040000@usgs.gov> Paragon Corporation wrote: > No,but it looks like you are just being bitten by the missing autocast in > the upgrade script which I think we have fixed in 1.4.1 > > See my comment here > http://trac.osgeo.org/postgis/ticket/223 > > So short answer -- your problems should be solved if you run the below > > CREATE CAST (box3d_extent AS box3d) > > WITH FUNCTION st_box3d_extent(box3d_extent) AS IMPLICIT; > > There is another problem I ran into I describe which hopefully I'm the only > one in the world affected by this other change. Regina, Thanks for the pointer. I could execute that create cast function but that didn't eliminate the error. Following a comment in the ticket, I now write select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom)::box3d,4267),3395)) from and this works without error. Is this what you would expect? Peter -- Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192) (703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov From lr at pcorp.us Wed Dec 9 07:26:54 2009 From: lr at pcorp.us (Paragon Corporation) Date: Wed, 9 Dec 2009 10:26:54 -0500 Subject: [postgis-users] Trouble after upgrade to 1.4.0 In-Reply-To: <4B1FBA96.2040000@usgs.gov> References: <4B1F2127.6090400@usgs.gov> <68547A33261D49A3BEC1EEA28D941D7E@A> <4B1FBA96.2040000@usgs.gov> Message-ID: <4A1E6C3E5929463E9AEA1C00AE8B6B6C@A> Peter, There was another missing cast. Try this one CREATE CAST (box3d_extent AS geometry) WITH FUNCTION st_geometry(box3d_extent) AS IMPLICIT; Leo -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Peter N. Schweitzer Sent: Wednesday, December 09, 2009 9:56 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Trouble after upgrade to 1.4.0 Paragon Corporation wrote: > No,but it looks like you are just being bitten by the missing autocast > in the upgrade script which I think we have fixed in 1.4.1 > > See my comment here > http://trac.osgeo.org/postgis/ticket/223 > > So short answer -- your problems should be solved if you run the below > > CREATE CAST (box3d_extent AS box3d) > > WITH FUNCTION st_box3d_extent(box3d_extent) AS IMPLICIT; > > There is another problem I ran into I describe which hopefully I'm the > only one in the world affected by this other change. Regina, Thanks for the pointer. I could execute that create cast function but that didn't eliminate the error. Following a comment in the ticket, I now write select ST_Box2d(ST_Transform(ST_SetSRID(ST_Extent(the_geom)::box3d,4267),3395)) from and this works without error. Is this what you would expect? Peter -- Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192) (703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From satish_m at hotmail.com Wed Dec 9 07:48:52 2009 From: satish_m at hotmail.com (Satish Murthy) Date: Wed, 9 Dec 2009 15:48:52 +0000 Subject: [postgis-users] ST_INTERSECT returns false, but should return true In-Reply-To: <4A1E6C3E5929463E9AEA1C00AE8B6B6C@A> References: <4B1F2127.6090400@usgs.gov> <68547A33261D49A3BEC1EEA28D941D7E@A>, <4B1FBA96.2040000@usgs.gov>, <4A1E6C3E5929463E9AEA1C00AE8B6B6C@A> Message-ID: I can't figure out why this is happening: This works, returning true: SELECT Intersects( GeomFromEWKT('MULTILINESTRING((-26.9599999999939 -29.97 1 0,-26.9399999999976 -29.99 2 0),(-25.8599999999937 -29.97 1 0,-26.9399999999976 -29.99 2 0))'), GeomFromEWKT('POINT(-26.9599999999939 -29.97 1 0)')) ; If I select the same as geometries, it returns false SELECT ST_Intersects( (select geom1 from tab), (select geom2 from tab)) ; Weird thing is, select ST_DISTANCE (geom1, geom2) returns 3.51700710773038e-14 This behavior is not consistent - sometimes ST_INTERSECTS returns true correctly. What is the problem here. Thanks, Satish _________________________________________________________________ Windows 7: Simplify what you do everyday. Find the right PC for you. http://windows.microsoft.com/shop -------------- next part -------------- An HTML attachment was scrubbed... URL: From satish_m at hotmail.com Wed Dec 9 08:27:33 2009 From: satish_m at hotmail.com (Satish Murthy) Date: Wed, 9 Dec 2009 16:27:33 +0000 Subject: [postgis-users] ST_INTERSECT returns false, but should return true Message-ID: Hi, I can't figure out why this is happening: This works, returning true: SELECT Intersects( GeomFromEWKT('MULTILINESTRING((-26.9599999999939 -29.97 1 0,-26.9399999999976 -29.99 2 0),(-25.8599999999937 -29.97 1 0,-26.9399999999976 -29.99 2 0))'), GeomFromEWKT('POINT(-26.9599999999939 -29.97 1 0)')) ; If I select the same as geometries, it returns false SELECT ST_Intersects( (select geom1 from tab), (select geom2 from tab)) ; Weird thing is, select ST_DISTANCE (geom1, geom2) returns 3.51700710773038e-14 This behavior is not consistent - sometimes ST_INTERSECTS returns true correctly. Can anyone suggest what might be the problem here? Thanks, Satish _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Wed Dec 9 09:26:19 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Wed, 09 Dec 2009 09:26:19 -0800 Subject: [postgis-users] invalid geometry crashes postgres when trying to use buffer In-Reply-To: <974EAA0F18CB944EA1751F245E4714AD03B4B452@gandalf.natuurpunt.be> References: <974EAA0F18CB944EA1751F245E4714AD03B4B452@gandalf.natuurpunt.be> Message-ID: <4B1FDDBB.3010404@refractions.net> Try reducing the precision of your geometry. PostGIS doesn't actually have a precision reducer function yet, but ST_SnapToGrid comes close. -- Kevin Christophe Diericx wrote: > Hello everyone, > > Issuing the following query (while trying to repair an invalid > geometry): > > ** select buffer(ST_GeomFromText('mypoly',32767),0) > > crashes postgresql hard (extract from the postgresql error-log here: > http://paste.pocoo.org/show/155923/). > > 'mypoly' can be seen here: http://paste.pocoo.org/show/155921/. > > 32767 corresponds to the following proj4 string: "+proj=lcc > +lat_1=49.8333333333 +lat_2=51.1666666667 +lat_0=90 +lon_0=4.3569397222 > +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl > +towgs84=81,120,129,0,0,0,0 +units=m +no_defs" > > Some more information about my setup: > > -- select postgis_full_version() > "POSTGIS="1.3.5" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.6.0, 21 Dec 2007" > USE_STATS" > -- select version() > "PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.4 > (Ubuntu 4.2.4-1ubuntu3)" > > Is this a known issue and is this fixed in later builds? > > Does anyone have an idea for a workaround with my current versions? > > Thanks in advance for all reactions! > > Christophe > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Wed Dec 9 09:56:50 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Wed, 09 Dec 2009 09:56:50 -0800 Subject: [postgis-users] shp2pgsql option -k In-Reply-To: <2119adb60912090431m5268accdkf4eca77b83510a0@mail.gmail.com> References: <2119adb60912090431m5268accdkf4eca77b83510a0@mail.gmail.com> Message-ID: <4B1FE4E2.3010009@refractions.net> You should be able to specify it like any of the other options. http://postgis.refractions.net/documentation/manual-1.5SVN/ch04.html#shp2pgsql_usage -- Kevin MisterX wrote: > Hi everybody, > > I'm a question for use the shp2pgsql loader. > Have anybody an example for the option -k. > How can I use this option? > > Thank you very much for your answer. > > Greating MisterX > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From pschweitzer at usgs.gov Wed Dec 9 11:37:49 2009 From: pschweitzer at usgs.gov (Peter N. Schweitzer) Date: Wed, 09 Dec 2009 14:37:49 -0500 Subject: [postgis-users] Trouble after upgrade to 1.4.0 In-Reply-To: <4A1E6C3E5929463E9AEA1C00AE8B6B6C@A> References: <4B1F2127.6090400@usgs.gov> <68547A33261D49A3BEC1EEA28D941D7E@A> <4B1FBA96.2040000@usgs.gov> <4A1E6C3E5929463E9AEA1C00AE8B6B6C@A> Message-ID: <4B1FFC8D.2050402@usgs.gov> Paragon Corporation wrote: > There was another missing cast. > > CREATE CAST (box3d_extent AS geometry) > WITH FUNCTION st_geometry(box3d_extent) > AS IMPLICIT; Leo, That did the trick. Thanks! Peter -- Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192) (703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov From lr at pcorp.us Wed Dec 9 17:29:48 2009 From: lr at pcorp.us (Paragon Corporation) Date: Wed, 9 Dec 2009 20:29:48 -0500 Subject: [postgis-users] ST_INTERSECT returns false, but should return true In-Reply-To: References: Message-ID: <0BA15F8511284ABAB1D2C7C8DC523407@b> Satish, AsText and AsEWKT only show the first 15 or 16 digits so I suspect your real geometries have more digits and are really off by a small amount. To be sure use the ST_AsHexEWKB representation of the ST_AsEWKT instead of and you will see the distance is probably > 0 but very small. Leo _____ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Satish Murthy Sent: Wednesday, December 09, 2009 11:28 AM To: postgis-users at postgis.refractions.net Subject: [postgis-users] ST_INTERSECT returns false, but should return true Hi, I can't figure out why this is happening: This works, returning true: SELECT Intersects( GeomFromEWKT('MULTILINESTRING((-26.9599999999939 -29.97 1 0,-26.9399999999976 -29.99 2 0),(-25.8599999999937 -29.97 1 0,-26.9399999999976 -29.99 2 0))'), GeomFromEWKT('POINT(-26.9599999999939 -29.97 1 0)')) ; If I select the same as geometries, it returns false SELECT ST_Intersects( (select geom1 from tab), (select geom2 from tab)) ; Weird thing is, select ST_DISTANCE (geom1, geom2) returns 3.51700710773038e-14 This behavior is not consistent - sometimes ST_INTERSECTS returns true correctly. Can anyone suggest what might be the problem here? Thanks, Satish _____ New Windows 7: Find the right PC for you. Learn more. -------------- next part -------------- An HTML attachment was scrubbed... URL: From helpmisterx at googlemail.com Thu Dec 10 01:23:14 2009 From: helpmisterx at googlemail.com (MisterX) Date: Thu, 10 Dec 2009 10:23:14 +0100 Subject: [postgis-users] shp2pgsql Message-ID: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> Hi, my problem is, that i have a database table with two columns with the name klassen ant the_geom. In my shapefile the columns called text and the_geom. Now I want to append the shapefile on the database table, but how can I tell the shapeloader that the column text affiliate to the colum klassen? shapefile database Table --> text --> klassen --> the_geom --> the_geom Can anybody help me with this problem? Thank you very much. MisterX -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.diericx at natuurpunt.be Thu Dec 10 01:48:00 2009 From: christophe.diericx at natuurpunt.be (Christophe Diericx) Date: Thu, 10 Dec 2009 10:48:00 +0100 Subject: [postgis-users] invalid geometry crashes postgres when trying to use buffer In-Reply-To: <4B1FDDBB.3010404@refractions.net> References: <974EAA0F18CB944EA1751F245E4714AD03B4B452@gandalf.natuurpunt.be> <4B1FDDBB.3010404@refractions.net> Message-ID: <974EAA0F18CB944EA1751F245E4714AD03B4B661@gandalf.natuurpunt.be> Thanks a lot, this seems to work fine as a workaround. Anyone know if this exact problem persists in current versions of postgis (could be an incentive to upgrade)? Christophe -----Oorspronkelijk bericht----- Van: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] Namens Kevin Neufeld Verzonden: woensdag 9 december 2009 18:26 Aan: PostGIS Users Discussion Onderwerp: Re: [postgis-users] invalid geometry crashes postgres when trying to use buffer Try reducing the precision of your geometry. PostGIS doesn't actually have a precision reducer function yet, but ST_SnapToGrid comes close. -- Kevin Christophe Diericx wrote: > Hello everyone, > > Issuing the following query (while trying to repair an invalid > geometry): > > ** select buffer(ST_GeomFromText('mypoly',32767),0) > > crashes postgresql hard (extract from the postgresql error-log here: > http://paste.pocoo.org/show/155923/). > > 'mypoly' can be seen here: http://paste.pocoo.org/show/155921/. > > 32767 corresponds to the following proj4 string: "+proj=lcc > +lat_1=49.8333333333 +lat_2=51.1666666667 +lat_0=90 > ++lon_0=4.3569397222 > +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl > +towgs84=81,120,129,0,0,0,0 +units=m +no_defs" > > Some more information about my setup: > > -- select postgis_full_version() > "POSTGIS="1.3.5" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.6.0, 21 Dec 2007" > USE_STATS" > -- select version() > "PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.4 > (Ubuntu 4.2.4-1ubuntu3)" > > Is this a known issue and is this fixed in later builds? > > Does anyone have an idea for a workaround with my current versions? > > Thanks in advance for all reactions! > > Christophe > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From nicolas.gillet at market-ip.com Thu Dec 10 02:00:31 2009 From: nicolas.gillet at market-ip.com (Nicolas Gillet - MARKET-IP) Date: Thu, 10 Dec 2009 11:00:31 +0100 Subject: [postgis-users] shp2pgsql In-Reply-To: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> Message-ID: <003001ca797f$9c32e8b0$d498ba10$@gillet@market-ip.com> Hello, You could temporary rename your database column to match the shape?s column name. Then if your column need to be called ?Klassen? for other use, you can rename it back to ?Klassen? or whatever name you need. Hope it helps Nicolas. De : postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de MisterX Envoy? : jeudi 10 d?cembre 2009 10:23 ? : postgis-users at postgis.refractions.net Objet : [postgis-users] shp2pgsql Hi, my problem is, that i have a database table with two columns with the name klassen ant the_geom. In my shapefile the columns called text and the_geom. Now I want to append the shapefile on the database table, but how can I tell the shapeloader that the column text affiliate to the colum klassen? shapefile database Table --> text --> klassen --> the_geom --> the_geom Can anybody help me with this problem? Thank you very much. MisterX -------------- next part -------------- An HTML attachment was scrubbed... URL: From gdt at ir.bbn.com Thu Dec 10 05:55:29 2009 From: gdt at ir.bbn.com (Greg Troxel) Date: Thu, 10 Dec 2009 08:55:29 -0500 Subject: [postgis-users] PostGIS 1.4.1rc2 References: <30fe546d0911281632r7aeaad78kdc761a15ffc67f3a@mail.gmail.com> Message-ID: I'm continuing to work on packaging 1.4.1rc2 for pkgsrc, this time on NetBSD (to avoid Mac shlib oddness until everything else is ok). I am building against postgresql 8.4. I have a few observations/questions: * The postgis library is installed as -rw-r--r-- 1 root wheel 552868 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.a -rwxr-xr-x 1 root wheel 926 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.la lrwxr-xr-x 1 root wheel 23 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so -> libpostgis-1.4.so.0.0.0 lrwxr-xr-x 1 root wheel 23 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so.0 -> libpostgis-1.4.so.0.0.0 -rwxr-xr-x 1 root wheel 268310 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so.0.0.0 which is autoconf default $(libdir) for --prefix=/usr/pkg. But pg_config --pkglibdir is $ pg_config --pkglibdir /usr/pkg/lib/postgresql and configure was invoked: ./configure --enable-rpath --datadir=/usr/pkg/share/postgresql/contrib --without -libintl-prefix --without-libiconv-prefix --prefix=/usr/pkg --build=i386--netbsdelf --host=i386--netbsdelf --mandir=/usr/pkg/man Where is it really supposed to go? * postgis.sql does not get the path to the postgis library substituted. I don't get how $$libdir is supposed to be expanded by gmake: %.sql: %.sql.in sed 's,MODULE_PATHNAME,$$libdir/$*- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@,g' $< >$@ gmake runs sed 's,MODULE_PATHNAME,$libdir/postgis-1.4,g' postgis.sql.in >postgis.sql which results in the installed postgis.sql trying to load $libdir/postgis-1.4 like this: -- Deprecation in 1.2.3 CREATE OR REPLACE FUNCTION spheroid_in(cstring) RETURNS spheroid AS '$libdir/postgis-1.4','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT; which does not work. So I think the make rule should use " not ' so $libdir is expanded, and should say libpostgis instead of postgis. But obviously this must work for others, so I suspect there's something odd about what I'm doing. * top-level make install does not seem to descend into doc. Is this intentional, or am I doing something wrong in packaging? I didn't find this explained in README.postgis, but it doesn't mention docs under installation. * in doc, there are some prebuilt man pages in the distribution tarball, plus docbook. docbook is not listed as a dependency in README.postgis, but it seems to be. Should I just add it as a dependency? The other strategy is to prebuild the docs as part of 'make dist' and have the build system be willing to install those built doc bits, but it's not like systems that can handle postgresql can't handle the space for xml tools, so this probably doesn't make sense. * liblwgeom does not get installed. The postgis library has U symbols for things in lwgeom. There is makefile code to pull in objects from liblwgeom.a into libpostgis.so, but that doesn't seem to work. Clearly I need to look into this further, but would like to know the plan so I can understand where my build is going wrong Is there supposed to be a liblwgeom.a installed? Where? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: not available URL: From mark.cave-ayland at siriusit.co.uk Thu Dec 10 06:31:15 2009 From: mark.cave-ayland at siriusit.co.uk (Mark Cave-Ayland) Date: Thu, 10 Dec 2009 14:31:15 +0000 Subject: [postgis-users] PostGIS 1.4.1rc2 In-Reply-To: References: <30fe546d0911281632r7aeaad78kdc761a15ffc67f3a@mail.gmail.com> Message-ID: <4B210633.6040300@siriusit.co.uk> Greg Troxel wrote: Hi Greg, > I'm continuing to work on packaging 1.4.1rc2 for pkgsrc, this time on > NetBSD (to avoid Mac shlib oddness until everything else is ok). I am > building against postgresql 8.4. > > I have a few observations/questions: > > * The postgis library is installed as > > -rw-r--r-- 1 root wheel 552868 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.a > -rwxr-xr-x 1 root wheel 926 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.la > lrwxr-xr-x 1 root wheel 23 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so -> libpostgis-1.4.so.0.0.0 > lrwxr-xr-x 1 root wheel 23 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so.0 -> libpostgis-1.4.so.0.0.0 > -rwxr-xr-x 1 root wheel 268310 Dec 9 15:44 /usr/pkg/lib/libpostgis-1.4.so.0.0.0 > > which is autoconf default $(libdir) for --prefix=/usr/pkg. But > pg_config --pkglibdir is > > $ pg_config --pkglibdir > /usr/pkg/lib/postgresql > > and configure was invoked: > > ./configure --enable-rpath --datadir=/usr/pkg/share/postgresql/contrib --without -libintl-prefix --without-libiconv-prefix --prefix=/usr/pkg --build=i386--netbsdelf --host=i386--netbsdelf --mandir=/usr/pkg/man > > Where is it really supposed to go? > > * postgis.sql does not get the path to the postgis library substituted. > I don't get how $$libdir is supposed to be expanded by gmake: > > %.sql: %.sql.in > sed 's,MODULE_PATHNAME,$$libdir/$*- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@,g' $< >$@ > > gmake runs > > sed 's,MODULE_PATHNAME,$libdir/postgis-1.4,g' postgis.sql.in >postgis.sql > > which results in the installed postgis.sql trying to load > $libdir/postgis-1.4 like this: > > -- Deprecation in 1.2.3 > CREATE OR REPLACE FUNCTION spheroid_in(cstring) > RETURNS spheroid > AS '$libdir/postgis-1.4','ellipsoid_in' > LANGUAGE 'C' IMMUTABLE STRICT; > > which does not work. So I think the make rule should use " not ' so > $libdir is expanded, and should say libpostgis instead of postgis. But > obviously this must work for others, so I suspect there's something odd > about what I'm doing. No, I think you've misunderstood this. The build system simply replaces MODULE_PATHNAME with $libdir/postgis-1.4. The library string '$libdir/postgis-1.4' is correct because the $libdir substitution is done by PostgreSQL at run-time and not by the build system. If this doesn't work, perhaps you're either missing a dependency such as PROJ/GEOS or you have multiple installations of PostgreSQL and you're picking up the wrong pg_config? Checking the PostgreSQL server log can help you here. > * top-level make install does not seem to descend into doc. Is this > intentional, or am I doing something wrong in packaging? I didn't > find this explained in README.postgis, but it doesn't mention docs > under installation. Yeah - this is mainly because the documentation has some quite heavy dependencies for example docbook, xslt and all sorts. We figured that people would much rather read the documentation online rather than install half of the known typesetting universe to build the documentation ;) > * in doc, there are some prebuilt man pages in the distribution tarball, > plus docbook. docbook is not listed as a dependency in > README.postgis, but it seems to be. Should I just add it as a > dependency? The other strategy is to prebuild the docs as part of > 'make dist' and have the build system be willing to install those > built doc bits, but it's not like systems that can handle postgresql > can't handle the space for xml tools, so this probably doesn't make > sense. I think I answered this above... > * liblwgeom does not get installed. The postgis library has U symbols > for things in lwgeom. There is makefile code to pull in objects from > liblwgeom.a into libpostgis.so, but that doesn't seem to work. > Clearly I need to look into this further, but would like to know the > plan so I can understand where my build is going wrong > > Is there supposed to be a liblwgeom.a installed? Where? Nope - it's currently a static library and so gets manually linked to everything that needs it. In short, you don't need to worry about this. HTH, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs From gdt at ir.bbn.com Thu Dec 10 07:11:27 2009 From: gdt at ir.bbn.com (Greg Troxel) Date: Thu, 10 Dec 2009 10:11:27 -0500 Subject: [postgis-users] PostGIS 1.4.1rc2 In-Reply-To: <4B210633.6040300@siriusit.co.uk> (Mark Cave-Ayland's message of "Thu, 10 Dec 2009 14:31:15 +0000") References: <30fe546d0911281632r7aeaad78kdc761a15ffc67f3a@mail.gmail.com> <4B210633.6040300@siriusit.co.uk> Message-ID: Mark Cave-Ayland writes: Thanks for the explanations. >> gmake runs >> >> sed 's,MODULE_PATHNAME,$libdir/postgis-1.4,g' postgis.sql.in >postgis.sql >> >> which results in the installed postgis.sql trying to load >> $libdir/postgis-1.4 like this: > > No, I think you've misunderstood this. The build system simply > replaces MODULE_PATHNAME with $libdir/postgis-1.4. The library string > $libdir/postgis-1.4' is correct because the $libdir substitution is > done by PostgreSQL at run-time and not by the build system. OK (probably that deserves a comment in the makefile!). I am sure I only have one pg version, and proj and geos are ok: root 8 /usr/pkg/pgsql #> ldd /usr/pkg/lib/libpostgis-1.4.so /usr/pkg/lib/libpostgis-1.4.so: -lc.12 => /usr/lib/libc.so.12 -lstdc++.6 => /usr/lib/libstdc++.so.6 -lm.0 => /usr/lib/libm.so.0 -lgcc_s.1 => /usr/lib/libgcc_s.so.1 -lgeos-3.1.0 => /usr/pkg/lib/libgeos-3.1.0.so -lgeos_c.1 => /usr/pkg/lib/libgeos_c.so.1 -lproj.0 => /usr/pkg/lib/libproj.so.0 pg_config says LIBDIR = /usr/pkg/lib PKGLIBDIR = /usr/pkg/lib/postgresql so is $libdir then /usr/pkg/lib? So therefore postgis belongs as /usr/pkg/lib/postgis-1.4.so? Or /usr/pkg/lib/libpostgis-1.4.so, which is what I seem to get, but I don't see how that would be found. ERROR: could not access file "$libdir/postgis-1.4": No such file or directory STATEMENT: CREATE OR REPLACE FUNCTION spheroid_in(cstring) RETURNS spheroid AS '$libdir/postgis-1.4','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT; >> * top-level make install does not seem to descend into doc. Is this >> intentional, or am I doing something wrong in packaging? I didn't >> find this explained in README.postgis, but it doesn't mention docs >> under installation. > > Yeah - this is mainly because the documentation has some quite heavy > dependencies for example docbook, xslt and all sorts. We figured that > people would much rather read the documentation online rather than > install half of the known typesetting universe to build the > documentation ;) OK, so the proper packaging approach is to not package the documentation. >> * liblwgeom does not get installed. The postgis library has U symbols >> for things in lwgeom. There is makefile code to pull in objects from >> liblwgeom.a into libpostgis.so, but that doesn't seem to work. >> Clearly I need to look into this further, but would like to know the >> plan so I can understand where my build is going wrong >> >> Is there supposed to be a liblwgeom.a installed? Where? > > Nope - it's currently a static library and so gets manually linked to > everything that needs it. In short, you don't need to worry about > this. How is it ok to link a static library into a .so? I think it's only because PIC code is produced, making it an aggegration of objects compiled the way a shlib would be. libtool is refusing to do bring it in; I wonder if I should be including all the objects instead of the .a. libtool --mode=link cc -L/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -Wl,--as-needed -Wl,-R'/usr/pkg/lib' -rpath /usr/pkg/lib -version-info 0:0 -o libpostgis-1.4.la lwgeom_pg.lo lwgeom_debug.lo lwgeom_accum.lo lwgeom_spheroid.lo lwgeom_ogc.lo lwgeom_functions_analytic.lo lwgeom_inout.lo lwgeom_estimate.lo lwgeom_functions_basic.lo lwgeom_gist.lo lwgeom_btree.lo lwgeom_transform.lo lwgeom_box.lo lwgeom_box3d.lo lwgeom_box2dfloat4.lo lwgeom_chip.lo lwgeom_geos.lo lwgeom_geos_prepared.lo lwgeom_svg.lo lwgeom_gml.lo lwgeom_kml.lo lwgeom_geojson.lo lwgeom_triggers.lo lwgeom_dump.lo lwgeom_functions_lrs.lo long_xact.lo lwgeom_sqlmm.lo lwgeom_rtree.lo -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lgeos_c -lproj ../liblwgeom/liblwgeom.a *** Warning: Trying to link with static lib archive ../liblwgeom/liblwgeom.a. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because the file extensions .a of this argument makes me believe *** that it is just a static archive that I should not used here. cc -shared .libs/lwgeom_pg.o .libs/lwgeom_debug.o .libs/lwgeom_accum.o .libs/lwgeom_spheroid.o .libs/lwgeom_ogc.o .libs/lwgeom_functions_analytic.o .libs/lwgeom_inout.o .libs/lwgeom_estimate.o .libs/lwgeom_functions_basic.o .libs/lwgeom_gist.o .libs/lwgeom_btree.o .libs/lwgeom_transform.o .libs/lwgeom_box.o .libs/lwgeom_box3d.o .libs/lwgeom_box2dfloat4.o .libs/lwgeom_chip.o .libs/lwgeom_geos.o .libs/lwgeom_geos_prepared.o .libs/lwgeom_svg.o .libs/lwgeom_gml.o .libs/lwgeom_kml.o .libs/lwgeom_geojson.o .libs/lwgeom_triggers.o .libs/lwgeom_dump.o .libs/lwgeom_functions_lrs.o .libs/long_xact.o .libs/lwgeom_sqlmm.o .libs/lwgeom_rtree.o -Wl,--rpath -Wl,/n0/gdt/NetBSD-current/pkgsrc/geography/postgresql-postgis/work/.buildlink/lib -Wl,--rpath -Wl,/n0/gdt/NetBSD-current/pkgsrc/geography/postgresql-postgis/work/.buildlink/lib -L/n0/gdt/NetBSD-current/pkgsrc/geography/postgresql-postgis/work/.buildlink/lib /n0/gdt/NetBSD-current/pkgsrc/geography/postgresql-postgis/work/.buildlink/lib/libgeos_c.so /n0/gdt/NetBSD-current/pkgsrc/geography/postgresql-postgis/work/.buildlink/lib/libproj.so -Wl,-R/usr/pkg/lib -Wl,--as-needed -Wl,-soname -Wl,libpostgis-1.4.so.0 -o .libs/libpostgis-1.4.so.0.0.0 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: not available URL: From pcreso at pcreso.com Thu Dec 10 07:54:18 2009 From: pcreso at pcreso.com (pcreso at pcreso.com) Date: Thu, 10 Dec 2009 07:54:18 -0800 (PST) Subject: [postgis-users] shp2pgsql In-Reply-To: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> Message-ID: <314332.74742.qm@web33202.mail.mud.yahoo.com> On a linux platform you can use: shp2pgsql -a [...] | sed 's/text/klassen/g' | psql -d under Windows you can run shp2pgsql -a [...] > file.sql then edit file.sql & do a search/replace on "text" to "klassen" then run psql -d -f file.sql Always assuming the word "text" is only ever used as the column name. If this is not the case, then you will need to edit the file & check each search/replace occurrence. Or you can use a temporary table (tab2) to insert the data into using shp2pgsql, then in your database run: insert into tab1 select * from tab2; drop table tab2; HTH, Brent Wood --- On Thu, 12/10/09, MisterX wrote: > From: MisterX > Subject: [postgis-users] shp2pgsql > To: postgis-users at postgis.refractions.net > Date: Thursday, December 10, 2009, 10:23 PM > Hi, > > my problem is, that i have a database table with two > columns with the name klassen ant the_geom. In my shapefile > the columns called text and the_geom. Now I want to append > the shapefile on the database table, but how can I tell the > shapeloader that the column text affiliate to the colum > klassen? > > shapefile???????????????????? database > Table??????????????????????? > --> text??????????????????? --> klassen? > --> the_geom ? ? ? ? ? ? ?? --> the_geom > ???????????????????????????? > Can anybody help me with this problem? > > > Thank you very much. > > MisterX > > > -----Inline Attachment Follows----- > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From kneufeld at refractions.net Thu Dec 10 10:03:57 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Thu, 10 Dec 2009 10:03:57 -0800 Subject: [postgis-users] invalid geometry crashes postgres when trying to use buffer In-Reply-To: <974EAA0F18CB944EA1751F245E4714AD03B4B661@gandalf.natuurpunt.be> References: <974EAA0F18CB944EA1751F245E4714AD03B4B452@gandalf.natuurpunt.be> <4B1FDDBB.3010404@refractions.net> <974EAA0F18CB944EA1751F245E4714AD03B4B661@gandalf.natuurpunt.be> Message-ID: <4B21380D.1020309@refractions.net> I can't duplicate your crash running the current release. postgis_full_version ------------------------------------------------------------------------------------- POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS (1 row) -- Kevin Christophe Diericx wrote: > Thanks a lot, this seems to work fine as a workaround. > > Anyone know if this exact problem persists in current versions of > postgis (could be an incentive to upgrade)? > > Christophe > > -----Oorspronkelijk bericht----- > Van: postgis-users-bounces at postgis.refractions.net > [mailto:postgis-users-bounces at postgis.refractions.net] Namens Kevin > Neufeld > Verzonden: woensdag 9 december 2009 18:26 > Aan: PostGIS Users Discussion > Onderwerp: Re: [postgis-users] invalid geometry crashes postgres when > trying to use buffer > > Try reducing the precision of your geometry. > > PostGIS doesn't actually have a precision reducer function yet, but > ST_SnapToGrid comes close. > > -- Kevin > > Christophe Diericx wrote: >> Hello everyone, >> >> Issuing the following query (while trying to repair an invalid >> geometry): >> >> ** select buffer(ST_GeomFromText('mypoly',32767),0) >> >> crashes postgresql hard (extract from the postgresql error-log here: >> http://paste.pocoo.org/show/155923/). >> >> 'mypoly' can be seen here: http://paste.pocoo.org/show/155921/. >> >> 32767 corresponds to the following proj4 string: "+proj=lcc >> +lat_1=49.8333333333 +lat_2=51.1666666667 +lat_0=90 >> ++lon_0=4.3569397222 >> +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl >> +towgs84=81,120,129,0,0,0,0 +units=m +no_defs" >> >> Some more information about my setup: >> >> -- select postgis_full_version() >> "POSTGIS="1.3.5" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.6.0, 21 Dec > 2007" >> USE_STATS" >> -- select version() >> "PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.4 > >> (Ubuntu 4.2.4-1ubuntu3)" >> >> Is this a known issue and is this fixed in later builds? >> >> Does anyone have an idea for a workaround with my current versions? >> >> Thanks in advance for all reactions! >> >> Christophe >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From fsalas at geocuba.cu Thu Dec 10 11:35:02 2009 From: fsalas at geocuba.cu (Fsalas) Date: Thu, 10 Dec 2009 14:35:02 -0500 Subject: [postgis-users] how obtain the interior parcels In-Reply-To: <314332.74742.qm@web33202.mail.mud.yahoo.com> References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> <314332.74742.qm@web33202.mail.mud.yahoo.com> Message-ID: Hi, I have a table parcels , and I need obtain the list of the only interior parcels, the parcels is not overlap. I test ST_Contains(), ST_Intersects() but the result is not correct. Salas. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lehodey at gmail.com Thu Dec 10 11:48:17 2009 From: lehodey at gmail.com (Fred Lehodey) Date: Thu, 10 Dec 2009 19:48:17 +0000 Subject: [postgis-users] how obtain the interior parcels In-Reply-To: References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> <314332.74742.qm@web33202.mail.mud.yahoo.com> Message-ID: Hi Salas, are "interior parcels" islands ? ST_NumInteriorRings(geometry) Return the number of interior rings of the first polygon in the geometry. Return NULL if there is no polygon in the geometry. ST_NumInteriorRing(geometry) Synonym to NumInteriorRings(geometry). The OpenGIS specs are ambiguous about the exact function naming, so we provide both spellings. ST_InteriorRingN(geometry,integer) Return the N'th interior ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. Fred. On Thu, Dec 10, 2009 at 7:35 PM, Fsalas wrote: > Hi, > I have a table parcels , and I need obtain the list of the only interior > parcels, the parcels is not overlap. > I test ST_Contains(), ST_Intersects() but the result is not correct. > > Salas. > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fsalas at geocuba.cu Thu Dec 10 12:13:52 2009 From: fsalas at geocuba.cu (Fsalas) Date: Thu, 10 Dec 2009 15:13:52 -0500 Subject: [postgis-users] how obtain the interior parcels In-Reply-To: References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> <314332.74742.qm@web33202.mail.mud.yahoo.com> Message-ID: Thanks , Fred. Yes, I need the list of island polygons i use the ST_NumInteriorRings(), ... but only obtain the number , and i need obtain the list of feature island. How resolve this? regards , salas -----Original Message----- From: Fred Lehodey To: PostGIS Users Discussion Date: Thu, 10 Dec 2009 19:48:17 +0000 Subject: Re: [postgis-users] how obtain the interior parcels Hi Salas, are "interior parcels" islands ? ST_NumInteriorRings(geometry) Return the number of interior rings of the first polygon in the geometry. Return NULL if there is no polygon in the geometry. ST_NumInteriorRing(geometry) Synonym to NumInteriorRings(geometry). The OpenGIS specs are ambiguous about the exact function naming, so we provide both spellings. ST_InteriorRingN(geometry,integer) Return the N'th interior ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. Fred. On Thu, Dec 10, 2009 at 7:35 PM, Fsalas wrote: Hi, I have a table parcels , and I need obtain the list of the only interior parcels, the parcels is not overlap. I test ST_Contains(), ST_Intersects() but the result is not correct. Salas. _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Fri Dec 11 00:35:52 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Fri, 11 Dec 2009 10:35:52 +0200 Subject: [postgis-users] Weird GEOS problem Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Fri Dec 11 00:38:23 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Fri, 11 Dec 2009 10:38:23 +0200 Subject: [postgis-users] Weird GEOS problem Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE1DE@zeus.prte> Sorry, pressed wrong key. Anyway, the error occurs randomly and doesn't go away until the connection is dropped and the client app is restarted. I have not found anything on the net hence me posting here. For some background, the app continuously hits the db with various spatial queries but no updates or the like. Regards George From: George Vlahakis Sent: Friday, December 11, 2009 10:36 AM To: 'postgis-users at postgis.refractions.net' Subject: Weird GEOS problem Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query -------------- next part -------------- An HTML attachment was scrubbed... URL: From emilie.laffray at gmail.com Fri Dec 11 03:13:03 2009 From: emilie.laffray at gmail.com (Emilie Laffray) Date: Fri, 11 Dec 2009 11:13:03 +0000 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> Message-ID: <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> 2009/12/11 George Vlahakis > Hi all, > > > > Probably nobody has seen this, but on a particular machine (Win XP) every > 2-3 hours or so I am getting the following error: > > > > System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS > Coordinate Sequence; Error while executing the query > > > I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Fri Dec 11 03:14:49 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Fri, 11 Dec 2009 13:14:49 +0200 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> Ok thanks, I used to use npgsql but for spatial queries and binary geometry retrieval I found it the opposite. It has been some time, but I will try it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From satish_m at hotmail.com Fri Dec 11 07:21:05 2009 From: satish_m at hotmail.com (Satish Murthy) Date: Fri, 11 Dec 2009 15:21:05 +0000 Subject: [postgis-users] ST_INTERSECT returns false, but should return true In-Reply-To: <0BA15F8511284ABAB1D2C7C8DC523407@b> References: , <0BA15F8511284ABAB1D2C7C8DC523407@b> Message-ID: That seems to be the right reason. Thanks :) From: lr at pcorp.us To: postgis-users at postgis.refractions.net Date: Wed, 9 Dec 2009 20:29:48 -0500 Subject: Re: [postgis-users] ST_INTERSECT returns false, but should return true Satish, AsText and AsEWKT only show the first 15 or 16 digits so I suspect your real geometries have more digits and are really off by a small amount. To be sure use the ST_AsHexEWKB representation of the ST_AsEWKT instead of and you will see the distance is probably > 0 but very small. Leo From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Satish Murthy Sent: Wednesday, December 09, 2009 11:28 AM To: postgis-users at postgis.refractions.net Subject: [postgis-users] ST_INTERSECT returns false, but should return true Hi, I can't figure out why this is happening: This works, returning true: SELECT Intersects( GeomFromEWKT('MULTILINESTRING((-26.9599999999939 -29.97 1 0,-26.9399999999976 -29.99 2 0),(-25.8599999999937 -29.97 1 0,-26.9399999999976 -29.99 2 0))'), GeomFromEWKT('POINT(-26.9599999999939 -29.97 1 0)')) ; If I select the same as geometries, it returns false SELECT ST_Intersects( (select geom1 from tab), (select geom2 from tab)) ; Weird thing is, select ST_DISTANCE (geom1, geom2) returns 3.51700710773038e-14 This behavior is not consistent - sometimes ST_INTERSECTS returns true correctly. Can anyone suggest what might be the problem here? Thanks, Satish New Windows 7: Find the right PC for you. Learn more. _________________________________________________________________ Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop -------------- next part -------------- An HTML attachment was scrubbed... URL: From lehodey at gmail.com Fri Dec 11 07:58:18 2009 From: lehodey at gmail.com (Fred Lehodey) Date: Fri, 11 Dec 2009 15:58:18 +0000 Subject: [postgis-users] how obtain the interior parcels In-Reply-To: References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com> <314332.74742.qm@web33202.mail.mud.yahoo.com> Message-ID: Hi Salas, not sure this is the better way, but.. ;-) ... (you need POLYGONs, use ST_Dump() if MULTIPOLYGONs) you can try something like this: SELECT ST_InteriorRingN((the_geom),s) FROM your_parcels , generate_series(1,(SELECT max(ST_NumInteriorRing(the_geom)) FROM your_parcels)) s WHERE ST_NumInteriorRing(the_geom) > 0 AND ST_InteriorRingN(the_geom,s) IS NOT NULL Fred... On Thu, Dec 10, 2009 at 8:13 PM, Fsalas wrote: > Thanks , Fred. > > Yes, I need the list of island polygons i use the ST_NumInteriorRings(), > ... but only obtain the number , and i need obtain the list of feature > island. > > How resolve this? > > regards , salas > > > > -----Original Message----- > From: Fred Lehodey > To: PostGIS Users Discussion > Date: Thu, 10 Dec 2009 19:48:17 +0000 > Subject: Re: [postgis-users] how obtain the interior parcels > > Hi Salas, > are "interior parcels" islands ? > ST_NumInteriorRings(geometry) > Return the number of interior rings of the first polygon in the geometry. > Return NULL if there is no polygon in the geometry. > ST_NumInteriorRing(geometry) > Synonym to NumInteriorRings(geometry). The OpenGIS specs are ambiguous > about the exact function naming, so we provide both spellings. > ST_InteriorRingN(geometry,integer) > Return the N'th interior ring of the polygon geometry. Return NULL if the > geometry is not a polygon or the given N is out of range. > > Fred. > > > On Thu, Dec 10, 2009 at 7:35 PM, Fsalas wrote: > >> Hi, >> I have a table parcels , and I need obtain the list of the only interior >> parcels, the parcels is not overlap. >> I test ST_Contains(), ST_Intersects() but the result is not correct. >> >> Salas. >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.hopfgartner at r3-gis.com Fri Dec 11 09:31:33 2009 From: peter.hopfgartner at r3-gis.com (Peter Hopfgartner) Date: Fri, 11 Dec 2009 18:31:33 +0100 Subject: [postgis-users] [mapserver-users] Web interface In-Reply-To: <4B223028.7000003@munistgo.cl> References: <1260481491255-4148052.post@n2.nabble.com> <4B2174C4.1050406@swoodbridge.com> <4B218028.9040003@swoodbridge.com> <4B223028.7000003@munistgo.cl> Message-ID: <4B2281F5.3060900@r3-gis.com> Another Shameless Plug: GisClient allows the map composition from the browser and has some other nce features, too, since it is rather young. http://www.gisclient.org/ Both allow the map composition Regards, Peter Patricio Gigoux wrote: > Hi everybody: > > Do you know a good web frontend for display and manipulate maps that has > been produced in mapserver? > > Thanks a lot in advance > > > Patricio > _______________________________________________ > mapserver-users mailing list > mapserver-users at lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgartner at r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com From rjpawley at shaw.ca Fri Dec 11 15:16:10 2009 From: rjpawley at shaw.ca (Bob Pawley) Date: Fri, 11 Dec 2009 15:16:10 -0800 Subject: [postgis-users] Error Message-ID: I recieved an error which I don't understand. Would it be possible for someone to translate it? ERROR: loop variable of loop over rows must be a record or row variable or list of scalar variables at or near "Loop" Here is the function that leads into the loop, if of any help. For deviceid In Select devices_id from p_id.processes, p_id.p_id, processes_count, p_id.devices where p_id.processes.ip_op_equipment = 'op' and p_id.processes.process_id = p_id.p_id.process_id and p_id.processes.pump1 = 'True' and p_id.processes.p_id_id = processes_count.p_id_id -- and p_id.devices.fluid_id = fluidid2 order by p_id.processes.process_id desc, p_id.devices.devices_id asc Loop .......... Thanks Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Fri Dec 11 22:41:11 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Fri, 11 Dec 2009 22:41:11 -0800 Subject: [postgis-users] Error In-Reply-To: References: Message-ID: <4B233B07.9050408@refractions.net> How did you define deviceid? It must be of type "record". -- Kevin Bob Pawley wrote: > I recieved an error which I don't understand. > > Would it be possible for someone to translate it? > > ERROR: loop variable of loop over rows must be a record or row > variable or list of scalar variables at or near "Loop" > > Here is the function that leads into the loop, if of any help. > > For deviceid In Select devices_id > from p_id.processes, p_id.p_id, processes_count, p_id.devices > where p_id.processes.ip_op_equipment = 'op' > and p_id.processes.process_id = p_id.p_id.process_id > and p_id.processes.pump1 = 'True' > and p_id.processes.p_id_id = processes_count.p_id_id > -- and p_id.devices.fluid_id = fluidid2 > order by p_id.processes.process_id desc, > p_id.devices.devices_id asc > > Loop > > .......... > > Thanks > > Bob > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From kobben at itc.nl Sat Dec 12 06:42:34 2009 From: kobben at itc.nl (=?iso-8859-1?Q?Barend_K=F6bben?=) Date: Sat, 12 Dec 2009 15:42:34 +0100 Subject: [postgis-users] [mapserver-users] Web interface In-Reply-To: <4B2281F5.3060900@r3-gis.com> Message-ID: On 11-12-09 18:31, "Peter Hopfgartner" wrote: > GisClient allows the map composition from the browser and has some other > nce features, too, Yeah, such as being in Italian only.... Seriously, is there a English version of this site...? -- Barend K?bben Senior Lecturer University Twente, Faculty of Geo-Information Science and Earth Observation (ITC) PO Box 6, 7500AA Enschede, The Netherlands +31 (0)53 4874253 International Institute for Geo-Information Science and Earth Observation (ITC) Chamber of Commerce: 410 27 560 E-mail disclaimer The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission. From punk.kish at gmail.com Sat Dec 12 08:16:43 2009 From: punk.kish at gmail.com (P Kishor) Date: Sat, 12 Dec 2009 10:16:43 -0600 Subject: [postgis-users] [mapserver-users] Web interface In-Reply-To: References: <4B2281F5.3060900@r3-gis.com> Message-ID: 2009/12/12 Barend K?bben : > On 11-12-09 18:31, "Peter Hopfgartner" wrote: >> GisClient allows the map composition from the browser and has some other >> nce features, too, > Yeah, such as being in Italian only.... > > Seriously, is there a English version of this site...? > .. actually, not even a problem that the site is Italian only. More of a problem that I couldn't, for the life of me, see a demo of the application. I clicked around, a bit blindly, I must admit, but got nowhere. Clicking on what seemed like a map demo link let me to a list of users making use of gisclient, and going to their website launched me into another futile click-journey. Life is too short to have to figure out a demo of a software. Puneet. From peter.hopfgartner at r3-gis.com Sat Dec 12 08:32:54 2009 From: peter.hopfgartner at r3-gis.com (Peter Hopfgartner) Date: Sat, 12 Dec 2009 17:32:54 +0100 Subject: [postgis-users] [mapserver-users] Web interface In-Reply-To: References: Message-ID: <4B23C5B6.3050203@r3-gis.com> Barend K?bben wrote: > On 11-12-09 18:31, "Peter Hopfgartner" wrote: > >> GisClient allows the map composition from the browser and has some other >> nce features, too, >> > Yeah, such as being in Italian only.... > > Seriously, is there a English version of this site...? > > Ooops, the mail went to the wrong ML. Sorry for the noise! I'll bring the discussion back to the MapServer users list. Anyway, currently the site is mostly Italian, you might try http://translate.google.com/translate?hl=de&sl=it&tl=en&u=http%3A%2F%2Fwww.gisclient.org%2F. The map window is translatable and translations are included for English, German, Italian and, in part for French and Spanish. The administration part is, if I remember correctly, in Italian only, ATM. The community aspect is still in it's beginning. Translations, mailing list/forum etc. should follow. The software was initially an internal project of Gis & Web, an Italian company, and currently most of the activities are focused on coding. Peter -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgartner at r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com From lr at pcorp.us Sat Dec 12 14:54:43 2009 From: lr at pcorp.us (Paragon Corporation) Date: Sat, 12 Dec 2009 17:54:43 -0500 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte><7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> <589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> Message-ID: George, Which version of GEOS are you running? We've never seen that particular error before but could be caused by a malformed geometry that pops in every 3 hours or some sort of memory leak that only shows up with enough querying. Also you know which query you are running to generate that error? Checking the PostgreSQL logs might help pinpoint that which is located in data\pg_log directory. I think that by default logs the query that caused the error and the error. You may need to increase what you are logging from postgresql.conf but I forget off hand which settings those are that would be helpful. Leo _____ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of George Vlahakis Sent: Friday, December 11, 2009 6:15 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem Ok thanks, I used to use npgsql but for spatial queries and binary geometry retrieval I found it the opposite. It has been some time, but I will try it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Sun Dec 13 07:53:36 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Sun, 13 Dec 2009 17:53:36 +0200 Subject: [postgis-users] Weird GEOS problem References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte><7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com><589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> Message-ID: <589F4F6707B81B4A8543B9C32628684F016EBA@zeus.prte> Hi Leo, before even looking into the suggested, let me point out that the same application, with the same database on three different machines did not produce this error for the past two weeks (running non-stop). On this machine however as I mentioned it pops up every 2-3 hours or so. No mem increase detected and the query is one (any) of a set of three which are repeatedly called on a loop. As such I am inclined to believe it is an environment issue. Different OS would qualify for this as this is the only 32 bit XP, the others are Vista (64/32) and Win 2008 64. I have now retired the machine for the farm, and I might retry formatting it in the future. As I didnt find any other references on the web on this error I wanted to give it a try here. Regards George ________________________________ From: postgis-users-bounces at postgis.refractions.net on behalf of Paragon Corporation Sent: Sun 12/13/2009 00:54 To: 'PostGIS Users Discussion' Subject: Re: [postgis-users] Weird GEOS problem George, Which version of GEOS are you running? We've never seen that particular error before but could be caused by a malformed geometry that pops in every 3 hours or some sort of memory leak that only shows up with enough querying. Also you know which query you are running to generate that error? Checking the PostgreSQL logs might help pinpoint that which is located in data\pg_log directory. I think that by default logs the query that caused the error and the error. You may need to increase what you are logging from postgresql.conf but I forget off hand which settings those are that would be helpful. Leo ________________________________ From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of George Vlahakis Sent: Friday, December 11, 2009 6:15 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem Ok thanks, I used to use npgsql but for spatial queries and binary geometry retrieval I found it the opposite. It has been some time, but I will try it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Mon Dec 14 11:40:54 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Mon, 14 Dec 2009 11:40:54 -0800 Subject: [postgis-users] is http://postgis.refractions.net/ down today? In-Reply-To: <004001ca7c3f$15310b40$3f9321c0$@com> References: <004001ca7c3f$15310b40$3f9321c0$@com> Message-ID: <4B2694C6.3090708@refractions.net> Yeah, the server went down yesterday afternoon, but things should be back up and running again. Thanx all for your patience. Cheers, -- Kevin Madhav Vodnala wrote: > is http://postgis.refractions.net/ down today? > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From strk at keybit.net Mon Dec 14 11:53:51 2009 From: strk at keybit.net (Sandro Santilli) Date: Mon, 14 Dec 2009 20:53:51 +0100 Subject: [postgis-users] 3.2.0 release ready for download Message-ID: <20091214195351.GH54715@keybit.net> I'm pleased to announce the final release of GEOS 3.2.0. http://download.osgeo.org/geos/geos-3.2.0.tar.bz2 This new release provides improved robustness and speed, along with new additions to the C api: - STRtree support - Linear referencing functions (project, interpolate) - Styled Buffer operations (define join and endcap styles) C-Api clients (like postgis) will benefit from the improvements (not the additions) by just installing the new library. C++ clients will need rebuilding, but hopefully no tweaking of the code. For PostGIS, rebuilding it will also give SQL access to the styled buffer operation. Happy holidays ! --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! From Tiller.Karl at nwsc.co.ug Mon Dec 14 11:55:15 2009 From: Tiller.Karl at nwsc.co.ug (Tiller.Karl at nwsc.co.ug) Date: Mon, 14 Dec 2009 22:55:15 +0300 Subject: [postgis-users] Tiller Karl is out of the office Message-ID: I will be out of the office starting 14/12/2009 and will not return until 04/01/2010. I will respond to your message when I return. From jd at commandprompt.com Mon Dec 14 12:02:21 2009 From: jd at commandprompt.com (Joshua D. Drake) Date: Mon, 14 Dec 2009 12:02:21 -0800 Subject: [postgis-users] PostgreSQL Conference East 2010 Call for Papers Message-ID: <1260820941.27552.40.camel@jd-desktop.unknown.charter.com> December 14th, 2009, the PostgreSQL Conference U.S. team is pleased to announce the East 2010 venue and call for papers. This year the premiere East Coast PostgreSQL Conference will be returning to history Drexel University in Philadelphia. The event this year is being held at Drexel University in Philadelphia from March 26th through 28th. Following previously successful United States PostgreSQL conferences, we will be hosting a series of 3-4 hour tutorials, 90 minute mini-tutorials, 45 minute talks, 5 minute lightning talks and a new 30 minute presentation time slot. Time line: December 14th: Talk submission opens January 30th: Talk submission closes February 15th: Speaker notification This year we will be continuing our trend of covering the entire PostgreSQL ecosystem. We would like to see talks and tutorials on the following topics: * General PostgreSQL: * Administration * Performance * High Availability * Migration * GIS * Integration * Solutions and White Papers * The Stack: * Python/Django/Pylons/TurboGears/Custom * Perl5/Catalyst/Bricolage * Ruby/Rails * Java (PLJava would be great)/Groovy/Grails * Operating System optimization (Linux/FBSD/Solaris/Windows) * Solutions and White Papers Submit Talk: http://www.postgresqlconference.org/talksubmission Sincerely, Joshua D. Drake -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564 Consulting, Training, Support, Custom Development, Engineering From lr at pcorp.us Mon Dec 14 23:59:19 2009 From: lr at pcorp.us (Paragon Corporation) Date: Tue, 15 Dec 2009 02:59:19 -0500 Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX In-Reply-To: <4B260DDE.2040600@vti.bund.de> References: <4B17F49B.2040801@vti.bund.de> <4B181281.1060209@refractions.net> <4B260DDE.2040600@vti.bund.de> Message-ID: <417C5A1B3FB5428D9D6AAC449446D947@b> Birgit, Never gotten that error before, but I have had success at least with 8.4 doing a vacuum analyze on the corrupted table. When I get erros like page_header not found. You can try doing that and see if it makes a difference. Though not sure if you can put that in a stored proc, since I've never tried. Hope that helps, Regina -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Birgit Laggner Sent: Monday, December 14, 2009 5:05 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX Hi Leo, with your TRUNCATE and ALTER SEQUENCE method, I still get an error at polygon 451, but a new one: ERROR: missing chunk number 0 for toast value 27366 in pg_toast_26963 SQL Status:XX000 Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 63 at RAISE I think, this describes the problem better then the oid referencing error. As a result of a Google search, I got the impression that there might be a corrupted row (polygon 451) in the database table. Any suggestions how to solve the problem? Thanks, Birgit. Birgit Laggner wrote: >Hi Kevin, > >to define the table name in question as a variable did not work, >unfortunately. I get the same error message as before. Now, I will try >the TRUNCATE and ALTER SEQUENCE method of Leo... > >Regards, Birgit. > > >Birgit Laggner wrote: >>Thanks, Kevin and Leo! I will try your suggestions today. >> >>Birgit. >> >>Kevin Neufeld wrote: >>> Yeah, I agree. What I've done to get around the caching problem >>> that seems to work is to define all table names as variables at the >>> top of the function. All the sql statements used throughout the >>> function then reference a variable instead of an actual table. The >>> planner can't cache the query plan since the query is adhoc ... no >>> OID referencing problem. >>> -- Kevin >>> >>> Paragon Corporation wrote: >>> Birgit, >>> >>> I suspect as you alluded to that you are a victim of the dreaded >>> cached plan and your OID issue is because the new table doesn't have >>> the same OID as the old table. 8.4 is supposed to be smart enough to >>> invalidate plans in these situations, thought maybe not. >>> >>> One possible work around is instead of creating and dropping the >>> table, why don't you just TRUNCATE the table and reset the sequence >>> >>> So something like >>> >>> >>> TRUNCATE TABLE birgit.test_diff_dlm07_tmp; ALTER SEQUENCE >>> birgit.test_diff_dlm07_tmp.gid RESTART WITH 1; >>> >>> >>> You could also use CREATE TEMP TABLE instead of CREATE TABLE. I >>> suspect temp table oids may not be cached. >>> >>> Leo >>> >>> >>> -----Original Message----- >>> From: postgis-users-bounces at postgis.refractions.net >>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of >>> Birgit Laggner >>> Sent: Thursday, December 03, 2009 12:26 PM >>> To: PostGIS Users Discussion >>> Subject: [postgis-users] problem with plpgsql function - ERROR: >>> could not open relation with OID XXX >>> >>> Dear list, >>> >>> I have written a pl/pgsql function (see below) for st_difference >>> which in short should sequentially scan a geometric table (a) if >>> there are intersections with geometric table (b) and if there are, >>> it writes the intersecting polygons of table (b) into an extra table >>> and then executes the st_difference for the actual polygon of table >>> (a) and all polygons of table (b ) written in the extra table as a >>> sequence always using the product of the last difference as the >>> input (instead of the table (a) >>> polygon) of the next difference. I hope everybody understands my way >>> of thinking ;-) >>> >>> My problem is now, that at polygon 451 of table (a), the function >>> stops with the following error message: >>> >>> ERROR: could not open relation with OID 25736 SQL Status:XX000 >>> Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at >>> RAISE >>> >>> Strange is, that the function did run successfully for more than 100 >>> difference-loops. In an older PostGres version (8.1...), I have had >>> a similar problem, but then always in the 2nd loop, because of the >>> cashing-problem of the query planner. >>> >>> This are the PostGIS/PostgreSQL versions I am using: >>> PostgreSQL: 8.4.1-2.1 >>> PostGIS: 1.4.0-10.1 >>> >>> Here, the last few message rows of the running function, perhaps >>> this helps with understanding the problem (sorry because it's partly >>> in German, I hope it doesn't matter): >>> >>> NOTICE: Beginn Difference f?r dlm07-Polygon 450 >>> NOTICE: Anzahl Intersection-Polygone: 1 >>> NOTICE: CREATE TABLE erstellt implizit eine Sequenz >>> ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte >>> ?test_diff_dlm07_tmp.gid? >>> CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp >>> (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL >>> function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung >>> NOTICE: recordset_object2a: >>> (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC875191 >>> 41564121 >>> >>> B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6 >>> AD773D4A >>> >>> 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD >>> 0E943870 >>> >>> 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F0504156 >>> 41D2D792 >>> >>> 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD >>> 3C4A4142 >>> >>> 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A41704938 >>> 51304156 >>> >>> 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163 >>> BDF058E9 >>> >>> 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A >>> 419F2015 >>> >>> 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49 >>> 415641EE >>> >>> 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F64 >>> 2C703C4A >>> >>> 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111 >>> FD983366 >>> >>> 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F7465059744156 >>> 41125009 >>> >>> 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB >>> 3C4A418B >>> >>> 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C >>> 8F914156 >>> >>> 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1 >>> ) >>> NOTICE: recordset_object1: >>> (450,0103000020EB7A00000100000022000000CC72F1149A3C4A41000000002B415 >>> 641295C8 >>> >>> F229A3C4A4185EB51582B4156413E0AD7A3983C4A41000000002B415641351D7C688 >>> 33C4A410 >>> >>> 00000002B415641F6285C2F7E3C4A410000001031415641B81E856B913C4A41A4703 >>> D6A35415 >>> >>> 6413E0AD723AD3C4A41AE47E17A3B415641B81E850BAE3C4A4114AE47E13E415641E >>> 17A144EA >>> >>> F3C4A417B14AEE74341564152B81EA5B03C4A410AD7A3B04741564114AE4721BB3C4 >>> A41EC51B >>> >>> 82E474156417B14AE67CC3C4A41AE47E17A46415641B81E852BD83C4A411F85EB014 >>> 64156416 >>> >>> 6666646D73C4A4185EB51B8454156413E0AD783D63C4A41666666664541564114AE4 >>> 761D53C4 >>> >>> A41B81E85DB44415641295C8F02D53C4A418FC2F548444156413E0AD703D53C4A416 >>> 66666C64 >>> >>> 34156419A999979D53C4A41AE47E1CA424156410AD7A330D63C4A41713D0AA741415 >>> 641A4703 >>> >>> D8AD73C4A41B81E859B40415641A4703DEAD93C4A41E17A14CE3E415641713D0A17D >>> B3C4A41B >>> >>> 81E85DB3D415641CDCCCC8CDC3C4A41F6285CAF3C415641E17A148EDF3C4A41AE47E >>> 10A3B415 >>> >>> 6419A999959E13C4A410AD7A3103A4156413E0AD7E3E23C4A4148E17AC438415641A >>> 4703D0AE >>> >>> 43C4A41AE47E13A38415641A4703DCAEB3C4A4114AE47213841564100000060EC3C4 >>> A413E0AD >>> >>> 7D33241564114AE47E1E03C4A41D7A370AD324156419A999979E33C4A417B14AE772 >>> E4156418 >>> >>> 82F554CE43C4A41000000002B415641CC72F1149A3C4A41000000002B415641) >>> NOTICE: recordset_object2a: >>> (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC875191 >>> 41564121 >>> >>> B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6 >>> AD773D4A >>> >>> 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD >>> 0E943870 >>> >>> 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F0504156 >>> 41D2D792 >>> >>> 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD >>> 3C4A4142 >>> >>> 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A41704938 >>> 51304156 >>> >>> 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163 >>> BDF058E9 >>> >>> 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A >>> 419F2015 >>> >>> 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49 >>> 415641EE >>> >>> 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F64 >>> 2C703C4A >>> >>> 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111 >>> FD983366 >>> >>> 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F7465059744156 >>> 41125009 >>> >>> 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB >>> 3C4A418B >>> >>> 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C >>> 8F914156 >>> >>> 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1 >>> ) >>> NOTICE: Intersection-Polygon 1 verarbeitet. >>> NOTICE: Difference-Polygon dlm07 450 ist fertig. >>> NOTICE: Beginn Difference f?r dlm07-Polygon 451 >>> NOTICE: Anzahl Intersection-Polygone: 1 >>> NOTICE: CREATE TABLE erstellt implizit eine Sequenz >>> ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte >>> ?test_diff_dlm07_tmp.gid? >>> CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp >>> (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL >>> function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung >>> NOTICE: recordset_object2a: >>> (242405,0103000020EB7A00000100000093000000A5D6BC7F113B4A41DA9C414B8C >>> 44564150 >>> >>> FAAEDD133B4A419F49202D8B4456412FF0D7391B3B4A41168EC19286445641E5C111 >>> 791C3B4A >>> >>> 412DEE6FD88D44564193716BA71F3B4A41527950589B4456413706B5B4203B4A411C >>> A7E1639F >>> >>> 4456417F264CED223B4A410BDF111DA544564195B45007273B4A410C80CF17AE4456 >>> 41233940 >>> >>> 05293B4A41D9F53FC8B34456417B6AB9082D3B4A415F147142B4445641B5FC2FAC30 >>> 3B4A4129 >>> >>> 35E853B4445641C323EFF1373B4A41C18C5DAAB34456412A8D25813F3B4A41C33BF4 >>> E5B24456 >>> >>> 41022A8ED84C3B4A4118E6FF5DB2445641F237A3BB5D3B4A414C7E863FB244564191 >>> C9735265 >>> >>> 3B4A410E9B8A5CB1445641529A25D6633B4A41C47E2DB7AD445641B5D7BDEA5E3B4A >>> 4160BF3D >>> >>> D7A4445641064DA2335A3B4A41B397823D9B445641468081F5693B4A412AAF71059B >>> 44564174 >>> >>> 5B60647B3B4A4188667A919A4456411E7579487A3B4A41BA466E559944564131F2D4 >>> F87E3B4A >>> >>> 41C9563A27994456414A570C2C893B4A41CC1B91F797445641FAD2C8BCA33B4A419E >>> EF661595 >>> >>> 44564194F74682CE3B4A41C8A7A28090445641F677AA51E53B4A41C3AC804A8E4456 >>> 419D16B3 >>> >>> 33023C4A4145B4DB368B4456412CD4AE17083C4A4172F829968A4456418E660AAB22 >>> 3C4A4142 >>> >>> 4103B9874456414F5B3AF4233C4A4100517DEF92445641F472B68E233C4A41C56C4F >>> 98934456 >>> >>> 4102FCF859223C4A415E932D9A95445641EFCC195F113C4A41DB4F155BA644564154 >>> 57E1A40E >>> >>> 3C4A4151BCC460A9445641115545C6083C4A41DC02CB19B14456418064136EF33B4A >>> 413F76BC >>> >>> D1AC445641DB6389DCF13B4A41BFE689EFB344564126807354EB3B4A4183EC2AACBD >>> 445641C5 >>> >>> F5579DFA3B4A4121A624F3BF445641D717C6EBF73B4A41ABBB2195C744564161A21A >>> 04F33B4A >>> >>> 41FB77D15FD5445641D0D839DB053C4A41B7831098D84456410A907C33073C4A4142 >>> 44DACED0 >>> >>> 44564148A334A9163C4A41547CEC36D1445641BF7B60D5363C4A41BCF33468D14456 >>> 41F68B9D >>> >>> FE393C4A411283312ADA445641B45CC31A4C3C4A41F6A929D1D744564185C3D2CE56 >>> 3C4A4146 >>> >>> BC02D9D64456410E266F8E503C4A41256BD10AC544564178A04D1C4E3C4A416E5030 >>> 6BBD4456 >>> >>> 417ED898E54C3C4A41A3F1EA24B6445641C11890CB4D3C4A4185584DDFAE44564110 >>> 0E678C50 >>> >>> 3C4A41447D8CC1A8445641C8EA7258533C4A41D025F919A4445641F45E60645B3C4A >>> 41F11D11 >>> >>> 5B9B445641769EB3136B3C4A41DD06E5858D44564175B35E1A703C4A41CBE002D887 >>> 4456418E >>> >>> E0827A743C4A41A399728D80445641C2DE7203773C4A4116C1F4C579445641BF3B19 >>> 2A783C4A >>> >>> 41250884A571445641B465A72D773C4A41317A276E5C4456414FFAB66E6C3C4A41EE >>> 3D4D3554 >>> >>> 445641D8E3F8AF613C4A41CC142A074A445641C4DD74D9493C4A41E18223504A4456 >>> 4149E72F >>> >>> 02203C4A416083AE4C4B445641BB020316163C4A417AD8A6804D44564115A108B702 >>> 3C4A4133 >>> >>> B9970352445641667D32D4FA3B4A413B9DE3AB52445641206FE7D0EF3B4A410F1221 >>> 7D524456 >>> >>> 416EAA545EE83B4A41E4AAF88E51445641C242D969DD3B4A41BC9873F84F44564159 >>> 773A65CF >>> >>> 3B4A410D0595C04B445641B4F85B10CF3B4A4187C6CA374A445641883CC8C0C73B4A >>> 419A306D >>> >>> 07464456419595327EBB3B4A41A5F9E0843F445641A4113DFEA83B4A4120D2EB1E36 >>> 44564157 >>> >>> 6BBF8A9D3B4A41334EA22D30445641F52DD12E9C3B4A411BEEF45232445641A4E92D >>> F3973B4A >>> >>> 413F90FFD13444564143331E7A943B4A41F761391136445641A69D4CB1903B4A414D >>> C4100837 >>> >>> 445641267AE7258C3B4A41A46AA98B37445641AFD254247C3B4A41E986946E384456 >>> 417541D6 >>> >>> 286D3B4A416D1F52DB3944564158B4E7076B3B4A412A3AF20F3A4456419F2AFEC462 >>> 3B4A4145 >>> >>> 0828DC3A44564109C6A7D5613B4A416D1F52DB39445641E9BFB312583B4A413FC197 >>> 913B4456 >>> >>> 4137F356324D3B4A4145E438BF3E445641A69714F4243B4A41FF1C9DC249445641F8 >>> 194AC213 >>> >>> 3B4A4129F0221B4F445641FA42FB2D133B4A41A2CCF75B54445641616D3114153B4A >>> 419CB61B >>> >>> 4C58445641BF8B0E1D183B4A418E3130FA5B4456415BD1C57B1F3B4A41AE6C11205E >>> 445641EB >>> >>> C43854353B4A4112AAE30063445641F4DE50CD423B4A41B562C8B96C4456417E0F5D >>> 25413B4A >>> >>> 41BA301B6C6D445641CBDFD71D343B4A41E66F8A9663445641805C16E81C3B4A41F8 >>> 72CAAB5E >>> >>> 445641433BF7F3173B4A41BAB368095D4456413F29FF2F143B4A41D805CA755A4456 >>> 41C55526 >>> >>> D1103B4A4158A7F41B554456415BF92622113B4A41885AA7994F4456416402759FF5 >>> 3A4A4116 >>> >>> 623BE750445641F6FFBDB0F23A4A415EB061555044564131A5403BE93A4A418CC63C >>> FA4C4456 >>> >>> 412FFBA344E43A4A418D36F0724C4456415DB86386B33A4A41BFA5FE494D445641A5 >>> FD702CAD >>> >>> 3A4A417D8DBFBC4D445641A2967FC9A33A4A41E508260650445641FAC39BD16C3A4A >>> 419ABBC1 >>> >>> 1F5F445641E2C7B9E9683A4A413EFFA1685F44564170F2B498613A4A41F872CAAB5E >>> 44564192 >>> >>> C7B713423A4A41D76C65915B445641F5A23B242A3A4A41F4F96F2D5A445641DAD3B5 >>> 921B3A4A >>> >>> 4168628F5858445641AF0DF4EC133A4A41F038A8CC56445641807AF58D0D3A4A41F8 >>> 0F4C3D56 >>> >>> 445641641AB90A073A4A412046A47557445641764EC9D5013A4A417192BBD7584456 >>> 41C1CD4D >>> >>> 37FE394A418E16E7775B445641E07DDC1AFA394A418AE5C1E55E445641783329A1F1 >>> 394A411E >>> >>> EC95816444564171FF88C2E8394A41BB6F1AAA694456411A500F6DD9394A414D4590 >>> 52724456 >>> >>> 4160B99CAEE8394A41D4C6E9F3744456411E15301DF4394A41E6F51C60794456416C >>> D799DEF7 >>> >>> 394A41A3D453B37A4456411D105594103A4A41CC5FFA667E44564136C98BE8183A4A >>> 4147B127 >>> >>> 89804456414A49D33C213A4A41B381F8C8814456414633A250283A4A41AA794B4182 >>> 44564122 >>> >>> 3F70313C3A4A415F233FEA82445641B5899402483A4A410904F70B8344564117DDEF >>> EC5C3A4A >>> >>> 41E541706483445641E6247DF6713A4A417E1B589683445641A219CD66933A4A4137 >>> 2C3C3784 >>> >>> 44564146FD76AECD3A4A41F5171BC28644564129A670D9D23A4A41BB8934F9874456 >>> 4136C565 >>> >>> B1D63A4A4104824C3A89445641265EE8E6E03A4A41B0E45ABC8D44564141F89B25EA >>> 3A4A416D >>> >>> 9A8BC792445641E1B6AC97EC3A4A41EE52A9E19444564164801FAAFA3A4A414E05B8 >>> 289A4456 >>> >>> 41A5D6BC7F113B4A41DA9C414B8C445641,1) >>> NOTICE: recordset_object1: >>> (451,0103000020EB7A00000100000007000000F6285CEF5D3C4A413E0AD7134A445 >>> 641D7A37 >>> >>> 0DD733C4A411F85EB0159445641C2F5283C7C3C4A413E0AD72359445641EC51B8FE7 >>> A3C4A41D >>> >>> 7A370FD47445641EC51B8FE733C4A413E0AD76348445641713D0A57663C4A418FC2F >>> 54849445 >>> >>> 641F6285CEF5D3C4A413E0AD7134A445641) >>> >>> ERROR: could not open relation with OID 25736 >>> CONTEXT: PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at >>> RAISE >>> >>> If anybody has suggestions, I would be very happy. If you need more >>> information or the two tables in question, please tell me. >>> >>> Many thanks, >>> >>> Birgit. >>> >>> CREATE OR REPLACE FUNCTION _laggner_b_pgdifference_a() >>> RETURNS void AS >>> $BODY$ >>> >>> DECLARE >>> counter integer; >>> recordset_object1 RECORD; >>> recordset_object2 RECORD; >>> recordset_object2a RECORD; >>> recordset_object3 RECORD; >>> i integer; >>> n integer; >>> j integer; >>> m integer; >>> >>> BEGIN >>> --4. Difference a (dlm07): >>> >>> counter := 0; >>> i := 0; >>> n := count(dlm07_id) from birgit.ni_dlm07_clip2; >>> >>> FOR i in 1..n LOOP --LOOP 1 >>> >>> RAISE NOTICE 'Beginn Difference f?r dlm07-Polygon % ', i; >>> >>> SELECT dlm07_id, the_geom INTO recordset_object1 from >>> birgit.ni_dlm07_clip2 where dlm07_id=i; >>> >>> SELECT b.inv07_id as inv07_id, b.the_geom as the_geom INTO >>> recordset_object2 >>> from birgit.ni_dlm07_clip2 a, >>> birgit.ni_inv07_clip2 b >>> where a.dlm07_id=i and >>> st_relate(a.the_geom, b.the_geom, '2********'); >>> >>> m := count(recordset_object2.inv07_id); >>> >>> RAISE NOTICE 'Anzahl Intersection-Polygone: % ', m; >>> >>> IF m > 0 THEN >>> >>> execute >>> 'create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id >>> integer, the_geom geometry);'; >>> >>> insert into birgit.test_diff_dlm07_tmp (inv07_id, the_geom) >>> select recordset_object2.inv07_id, recordset_object2.the_geom; >>> >>> SELECT a.inv07_id as inv07_id, >>> a.the_geom as the_geom, >>> a.gid as gid >>> INTO recordset_object2a >>> FROM birgit.test_diff_dlm07_tmp a; >>> >>> RAISE NOTICE 'recordset_object2a: %', recordset_object2a; >>> >>> execute >>> 'drop table birgit.test_diff_dlm07_tmp;'; >>> >>> j := 0; >>> >>> FOR j in 1..m LOOP --LOOP 2 >>> >>> RAISE NOTICE 'recordset_object1: %', recordset_object1; RAISE >>> NOTICE >>> 'recordset_object2a: %', recordset_object2a; >>> >>> SELECT recordset_object1.dlm07_id as dlm07_id, >>> st_difference(recordset_object1.the_geom, >>> recordset_object2a.the_geom) as >>> the_geom >>> INTO recordset_object3 >>> WHERE recordset_object2a.gid=j; >>> >>> SELECT recordset_object3.dlm07_id as dlm07_id, >>> recordset_object3.the_geom as the_geom INTO recordset_object1; >>> >>> RAISE NOTICE 'Intersection-Polygon % verarbeitet. ', j; >>> >>> END LOOP; --END LOOP 2 >>> >>> IF st_isempty(recordset_object1.the_geom)='f' then >>> >>> INSERT INTO birgit.test_diff_dlm07 (dlm07_id, inv07_id, the_geom) >>> VALUES ( >>> recordset_object1.dlm07_id, >>> NULL, >>> recordset_object1.the_geom); >>> >>> END IF; >>> >>> RAISE NOTICE 'Difference-Polygon dlm07 % ist fertig. ', i ; >>> >>> ELSE RAISE NOTICE 'Kein Difference berechnet. '; >>> >>> END IF; >>> >>> counter := counter + 1; >>> >>> END LOOP; --END LOOP 1 >>> >>> END; >>> $BODY$ >>> LANGUAGE 'plpgsql' VOLATILE; >>> ALTER FUNCTION _laggner_b_pgdifference_a() OWNER TO postgres; >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at postgis.refractions.net >>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at postgis.refractions.net >>> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From g.vlahakis at telenavis.com Tue Dec 15 02:27:10 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Tue, 15 Dec 2009 12:27:10 +0200 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <4B255A03.8070507@gmail.com> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com><589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> <4B255A03.8070507@gmail.com> Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE288@zeus.prte> Did you also see that the connection is no longer valid from that point on and you need to re-connect? I mean, even if you wait and try again, it won't work. I have to resort in restarting the app but not I added code to try to drop and re-connect. Haven't hit the prob yet to confirm this solves it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of "Joao G." Sent: Sunday, December 13, 2009 11:18 PM To: PostGIS Users Discussion Subject: [postgis-users] Weird GEOS problem I also found this problem when issuing many queries per minute or when performing multiple/time demanding distance calculations between complex (multi)geometries. I use XP pro with R (RPostgreSQL lib) to connect to PostgreSQL. George Vlahakis escreveu: Ok thanks, I used to use npgsql but for spatial queries and binary geometry retrieval I found it the opposite. It has been some time, but I will try it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From joaofgo at gmail.com Tue Dec 15 12:16:41 2009 From: joaofgo at gmail.com (=?ISO-8859-1?Q?Jo=E3o_Gon=E7alves?=) Date: Tue, 15 Dec 2009 20:16:41 +0000 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <589F4F6707B81B4A8543B9C32628684FBFE288@zeus.prte> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com><589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> <4B255A03.8070507@gmail.com> <589F4F6707B81B4A8543B9C32628684FBFE288@zeus.prte> Message-ID: <4B27EEA9.1070606@gmail.com> Yes, the connection resource object goes invalid and I need to create a new one. I've also experienced server shut downs caused by this problem. Funny, I added eactly the same solution drop and reconnect within a tryCatch block. I'm guessing this is a server side/GEOS issue because it tends to happen in very specific conditions, in my case when geoproccessing is very intensive. Nevertheless, I have no real knowledge on GEOS internals to figure this out. > Did you also see that the connection is no longer valid from that > point on and you need to re-connect? I mean, even if you wait and try > again, it won't work. I have to resort in restarting the app but not I > added code to try to drop and re-connect. Haven't hit the prob yet to > confirm this solves it. > > > > *From:* postgis-users-bounces at postgis.refractions.net > [mailto:postgis-users-bounces at postgis.refractions.net] *On Behalf Of > *"Joao G." > *Sent:* Sunday, December 13, 2009 11:18 PM > *To:* PostGIS Users Discussion > *Subject:* [postgis-users] Weird GEOS problem > > > > I also found this problem when issuing many queries per minute or when > performing multiple/time demanding distance calculations between > complex (multi)geometries. I use XP pro with R (RPostgreSQL lib) to > connect to PostgreSQL. > > George Vlahakis escreveu: > > Ok thanks, I used to use npgsql but for spatial queries and binary > geometry retrieval I found it the opposite. It has been some time, but > I will try it. > > > > *From:* postgis-users-bounces at postgis.refractions.net > > [mailto:postgis-users-bounces at postgis.refractions.net] *On Behalf Of > *Emilie Laffray > *Sent:* Friday, December 11, 2009 1:13 PM > *To:* PostGIS Users Discussion > *Subject:* Re: [postgis-users] Weird GEOS problem > > > > > > 2009/12/11 George Vlahakis > > > Hi all, > > > > Probably nobody has seen this, but on a particular machine (Win XP) > every 2-3 hours or so I am getting the following error: > > > > System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating > GEOS Coordinate Sequence; Error while executing the query > > > > I might be wrong but you are using .NET? > If it is indeed the case, I would suggest dropping the use of odbc, > and use npgsql which provides a direct connection to the database. It > should give you better performance, and maybe extra stability. > > Emilie Laffray > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Tue Dec 15 13:50:46 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Tue, 15 Dec 2009 23:50:46 +0200 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <4B27EEA9.1070606@gmail.com> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com><589F4F6707B81B4A8543B9C32628684FBFE1EF@zeus.prte> <4B255A03.8070507@gmail.com><589F4F6707B81B4A8543B9C32628684FBFE288@zeus.prte> <4B27EEA9.1070606@gmail.com> Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE2B4@zeus.prte> Same here. Thanks for replying however. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Joao Goncalves Sent: Tuesday, December 15, 2009 10:17 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem Yes, the connection resource object goes invalid and I need to create a new one. I've also experienced server shut downs caused by this problem. Funny, I added eactly the same solution drop and reconnect within a tryCatch block. I'm guessing this is a server side/GEOS issue because it tends to happen in very specific conditions, in my case when geoproccessing is very intensive. Nevertheless, I have no real knowledge on GEOS internals to figure this out. Did you also see that the connection is no longer valid from that point on and you need to re-connect? I mean, even if you wait and try again, it won't work. I have to resort in restarting the app but not I added code to try to drop and re-connect. Haven't hit the prob yet to confirm this solves it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of "Joao G." Sent: Sunday, December 13, 2009 11:18 PM To: PostGIS Users Discussion Subject: [postgis-users] Weird GEOS problem I also found this problem when issuing many queries per minute or when performing multiple/time demanding distance calculations between complex (multi)geometries. I use XP pro with R (RPostgreSQL lib) to connect to PostgreSQL. George Vlahakis escreveu: Ok thanks, I used to use npgsql but for spatial queries and binary geometry retrieval I found it the opposite. It has been some time, but I will try it. From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgit.laggner at vti.bund.de Wed Dec 16 04:38:47 2009 From: birgit.laggner at vti.bund.de (Birgit Laggner) Date: Wed, 16 Dec 2009 13:38:47 +0100 Subject: [postgis-users] problem with plpgsql function - ERROR: could not open relation with OID XXX In-Reply-To: <417C5A1B3FB5428D9D6AAC449446D947@b> References: <4B17F49B.2040801@vti.bund.de> <4B181281.1060209@refractions.net> <4B260DDE.2040600@vti.bund.de> <417C5A1B3FB5428D9D6AAC449446D947@b> Message-ID: <4B28D4D7.4000001@vti.bund.de> Hi Regina, Kevin and Leo, I just solved the problem. For testing purposes, I deleted the rows in the data table which were causing problems. Then the function ran without problems, but, unfortunately, the result was not as I expected. After some research, I discovered that I used the data type "record" in a wrong way. I thought this data type would store more than one row which it doesn't... Now, I changed my function and it works properly, also including the rows which were causing problems in the former version. Thanks for your help! Birgit. On 15.12.2009 08:59, Paragon Corporation wrote: > Birgit, > > Never gotten that error before, but I have had success at least with 8.4 > doing a vacuum analyze on the corrupted table. When I get erros like > page_header not found. > > You can try doing that and see if it makes a difference. Though not sure if > you can put that in a stored proc, since I've never tried. > > Hope that helps, > Regina > > -----Original Message----- > From: postgis-users-bounces at postgis.refractions.net > [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Birgit > Laggner > Sent: Monday, December 14, 2009 5:05 AM > To: PostGIS Users Discussion > Subject: Re: [postgis-users] problem with plpgsql function - ERROR: could > not open relation with OID XXX > > Hi Leo, > > with your TRUNCATE and ALTER SEQUENCE method, I still get an error at > polygon 451, but a new one: > > ERROR: missing chunk number 0 for toast value 27366 in pg_toast_26963 SQL > Status:XX000 Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 63 > at RAISE > > I think, this describes the problem better then the oid referencing error. > As a result of a Google search, I got the impression that there might be a > corrupted row (polygon 451) in the database table. Any suggestions how to > solve the problem? > > Thanks, > > Birgit. > > > > Birgit Laggner wrote: > >> Hi Kevin, >> >> to define the table name in question as a variable did not work, >> unfortunately. I get the same error message as before. Now, I will try >> the TRUNCATE and ALTER SEQUENCE method of Leo... >> >> Regards, Birgit. >> >> >> Birgit Laggner wrote: >> >>> Thanks, Kevin and Leo! I will try your suggestions today. >>> >>> Birgit. >>> >>> Kevin Neufeld wrote: >>> >>>> Yeah, I agree. What I've done to get around the caching problem >>>> that seems to work is to define all table names as variables at the >>>> top of the function. All the sql statements used throughout the >>>> function then reference a variable instead of an actual table. The >>>> planner can't cache the query plan since the query is adhoc ... no >>>> OID referencing problem. >>>> -- Kevin >>>> >>>> Paragon Corporation wrote: >>>> Birgit, >>>> >>>> I suspect as you alluded to that you are a victim of the dreaded >>>> cached plan and your OID issue is because the new table doesn't have >>>> the same OID as the old table. 8.4 is supposed to be smart enough to >>>> invalidate plans in these situations, thought maybe not. >>>> >>>> One possible work around is instead of creating and dropping the >>>> table, why don't you just TRUNCATE the table and reset the sequence >>>> >>>> So something like >>>> >>>> >>>> TRUNCATE TABLE birgit.test_diff_dlm07_tmp; ALTER SEQUENCE >>>> birgit.test_diff_dlm07_tmp.gid RESTART WITH 1; >>>> >>>> >>>> You could also use CREATE TEMP TABLE instead of CREATE TABLE. I >>>> suspect temp table oids may not be cached. >>>> >>>> Leo >>>> >>>> >>>> -----Original Message----- >>>> From: postgis-users-bounces at postgis.refractions.net >>>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of >>>> Birgit Laggner >>>> Sent: Thursday, December 03, 2009 12:26 PM >>>> To: PostGIS Users Discussion >>>> Subject: [postgis-users] problem with plpgsql function - ERROR: >>>> could not open relation with OID XXX >>>> >>>> Dear list, >>>> >>>> I have written a pl/pgsql function (see below) for st_difference >>>> which in short should sequentially scan a geometric table (a) if >>>> there are intersections with geometric table (b) and if there are, >>>> it writes the intersecting polygons of table (b) into an extra table >>>> and then executes the st_difference for the actual polygon of table >>>> (a) and all polygons of table (b ) written in the extra table as a >>>> sequence always using the product of the last difference as the >>>> input (instead of the table (a) >>>> polygon) of the next difference. I hope everybody understands my way >>>> of thinking ;-) >>>> >>>> My problem is now, that at polygon 451 of table (a), the function >>>> stops with the following error message: >>>> >>>> ERROR: could not open relation with OID 25736 SQL Status:XX000 >>>> Kontext:PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at >>>> RAISE >>>> >>>> Strange is, that the function did run successfully for more than 100 >>>> difference-loops. In an older PostGres version (8.1...), I have had >>>> a similar problem, but then always in the 2nd loop, because of the >>>> cashing-problem of the query planner. >>>> >>>> This are the PostGIS/PostgreSQL versions I am using: >>>> PostgreSQL: 8.4.1-2.1 >>>> PostGIS: 1.4.0-10.1 >>>> >>>> Here, the last few message rows of the running function, perhaps >>>> this helps with understanding the problem (sorry because it's partly >>>> in German, I hope it doesn't matter): >>>> >>>> NOTICE: Beginn Difference f?r dlm07-Polygon 450 >>>> NOTICE: Anzahl Intersection-Polygone: 1 >>>> NOTICE: CREATE TABLE erstellt implizit eine Sequenz >>>> ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte >>>> ?test_diff_dlm07_tmp.gid? >>>> CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp >>>> (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL >>>> function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung >>>> NOTICE: recordset_object2a: >>>> (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC875191 >>>> 41564121 >>>> >>>> B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6 >>>> AD773D4A >>>> >>>> 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD >>>> 0E943870 >>>> >>>> 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F0504156 >>>> 41D2D792 >>>> >>>> 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD >>>> 3C4A4142 >>>> >>>> 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A41704938 >>>> 51304156 >>>> >>>> 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163 >>>> BDF058E9 >>>> >>>> 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A >>>> 419F2015 >>>> >>>> 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49 >>>> 415641EE >>>> >>>> 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F64 >>>> 2C703C4A >>>> >>>> 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111 >>>> FD983366 >>>> >>>> 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F7465059744156 >>>> 41125009 >>>> >>>> 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB >>>> 3C4A418B >>>> >>>> 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C >>>> 8F914156 >>>> >>>> 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1 >>>> ) >>>> NOTICE: recordset_object1: >>>> (450,0103000020EB7A00000100000022000000CC72F1149A3C4A41000000002B415 >>>> 641295C8 >>>> >>>> F229A3C4A4185EB51582B4156413E0AD7A3983C4A41000000002B415641351D7C688 >>>> 33C4A410 >>>> >>>> 00000002B415641F6285C2F7E3C4A410000001031415641B81E856B913C4A41A4703 >>>> D6A35415 >>>> >>>> 6413E0AD723AD3C4A41AE47E17A3B415641B81E850BAE3C4A4114AE47E13E415641E >>>> 17A144EA >>>> >>>> F3C4A417B14AEE74341564152B81EA5B03C4A410AD7A3B04741564114AE4721BB3C4 >>>> A41EC51B >>>> >>>> 82E474156417B14AE67CC3C4A41AE47E17A46415641B81E852BD83C4A411F85EB014 >>>> 64156416 >>>> >>>> 6666646D73C4A4185EB51B8454156413E0AD783D63C4A41666666664541564114AE4 >>>> 761D53C4 >>>> >>>> A41B81E85DB44415641295C8F02D53C4A418FC2F548444156413E0AD703D53C4A416 >>>> 66666C64 >>>> >>>> 34156419A999979D53C4A41AE47E1CA424156410AD7A330D63C4A41713D0AA741415 >>>> 641A4703 >>>> >>>> D8AD73C4A41B81E859B40415641A4703DEAD93C4A41E17A14CE3E415641713D0A17D >>>> B3C4A41B >>>> >>>> 81E85DB3D415641CDCCCC8CDC3C4A41F6285CAF3C415641E17A148EDF3C4A41AE47E >>>> 10A3B415 >>>> >>>> 6419A999959E13C4A410AD7A3103A4156413E0AD7E3E23C4A4148E17AC438415641A >>>> 4703D0AE >>>> >>>> 43C4A41AE47E13A38415641A4703DCAEB3C4A4114AE47213841564100000060EC3C4 >>>> A413E0AD >>>> >>>> 7D33241564114AE47E1E03C4A41D7A370AD324156419A999979E33C4A417B14AE772 >>>> E4156418 >>>> >>>> 82F554CE43C4A41000000002B415641CC72F1149A3C4A41000000002B415641) >>>> NOTICE: recordset_object2a: >>>> (309108,0103000020EB7A000001000000220000009B8A50B33D3D4A410CFC875191 >>>> 41564121 >>>> >>>> B29CCB563D4A4106E2E205904156415229B1B2773D4A41BE9861008E415641D117B6 >>>> AD773D4A >>>> >>>> 41B9A76ADF6F4156410BF8A3EF3F3D4A41BD0E943870415641AFF9CD0B1D3D4A41BD >>>> 0E943870 >>>> >>>> 4156417CB35079F93C4A419BD797C96F41564178CEEED7F63C4A41E6DDA2F0504156 >>>> 41D2D792 >>>> >>>> 9CF53C4A41DF1DF01D46415641D5BD901CAE3C4A41F8BCF27D464156415E242F79AD >>>> 3C4A4142 >>>> >>>> 690C973A4156419B31B5B3893C4A41BA142C323341564105B615097B3C4A41704938 >>>> 51304156 >>>> >>>> 41D1ABC0367F3C4A41000000002B4156415FC001E8EB3B4A41000000002B41564163 >>>> BDF058E9 >>>> >>>> 3B4A415E78DD7F2D4156417B1DF30FE43B4A4108E03B8E324156412AD0C960063C4A >>>> 419F2015 >>>> >>>> 233A41564114F5B712333C4A41DA07856543415641A34C690B4D3C4A41F4AF672C49 >>>> 415641EE >>>> >>>> 6CACD25B3C4A41A76FFFEE4C4156412B1572B3653C4A4194013F074F4156417A6F64 >>>> 2C703C4A >>>> >>>> 41ED905744544156416FED9E4A833C4A417BFF4EB75F41564133189B64913C4A4111 >>>> FD983366 >>>> >>>> 4156419FF0E035993C4A4127C0195969415641E9615636B93C4A41F7465059744156 >>>> 41125009 >>>> >>>> 96C43C4A41609FC0987841564123E75FD9CE3C4A418FDC793F9141564183752A27DB >>>> 3C4A418B >>>> >>>> 99EA269041564192DE2C6CFB3C4A41C198D3C29041564174C52E98113D4A41BB824C >>>> 8F914156 >>>> >>>> 41579F17352D3D4A41AF447FC5914156419B8A50B33D3D4A410CFC875191415641,1 >>>> ) >>>> NOTICE: Intersection-Polygon 1 verarbeitet. >>>> NOTICE: Difference-Polygon dlm07 450 ist fertig. >>>> NOTICE: Beginn Difference f?r dlm07-Polygon 451 >>>> NOTICE: Anzahl Intersection-Polygone: 1 >>>> NOTICE: CREATE TABLE erstellt implizit eine Sequenz >>>> ?test_diff_dlm07_tmp_gid_seq? f?r die ?serial?-Spalte >>>> ?test_diff_dlm07_tmp.gid? >>>> CONTEXT: SQL-Anweisung ?create table birgit.test_diff_dlm07_tmp >>>> (gid serial, inv07_id integer, the_geom geometry);? PL/pgSQL >>>> function "_laggner_b_pgdifference_a" line 39 at EXECUTE-Anweisung >>>> NOTICE: recordset_object2a: >>>> (242405,0103000020EB7A00000100000093000000A5D6BC7F113B4A41DA9C414B8C >>>> 44564150 >>>> >>>> FAAEDD133B4A419F49202D8B4456412FF0D7391B3B4A41168EC19286445641E5C111 >>>> 791C3B4A >>>> >>>> 412DEE6FD88D44564193716BA71F3B4A41527950589B4456413706B5B4203B4A411C >>>> A7E1639F >>>> >>>> 4456417F264CED223B4A410BDF111DA544564195B45007273B4A410C80CF17AE4456 >>>> 41233940 >>>> >>>> 05293B4A41D9F53FC8B34456417B6AB9082D3B4A415F147142B4445641B5FC2FAC30 >>>> 3B4A4129 >>>> >>>> 35E853B4445641C323EFF1373B4A41C18C5DAAB34456412A8D25813F3B4A41C33BF4 >>>> E5B24456 >>>> >>>> 41022A8ED84C3B4A4118E6FF5DB2445641F237A3BB5D3B4A414C7E863FB244564191 >>>> C9735265 >>>> >>>> 3B4A410E9B8A5CB1445641529A25D6633B4A41C47E2DB7AD445641B5D7BDEA5E3B4A >>>> 4160BF3D >>>> >>>> D7A4445641064DA2335A3B4A41B397823D9B445641468081F5693B4A412AAF71059B >>>> 44564174 >>>> >>>> 5B60647B3B4A4188667A919A4456411E7579487A3B4A41BA466E559944564131F2D4 >>>> F87E3B4A >>>> >>>> 41C9563A27994456414A570C2C893B4A41CC1B91F797445641FAD2C8BCA33B4A419E >>>> EF661595 >>>> >>>> 44564194F74682CE3B4A41C8A7A28090445641F677AA51E53B4A41C3AC804A8E4456 >>>> 419D16B3 >>>> >>>> 33023C4A4145B4DB368B4456412CD4AE17083C4A4172F829968A4456418E660AAB22 >>>> 3C4A4142 >>>> >>>> 4103B9874456414F5B3AF4233C4A4100517DEF92445641F472B68E233C4A41C56C4F >>>> 98934456 >>>> >>>> 4102FCF859223C4A415E932D9A95445641EFCC195F113C4A41DB4F155BA644564154 >>>> 57E1A40E >>>> >>>> 3C4A4151BCC460A9445641115545C6083C4A41DC02CB19B14456418064136EF33B4A >>>> 413F76BC >>>> >>>> D1AC445641DB6389DCF13B4A41BFE689EFB344564126807354EB3B4A4183EC2AACBD >>>> 445641C5 >>>> >>>> F5579DFA3B4A4121A624F3BF445641D717C6EBF73B4A41ABBB2195C744564161A21A >>>> 04F33B4A >>>> >>>> 41FB77D15FD5445641D0D839DB053C4A41B7831098D84456410A907C33073C4A4142 >>>> 44DACED0 >>>> >>>> 44564148A334A9163C4A41547CEC36D1445641BF7B60D5363C4A41BCF33468D14456 >>>> 41F68B9D >>>> >>>> FE393C4A411283312ADA445641B45CC31A4C3C4A41F6A929D1D744564185C3D2CE56 >>>> 3C4A4146 >>>> >>>> BC02D9D64456410E266F8E503C4A41256BD10AC544564178A04D1C4E3C4A416E5030 >>>> 6BBD4456 >>>> >>>> 417ED898E54C3C4A41A3F1EA24B6445641C11890CB4D3C4A4185584DDFAE44564110 >>>> 0E678C50 >>>> >>>> 3C4A41447D8CC1A8445641C8EA7258533C4A41D025F919A4445641F45E60645B3C4A >>>> 41F11D11 >>>> >>>> 5B9B445641769EB3136B3C4A41DD06E5858D44564175B35E1A703C4A41CBE002D887 >>>> 4456418E >>>> >>>> E0827A743C4A41A399728D80445641C2DE7203773C4A4116C1F4C579445641BF3B19 >>>> 2A783C4A >>>> >>>> 41250884A571445641B465A72D773C4A41317A276E5C4456414FFAB66E6C3C4A41EE >>>> 3D4D3554 >>>> >>>> 445641D8E3F8AF613C4A41CC142A074A445641C4DD74D9493C4A41E18223504A4456 >>>> 4149E72F >>>> >>>> 02203C4A416083AE4C4B445641BB020316163C4A417AD8A6804D44564115A108B702 >>>> 3C4A4133 >>>> >>>> B9970352445641667D32D4FA3B4A413B9DE3AB52445641206FE7D0EF3B4A410F1221 >>>> 7D524456 >>>> >>>> 416EAA545EE83B4A41E4AAF88E51445641C242D969DD3B4A41BC9873F84F44564159 >>>> 773A65CF >>>> >>>> 3B4A410D0595C04B445641B4F85B10CF3B4A4187C6CA374A445641883CC8C0C73B4A >>>> 419A306D >>>> >>>> 07464456419595327EBB3B4A41A5F9E0843F445641A4113DFEA83B4A4120D2EB1E36 >>>> 44564157 >>>> >>>> 6BBF8A9D3B4A41334EA22D30445641F52DD12E9C3B4A411BEEF45232445641A4E92D >>>> F3973B4A >>>> >>>> 413F90FFD13444564143331E7A943B4A41F761391136445641A69D4CB1903B4A414D >>>> C4100837 >>>> >>>> 445641267AE7258C3B4A41A46AA98B37445641AFD254247C3B4A41E986946E384456 >>>> 417541D6 >>>> >>>> 286D3B4A416D1F52DB3944564158B4E7076B3B4A412A3AF20F3A4456419F2AFEC462 >>>> 3B4A4145 >>>> >>>> 0828DC3A44564109C6A7D5613B4A416D1F52DB39445641E9BFB312583B4A413FC197 >>>> 913B4456 >>>> >>>> 4137F356324D3B4A4145E438BF3E445641A69714F4243B4A41FF1C9DC249445641F8 >>>> 194AC213 >>>> >>>> 3B4A4129F0221B4F445641FA42FB2D133B4A41A2CCF75B54445641616D3114153B4A >>>> 419CB61B >>>> >>>> 4C58445641BF8B0E1D183B4A418E3130FA5B4456415BD1C57B1F3B4A41AE6C11205E >>>> 445641EB >>>> >>>> C43854353B4A4112AAE30063445641F4DE50CD423B4A41B562C8B96C4456417E0F5D >>>> 25413B4A >>>> >>>> 41BA301B6C6D445641CBDFD71D343B4A41E66F8A9663445641805C16E81C3B4A41F8 >>>> 72CAAB5E >>>> >>>> 445641433BF7F3173B4A41BAB368095D4456413F29FF2F143B4A41D805CA755A4456 >>>> 41C55526 >>>> >>>> D1103B4A4158A7F41B554456415BF92622113B4A41885AA7994F4456416402759FF5 >>>> 3A4A4116 >>>> >>>> 623BE750445641F6FFBDB0F23A4A415EB061555044564131A5403BE93A4A418CC63C >>>> FA4C4456 >>>> >>>> 412FFBA344E43A4A418D36F0724C4456415DB86386B33A4A41BFA5FE494D445641A5 >>>> FD702CAD >>>> >>>> 3A4A417D8DBFBC4D445641A2967FC9A33A4A41E508260650445641FAC39BD16C3A4A >>>> 419ABBC1 >>>> >>>> 1F5F445641E2C7B9E9683A4A413EFFA1685F44564170F2B498613A4A41F872CAAB5E >>>> 44564192 >>>> >>>> C7B713423A4A41D76C65915B445641F5A23B242A3A4A41F4F96F2D5A445641DAD3B5 >>>> 921B3A4A >>>> >>>> 4168628F5858445641AF0DF4EC133A4A41F038A8CC56445641807AF58D0D3A4A41F8 >>>> 0F4C3D56 >>>> >>>> 445641641AB90A073A4A412046A47557445641764EC9D5013A4A417192BBD7584456 >>>> 41C1CD4D >>>> >>>> 37FE394A418E16E7775B445641E07DDC1AFA394A418AE5C1E55E445641783329A1F1 >>>> 394A411E >>>> >>>> EC95816444564171FF88C2E8394A41BB6F1AAA694456411A500F6DD9394A414D4590 >>>> 52724456 >>>> >>>> 4160B99CAEE8394A41D4C6E9F3744456411E15301DF4394A41E6F51C60794456416C >>>> D799DEF7 >>>> >>>> 394A41A3D453B37A4456411D105594103A4A41CC5FFA667E44564136C98BE8183A4A >>>> 4147B127 >>>> >>>> 89804456414A49D33C213A4A41B381F8C8814456414633A250283A4A41AA794B4182 >>>> 44564122 >>>> >>>> 3F70313C3A4A415F233FEA82445641B5899402483A4A410904F70B8344564117DDEF >>>> EC5C3A4A >>>> >>>> 41E541706483445641E6247DF6713A4A417E1B589683445641A219CD66933A4A4137 >>>> 2C3C3784 >>>> >>>> 44564146FD76AECD3A4A41F5171BC28644564129A670D9D23A4A41BB8934F9874456 >>>> 4136C565 >>>> >>>> B1D63A4A4104824C3A89445641265EE8E6E03A4A41B0E45ABC8D44564141F89B25EA >>>> 3A4A416D >>>> >>>> 9A8BC792445641E1B6AC97EC3A4A41EE52A9E19444564164801FAAFA3A4A414E05B8 >>>> 289A4456 >>>> >>>> 41A5D6BC7F113B4A41DA9C414B8C445641,1) >>>> NOTICE: recordset_object1: >>>> (451,0103000020EB7A00000100000007000000F6285CEF5D3C4A413E0AD7134A445 >>>> 641D7A37 >>>> >>>> 0DD733C4A411F85EB0159445641C2F5283C7C3C4A413E0AD72359445641EC51B8FE7 >>>> A3C4A41D >>>> >>>> 7A370FD47445641EC51B8FE733C4A413E0AD76348445641713D0A57663C4A418FC2F >>>> 54849445 >>>> >>>> 641F6285CEF5D3C4A413E0AD7134A445641) >>>> >>>> ERROR: could not open relation with OID 25736 >>>> CONTEXT: PL/pgSQL function "_laggner_b_pgdifference_a" line 67 at >>>> RAISE >>>> >>>> If anybody has suggestions, I would be very happy. If you need more >>>> information or the two tables in question, please tell me. >>>> >>>> Many thanks, >>>> >>>> Birgit. >>>> >>>> CREATE OR REPLACE FUNCTION _laggner_b_pgdifference_a() >>>> RETURNS void AS >>>> $BODY$ >>>> >>>> DECLARE >>>> counter integer; >>>> recordset_object1 RECORD; >>>> recordset_object2 RECORD; >>>> recordset_object2a RECORD; >>>> recordset_object3 RECORD; >>>> i integer; >>>> n integer; >>>> j integer; >>>> m integer; >>>> >>>> BEGIN >>>> --4. Difference a (dlm07): >>>> >>>> counter := 0; >>>> i := 0; >>>> n := count(dlm07_id) from birgit.ni_dlm07_clip2; >>>> >>>> FOR i in 1..n LOOP --LOOP 1 >>>> >>>> RAISE NOTICE 'Beginn Difference f?r dlm07-Polygon % ', i; >>>> >>>> SELECT dlm07_id, the_geom INTO recordset_object1 from >>>> birgit.ni_dlm07_clip2 where dlm07_id=i; >>>> >>>> SELECT b.inv07_id as inv07_id, b.the_geom as the_geom INTO >>>> recordset_object2 >>>> from birgit.ni_dlm07_clip2 a, >>>> birgit.ni_inv07_clip2 b >>>> where a.dlm07_id=i and >>>> st_relate(a.the_geom, b.the_geom, '2********'); >>>> >>>> m := count(recordset_object2.inv07_id); >>>> >>>> RAISE NOTICE 'Anzahl Intersection-Polygone: % ', m; >>>> >>>> IF m > 0 THEN >>>> >>>> execute >>>> 'create table birgit.test_diff_dlm07_tmp (gid serial, inv07_id >>>> integer, the_geom geometry);'; >>>> >>>> insert into birgit.test_diff_dlm07_tmp (inv07_id, the_geom) >>>> select recordset_object2.inv07_id, recordset_object2.the_geom; >>>> >>>> SELECT a.inv07_id as inv07_id, >>>> a.the_geom as the_geom, >>>> a.gid as gid >>>> INTO recordset_object2a >>>> FROM birgit.test_diff_dlm07_tmp a; >>>> >>>> RAISE NOTICE 'recordset_object2a: %', recordset_object2a; >>>> >>>> execute >>>> 'drop table birgit.test_diff_dlm07_tmp;'; >>>> >>>> j := 0; >>>> >>>> FOR j in 1..m LOOP --LOOP 2 >>>> >>>> RAISE NOTICE 'recordset_object1: %', recordset_object1; RAISE >>>> NOTICE >>>> 'recordset_object2a: %', recordset_object2a; >>>> >>>> SELECT recordset_object1.dlm07_id as dlm07_id, >>>> st_difference(recordset_object1.the_geom, >>>> recordset_object2a.the_geom) as >>>> the_geom >>>> INTO recordset_object3 >>>> WHERE recordset_object2a.gid=j; >>>> >>>> SELECT recordset_object3.dlm07_id as dlm07_id, >>>> recordset_object3.the_geom as the_geom INTO recordset_object1; >>>> >>>> RAISE NOTICE 'Intersection-Polygon % verarbeitet. ', j; >>>> >>>> END LOOP; --END LOOP 2 >>>> >>>> IF st_isempty(recordset_object1.the_geom)='f' then >>>> >>>> INSERT INTO birgit.test_diff_dlm07 (dlm07_id, inv07_id, the_geom) >>>> VALUES ( >>>> recordset_object1.dlm07_id, >>>> NULL, >>>> recordset_object1.the_geom); >>>> >>>> END IF; >>>> >>>> RAISE NOTICE 'Difference-Polygon dlm07 % ist fertig. ', i ; >>>> >>>> ELSE RAISE NOTICE 'Kein Difference berechnet. '; >>>> >>>> END IF; >>>> >>>> counter := counter + 1; >>>> >>>> END LOOP; --END LOOP 1 >>>> >>>> END; >>>> $BODY$ >>>> LANGUAGE 'plpgsql' VOLATILE; >>>> ALTER FUNCTION _laggner_b_pgdifference_a() OWNER TO postgres; >>>> >>>> >>>> _______________________________________________ >>>> postgis-users mailing list >>>> postgis-users at postgis.refractions.net >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>>> >>>> >>>> _______________________________________________ >>>> postgis-users mailing list >>>> postgis-users at postgis.refractions.net >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>>> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From netmasters.ma at gmail.com Wed Dec 16 07:46:44 2009 From: netmasters.ma at gmail.com (Mark Vantzelfde) Date: Wed, 16 Dec 2009 10:46:44 -0500 Subject: [postgis-users] template_postgis14 Message-ID: I am missing template template_postgis14 in my database server on a linux system. Both template0 and template1 are there. How do I go about installing template_postgis14? Thanks Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Wed Dec 16 07:54:14 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Wed, 16 Dec 2009 17:54:14 +0200 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE2E7@zeus.prte> Hi Emilie, Im trying to port over to npgsql but I cannot get the GeomFromWKB function to get called correctly. No matter what I do with the wkb parameter the query failes (error near \",\"). Any hints? const string sql = "INSERT INTO table (" + "client, category, description, geom)" + " VALUES (?, ?, ?, GeomFromWKB(?, 4326)) RETURNING id"; cmd = new NpgsqlCommand(sql, conn); cmd.Parameters.Add(string.Empty, request.ClientId); cmd.Parameters.Add(string.Empty, request.CategoryId); cmd.Parameters.Add(string.Empty, request.Description); byte[] bytes = GetWkbPolygon(request.Points); cmd.Parameters.Add(new NpgsqlParameter(string.Empty, bytes)); int id = (int)cmd.ExecuteScalar(); From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Friday, December 11, 2009 1:13 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/11 George Vlahakis Hi all, Probably nobody has seen this, but on a particular machine (Win XP) every 2-3 hours or so I am getting the following error: System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS Coordinate Sequence; Error while executing the query I might be wrong but you are using .NET? If it is indeed the case, I would suggest dropping the use of odbc, and use npgsql which provides a direct connection to the database. It should give you better performance, and maybe extra stability. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.ribot at gmail.com Wed Dec 16 08:01:54 2009 From: nicolas.ribot at gmail.com (Nicolas Ribot) Date: Wed, 16 Dec 2009 17:01:54 +0100 Subject: [postgis-users] template_postgis14 In-Reply-To: References: Message-ID: <28de5e310912160801r7e9cfbedu9a43113c46085164@mail.gmail.com> > I am missing template template_postgis14 in my database server on a linux > system. Both template0 and template1 are there. How do I go about installing > template_postgis14? > Never heard about template_postgis14, but I did not play a lot with 1.4 Can't you just recreate it after you installed postgis, as templates are just normal databases ? To do so, create the new template_postgis14 database, install plpgsql, install postgis on it, and voila. Nicolas From gilles.bassiere at makina-corpus.com Wed Dec 16 08:14:02 2009 From: gilles.bassiere at makina-corpus.com (=?ISO-8859-1?Q?Gilles_Bassi=E8re?=) Date: Wed, 16 Dec 2009 17:14:02 +0100 Subject: [postgis-users] template_postgis14 In-Reply-To: References: Message-ID: <4B29074A.8020902@makina-corpus.com> Mark Vantzelfde wrote: > I am missing template template_postgis14 in my database server on a > linux system. Both template0 and template1 are there. How do I go about > installing template_postgis14? > > Thanks > > Mark > Mark, The Windows installer indeed set up a postgis template for you. Please note that this installer is a 3rd-party software. With the basic Postgis installation, you have to load Postgis in your database manually. The official documentation explain this: http://postgis.refractions.net/docs/ch02.html#id2532099 (It is usually advised to read the documentation before asking the list). If you really want this template, you can create it using normal SQL. This post might help: http://geospatial.nomad-labs.com/2007/12/16/template-postgis-database/ It's a bit old but not outdated as far as I know (except filenames which has been renamed in 1.4). Hope it helps -- Gilles Bassi?re - MAKINA CORPUS http://www.makina-corpus.com From emilie.laffray at gmail.com Wed Dec 16 08:37:04 2009 From: emilie.laffray at gmail.com (Emilie Laffray) Date: Wed, 16 Dec 2009 16:37:04 +0000 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <589F4F6707B81B4A8543B9C32628684FBFE2E7@zeus.prte> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte> <7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com> <589F4F6707B81B4A8543B9C32628684FBFE2E7@zeus.prte> Message-ID: <7e9dfabf0912160837g6c2376f8laf0b3651b1b2031a@mail.gmail.com> 2009/12/16 George Vlahakis > Hi Emilie, > > > > Im trying to port over to npgsql but I cannot get the GeomFromWKB function > to get called correctly. No matter what I do with the wkb parameter the > query failes (error near \?,\?). Any hints? > > > > const string sql = *"INSERT INTO table ("* > > + *"client, category, description, > geom)"* > > + *" VALUES (?, ?, ?, GeomFromWKB(?, > 4326)) RETURNING id"*; > > > > cmd = new NpgsqlCommand(sql, conn); > > cmd.Parameters.Add(string.Empty, request.ClientId); > > cmd.Parameters.Add(string.Empty, request.CategoryId); > > cmd.Parameters.Add(string.Empty, request.Description); > > byte[] bytes = GetWkbPolygon(request.Points); > > cmd.Parameters.Add(new NpgsqlParameter(string.Empty, bytes > )); > > int id = (int)cmd.ExecuteScalar(); > > > Usually, I use parameters only when I am calling a function. Here is an example agent.AddParameter("@latitude", this.latitude); agent.AddParameter("@longitude", this.longitude); using (NpgsqlDataReader reader = agent.ExecuteReader("postgisfunction")) { if (reader.HasRows) { reader.Read(); } } } In this case, @latitude and @longitude are the name of the parameters for my function in Postgresql. I never write SQL statement directly in code. I hope this will be useful to you. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.vlahakis at telenavis.com Wed Dec 16 12:10:01 2009 From: g.vlahakis at telenavis.com (George Vlahakis) Date: Wed, 16 Dec 2009 22:10:01 +0200 Subject: [postgis-users] Weird GEOS problem In-Reply-To: <7e9dfabf0912160837g6c2376f8laf0b3651b1b2031a@mail.gmail.com> References: <589F4F6707B81B4A8543B9C32628684FBFE1DB@zeus.prte><7e9dfabf0912110313x526c63dax486ad760cf7de069@mail.gmail.com><589F4F6707B81B4A8543B9C32628684FBFE2E7@zeus.prte> <7e9dfabf0912160837g6c2376f8laf0b3651b1b2031a@mail.gmail.com> Message-ID: <589F4F6707B81B4A8543B9C32628684FBFE2F2@zeus.prte> Yeap, turns out that if I put all parameters as named it works. Thanks From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Emilie Laffray Sent: Wednesday, December 16, 2009 6:37 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Weird GEOS problem 2009/12/16 George Vlahakis Hi Emilie, Im trying to port over to npgsql but I cannot get the GeomFromWKB function to get called correctly. No matter what I do with the wkb parameter the query failes (error near \",\"). Any hints? const string sql = "INSERT INTO table (" + "client, category, description, geom)" + " VALUES (?, ?, ?, GeomFromWKB(?, 4326)) RETURNING id"; cmd = new NpgsqlCommand(sql, conn); cmd.Parameters.Add(string.Empty, request.ClientId); cmd.Parameters.Add(string.Empty, request.CategoryId); cmd.Parameters.Add(string.Empty, request.Description); byte[] bytes = GetWkbPolygon(request.Points); cmd.Parameters.Add(new NpgsqlParameter(string.Empty, bytes)); int id = (int)cmd.ExecuteScalar(); Usually, I use parameters only when I am calling a function. Here is an example agent.AddParameter("@latitude", this.latitude); agent.AddParameter("@longitude", this.longitude); using (NpgsqlDataReader reader = agent.ExecuteReader("postgisfunction")) { if (reader.HasRows) { reader.Read(); } } } In this case, @latitude and @longitude are the name of the parameters for my function in Postgresql. I never write SQL statement directly in code. I hope this will be useful to you. Emilie Laffray -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pierre.Racine at sbf.ulaval.ca Wed Dec 16 13:09:26 2009 From: Pierre.Racine at sbf.ulaval.ca (Pierre Racine) Date: Wed, 16 Dec 2009 16:09:26 -0500 Subject: [postgis-users] Getting the exact extent of a geometry Message-ID: <87A96661E65C5541AB4D20721C2DD7F84D014C872A@EXCH-MBX-A.ulaval.ca> Hi, ST_Envelope(geometry) returns a kind of degenerated version (float4s instead of float8s) of the extent of a geometry based on the cached BOX2D and ST_Extent(geometry) is an aggregate. Is there a non aggregate function which returns the exact extent (float8s) of a geometry? Try: SELECT ST_AsText(ST_Envelope('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) UNION ALL SELECT ST_AsText(ST_Box2D('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) UNION ALL SELECT ST_AsText(ST_Extent('LINESTRING(0 0, 1.00000000000001 1)'::geometry)); Thanks, Pierre From ahmettemiz88 at gmail.com Thu Dec 17 00:43:02 2009 From: ahmettemiz88 at gmail.com (ahmettemiz88 at gmail.com) Date: Thu, 17 Dec 2009 08:43:02 +0000 Subject: [postgis-users] problem in projection conversion Message-ID: <000e0cdf938e7668f3047ae89c84@google.com> hello before transfering basic map to postgis. I need to projection conversion. what is postgis way ? what is wrong about this project conversion ? resulting map does not seem to be in lat/long. ~$ ogr2ogr -t_srs EPSG:4326 -s_srs '+proj=lcc +lat_1=40.66666666 +lat_2=43.333333333 +lat_0=0 lon_0=34.0 +x_0=1000000 +y_0=0 +datum=wgs84 +units=m' geohidro_cizgi_adf9.shp hidro_cizgi_adf.shp ~~~~ orkun at orkun-desktop:~$ ogrinfo geohidro_cizgi_adf9.shp -al -summary INFO: Open of `geohidro_cizgi_adf9.shp' using driver `ESRI Shapefile' successful. Layer name: geohidro_cizgi_adf9 Geometry: Line String Feature Count: 4929 Extent: (-8.914342, 34.000149) - (11.953119, 42.237237) Layer SRS WKT: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_1984",6378137,298.257223563]], PRIMEM["Greenwich",0], UNIT["Degree",0.017453292519943295]] UserId: Integer (10.0) FNODE_: Integer (10.0) TNODE_: Integer (10.0) LPOLY_: Integer (10.0) RPOLY_: Integer (10.0) LENGTH: Real (32.3) HIDRO_CIZG: Integer (10.0) HIDRO_CIZG: Integer (10.0) F_CODE: String (80.0) F_NAME: String (80.0) SYMBOL: Integer (10.0) DISPSCALE: Integer (10.0) regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.cave-ayland at siriusit.co.uk Thu Dec 17 02:21:56 2009 From: mark.cave-ayland at siriusit.co.uk (Mark Cave-Ayland) Date: Thu, 17 Dec 2009 10:21:56 +0000 Subject: [postgis-users] Getting the exact extent of a geometry In-Reply-To: <87A96661E65C5541AB4D20721C2DD7F84D014C872A@EXCH-MBX-A.ulaval.ca> References: <87A96661E65C5541AB4D20721C2DD7F84D014C872A@EXCH-MBX-A.ulaval.ca> Message-ID: <4B2A0644.7020206@siriusit.co.uk> Pierre Racine wrote: > Hi, > > ST_Envelope(geometry) returns a kind of degenerated version (float4s instead of float8s) of the extent of a geometry based on the cached BOX2D and ST_Extent(geometry) is an aggregate. > > Is there a non aggregate function which returns the exact extent (float8s) of a geometry? > > Try: > > SELECT ST_AsText(ST_Envelope('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) > UNION ALL > SELECT ST_AsText(ST_Box2D('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) > UNION ALL > SELECT ST_AsText(ST_Extent('LINESTRING(0 0, 1.00000000000001 1)'::geometry)); > > Thanks, > > Pierre Uggg. Nothing should *ever* return the contents of a BOX2DFLOAT4 back to the user. If ST_Envelope() does, then this is definitely a bug. ATB, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs From birgit.laggner at vti.bund.de Thu Dec 17 07:27:43 2009 From: birgit.laggner at vti.bund.de (Birgit Laggner) Date: Thu, 17 Dec 2009 16:27:43 +0100 Subject: [postgis-users] plpgsql - problem using variable schema and table names Message-ID: <4B2A4DEF.7070401@vti.bund.de> Dear list, I am trying to generalize a pl/pgsql function I have written (see below). I would like to define schema and table names, as well as certain column names, in the function call (as in the PostGIS function AddGeometryColumn) in order to use them to define schema and table names and everything else within the function queries. My problem is, that postgres doesn't recognize the defined variable names if I call them in a FROM clause or INSERT INTO. This is the error message: ERROR: Schema ?schemaname? does not exist LINE 1: SELECT count( $1 ) from schemaname.table_a ^ QUERY: SELECT count( $1 ) from schemaname.table_a CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at assignment I can't imagine that it should be impossible to use variable schema and table names in a plpgsql function. So, if anybody has suggestions, I would be quite happy. Thanks and regards, Birgit. My PostGIS version: 1.4.0-10.1 My PostgreSQL version: 8.4.1-2.1 My pl/pgsql function: CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname varchar(20), table_a varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), intersection varchar(60)) RETURNS void AS $BODY$ DECLARE counter integer; recordset_object RECORD; i integer; n integer; BEGIN counter := 0; n := count(a_id) from schemaname.table_a; --1. Intersection: FOR i in 1..n LOOP RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; FOR recordset_object IN SELECT a.a_id , b.b_id, ST_intersection(a.the_geom, b.the_geom) AS the_geom FROM schemaname.table_a a, schemaname.table_b b WHERE a.a_id=i and st_intersects(a.the_geom, b.the_geom) and a.the_geom && b.the_geom LOOP execute 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', ''||b_id||'', the_geom) '|| 'VALUES ( '|| ''||recordset_object||'.''||a_id||'', '|| ''||recordset_object||'.''||b_id||'', '|| ''||recordset_object||'.the_geom);'; /* alternatively: INSERT INTO schemaname.intersection (a_id, b_id, the_geom) VALUES ( recordset_object.a_id, recordset_object.b_id, recordset_object.the_geom); */ counter := counter + 1; RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; END LOOP; counter := 0; END LOOP; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), table_a varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), intersection varchar(60)) OWNER TO postgres; From david.bitner at gmail.com Thu Dec 17 07:38:32 2009 From: david.bitner at gmail.com (David William Bitner) Date: Thu, 17 Dec 2009 09:38:32 -0600 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: <4B2A4DEF.7070401@vti.bund.de> References: <4B2A4DEF.7070401@vti.bund.de> Message-ID: Birgit, The problem may be that you are creating a varchar variable for your schema name and then you are trying to use it in an instance that is expecting a database object. Anytime you are trying to insert variables as database objects, you need to construct your query as a string and use execute similar as to how you are creating your insert statement. David On Thu, Dec 17, 2009 at 9:27 AM, Birgit Laggner wrote: > Dear list, > > I am trying to generalize a pl/pgsql function I have written (see > below). I would like to define schema and table names, as well as > certain column names, in the function call (as in the PostGIS function > AddGeometryColumn) in order to use them to define schema and table names > and everything else within the function queries. > > My problem is, that postgres doesn't recognize the defined variable > names if I call them in a FROM clause or INSERT INTO. This is the error > message: > > ERROR: Schema ?schemaname? does not exist > LINE 1: SELECT count( $1 ) from schemaname.table_a > ^ > QUERY: SELECT count( $1 ) from schemaname.table_a > CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at > assignment > > I can't imagine that it should be impossible to use variable schema and > table names in a plpgsql function. So, if anybody has suggestions, I > would be quite happy. > > Thanks and regards, > > Birgit. > > My PostGIS version: 1.4.0-10.1 > My PostgreSQL version: 8.4.1-2.1 > > My pl/pgsql function: > > CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname > varchar(20), table_a varchar(50), a_id varchar(20), table_b varchar(50), > b_id varchar(20), intersection varchar(60)) RETURNS void AS > $BODY$ > > DECLARE > counter integer; > recordset_object RECORD; > i integer; > n integer; > > BEGIN > > counter := 0; > n := count(a_id) from schemaname.table_a; > > --1. Intersection: > > FOR i in 1..n LOOP > > RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; > > FOR recordset_object IN > > SELECT > a.a_id , > b.b_id, > ST_intersection(a.the_geom, b.the_geom) AS the_geom > FROM schemaname.table_a a, schemaname.table_b b > WHERE a.a_id=i and > st_intersects(a.the_geom, b.the_geom) and > a.the_geom && b.the_geom > > LOOP > > execute > 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', > ''||b_id||'', the_geom) '|| > 'VALUES ( '|| > ''||recordset_object||'.''||a_id||'', '|| > ''||recordset_object||'.''||b_id||'', '|| > ''||recordset_object||'.the_geom);'; > /* > alternatively: > INSERT INTO schemaname.intersection (a_id, b_id, the_geom) > VALUES ( > recordset_object.a_id, > recordset_object.b_id, > recordset_object.the_geom); > */ > counter := counter + 1; > > RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; > > END LOOP; > > counter := 0; > > END LOOP; > > END; > $BODY$ > LANGUAGE 'plpgsql' VOLATILE; > ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), table_a > varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), > intersection varchar(60)) OWNER TO postgres; > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- ************************************ David William Bitner -------------- next part -------------- An HTML attachment was scrubbed... URL: From birgit.laggner at vti.bund.de Thu Dec 17 07:43:51 2009 From: birgit.laggner at vti.bund.de (Birgit Laggner) Date: Thu, 17 Dec 2009 16:43:51 +0100 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: References: <4B2A4DEF.7070401@vti.bund.de> Message-ID: <4B2A51B7.30707@vti.bund.de> Yes, I have noticed that, but I don't know how to do that, especially at defining my n (loop end point variable). I tried various versions (also with execute), but without success. Birgit. On 17.12.2009 16:38, David William Bitner wrote: > Birgit, > > The problem may be that you are creating a varchar variable for your > schema name and then you are trying to use it in an instance that is > expecting a database object. Anytime you are trying to insert > variables as database objects, you need to construct your query as a > string and use execute similar as to how you are creating your insert > statement. > > David > > On Thu, Dec 17, 2009 at 9:27 AM, Birgit Laggner > > wrote: > > Dear list, > > I am trying to generalize a pl/pgsql function I have written (see > below). I would like to define schema and table names, as well as > certain column names, in the function call (as in the PostGIS function > AddGeometryColumn) in order to use them to define schema and table > names > and everything else within the function queries. > > My problem is, that postgres doesn't recognize the defined variable > names if I call them in a FROM clause or INSERT INTO. This is the > error > message: > > ERROR: Schema ?schemaname? does not exist > LINE 1: SELECT count( $1 ) from schemaname.table_a > ^ > QUERY: SELECT count( $1 ) from schemaname.table_a > CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at > assignment > > I can't imagine that it should be impossible to use variable > schema and > table names in a plpgsql function. So, if anybody has suggestions, I > would be quite happy. > > Thanks and regards, > > Birgit. > > My PostGIS version: 1.4.0-10.1 > My PostgreSQL version: 8.4.1-2.1 > > My pl/pgsql function: > > CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname > varchar(20), table_a varchar(50), a_id varchar(20), table_b > varchar(50), > b_id varchar(20), intersection varchar(60)) RETURNS void AS > $BODY$ > > DECLARE > counter integer; > recordset_object RECORD; > i integer; > n integer; > > BEGIN > > counter := 0; > n := count(a_id) from schemaname.table_a; > > --1. Intersection: > > FOR i in 1..n LOOP > > RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; > > FOR recordset_object IN > > SELECT > a.a_id , > b.b_id, > ST_intersection(a.the_geom, b.the_geom) AS the_geom > FROM schemaname.table_a a, schemaname.table_b b > WHERE a.a_id=i and > st_intersects(a.the_geom, b.the_geom) and > a.the_geom && b.the_geom > > LOOP > > execute > 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', > ''||b_id||'', the_geom) '|| > 'VALUES ( '|| > ''||recordset_object||'.''||a_id||'', '|| > ''||recordset_object||'.''||b_id||'', '|| > ''||recordset_object||'.the_geom);'; > /* > alternatively: > INSERT INTO schemaname.intersection (a_id, b_id, the_geom) > VALUES ( > recordset_object.a_id, > recordset_object.b_id, > recordset_object.the_geom); > */ > counter := counter + 1; > > RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; > > END LOOP; > > counter := 0; > > END LOOP; > > END; > $BODY$ > LANGUAGE 'plpgsql' VOLATILE; > ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), > table_a > varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), > intersection varchar(60)) OWNER TO postgres; > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > > -- > ************************************ > David William Bitner > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pierre.Racine at sbf.ulaval.ca Thu Dec 17 08:05:01 2009 From: Pierre.Racine at sbf.ulaval.ca (Pierre Racine) Date: Thu, 17 Dec 2009 11:05:01 -0500 Subject: [postgis-users] Getting the exact extent of a geometry In-Reply-To: <4B2A0644.7020206@siriusit.co.uk> References: <87A96661E65C5541AB4D20721C2DD7F84D014C872A@EXCH-MBX-A.ulaval.ca> <4B2A0644.7020206@siriusit.co.uk> Message-ID: <87A96661E65C5541AB4D20721C2DD7F84D014C87DE@EXCH-MBX-A.ulaval.ca> Why not? This is what ST_Box2D() does and ST_Envelope() returns exactly the same values... But again: Is there a non aggregate function which returns the exact extent (float8s) of a geometry? If not, why not? Pierre >-----Original Message----- >From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users- >bounces at postgis.refractions.net] On Behalf Of Mark Cave-Ayland >Sent: 17 d?cembre 2009 05:22 >To: PostGIS Users Discussion >Subject: Re: [postgis-users] Getting the exact extent of a geometry > >Pierre Racine wrote: > >> Hi, >> >> ST_Envelope(geometry) returns a kind of degenerated version (float4s instead of float8s) of the >extent of a geometry based on the cached BOX2D and ST_Extent(geometry) is an aggregate. >> >> Is there a non aggregate function which returns the exact extent (float8s) of a geometry? >> >> Try: >> >> SELECT ST_AsText(ST_Envelope('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) >> UNION ALL >> SELECT ST_AsText(ST_Box2D('LINESTRING(0 0, 1.00000000000001 1)'::geometry)) >> UNION ALL >> SELECT ST_AsText(ST_Extent('LINESTRING(0 0, 1.00000000000001 1)'::geometry)); >> >> Thanks, >> >> Pierre > >Uggg. Nothing should *ever* return the contents of a BOX2DFLOAT4 back to >the user. If ST_Envelope() does, then this is definitely a bug. > > >ATB, > >Mark. > >-- >Mark Cave-Ayland - Senior Technical Architect >PostgreSQL - PostGIS >Sirius Corporation plc - control through freedom >http://www.siriusit.co.uk >t: +44 870 608 0063 > >Sirius Labs: http://www.siriusit.co.uk/labs >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users From fsalas at geocuba.cu Thu Dec 17 08:55:58 2009 From: fsalas at geocuba.cu (fsalas) Date: Thu, 17 Dec 2009 10:55:58 -0600 Subject: [postgis-users] how obtain the interior parcels References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com><314332.74742.qm@web33202.mail.mud.yahoo.com> Message-ID: <00a201ca7f3f$e9e3fb60$3998a8c0@deltha> Hi, Fred I tested your solution but as you can see en the picture , only select a few interior parcels , My question is Why Do not select the other interior parcels? Thanks Salas MSc Francisco D. Salas Rosette Director Agencia I+D Aplicado a la Geom?tica ----- Original Message ----- From: Fred Lehodey To: PostGIS Users Discussion Sent: Friday, December 11, 2009 9:58 AM Subject: Re: [postgis-users] how obtain the interior parcels Hi Salas, not sure this is the better way, but.. ;-) ... (you need POLYGONs, use ST_Dump() if MULTIPOLYGONs) you can try something like this: SELECT ST_InteriorRingN((the_geom),s) FROM your_parcels , generate_series(1,(SELECT max(ST_NumInteriorRing(the_geom)) FROM your_parcels)) s WHERE ST_NumInteriorRing(the_geom) > 0 AND ST_InteriorRingN(the_geom,s) IS NOT NULL Fred... On Thu, Dec 10, 2009 at 8:13 PM, Fsalas wrote: Thanks , Fred. Yes, I need the list of island polygons i use the ST_NumInteriorRings(), ... but only obtain the number , and i need obtain the list of feature island. How resolve this? regards , salas -----Original Message----- From: Fred Lehodey To: PostGIS Users Discussion Date: Thu, 10 Dec 2009 19:48:17 +0000 Subject: Re: [postgis-users] how obtain the interior parcels Hi Salas, are "interior parcels" islands ? ST_NumInteriorRings(geometry) Return the number of interior rings of the first polygon in the geometry. Return NULL if there is no polygon in the geometry. ST_NumInteriorRing(geometry) Synonym to NumInteriorRings(geometry). The OpenGIS specs are ambiguous about the exact function naming, so we provide both spellings. ST_InteriorRingN(geometry,integer) Return the N'th interior ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. Fred. On Thu, Dec 10, 2009 at 7:35 PM, Fsalas wrote: Hi, I have a table parcels , and I need obtain the list of the only interior parcels, the parcels is not overlap. I test ST_Contains(), ST_Intersects() but the result is not correct. Salas. _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ------------------------------------------------------------------------------ _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fotosalas.jpg Type: image/jpeg Size: 2024 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interiores nivel3.jpg Type: image/jpeg Size: 193506 bytes Desc: not available URL: From havard.tveite at umb.no Thu Dec 17 09:15:45 2009 From: havard.tveite at umb.no (Havard Tveite) Date: Thu, 17 Dec 2009 18:15:45 +0100 Subject: [postgis-users] how obtain the interior parcels In-Reply-To: <00a201ca7f3f$e9e3fb60$3998a8c0@deltha> References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com><314332.74742.qm@web33202.mail.mud.yahoo.com> <00a201ca7f3f$e9e3fb60$3998a8c0@deltha> Message-ID: <4B2A6741.7080802@umb.no> Dear Salas, What is your definition of interior? From the picture, it looks as if all your interior parcels are selected (shown in purple). Could you point out any interior parcels that are not selected? H?vard fsalas wrote: > Hi, Fred > > I tested your solution but as you can see en the picture , only select a > few interior parcels , My question is > Why Do not select the other interior parcels? > > Thanks > > Salas > > > MSc Francisco D. Salas Rosette > Director Agencia I+D Aplicado a la Geom?tica > > ----- Original Message ----- > *From:* Fred Lehodey > *To:* PostGIS Users Discussion > > *Sent:* Friday, December 11, 2009 9:58 AM > *Subject:* Re: [postgis-users] how obtain the interior parcels > > Hi Salas, > not sure this is the better way, but.. ;-) > ... (you need POLYGONs, use ST_Dump() if MULTIPOLYGONs) > > you can try something like this: > > SELECT ST_InteriorRingN((the_geom),s) > FROM your_parcels , generate_series(1,(SELECT > max(ST_NumInteriorRing(the_geom)) FROM your_parcels)) s > WHERE ST_NumInteriorRing(the_geom) > 0 > AND ST_InteriorRingN(the_geom,s) IS NOT NULL > > > Fred... > > > > On Thu, Dec 10, 2009 at 8:13 PM, Fsalas > wrote: > > Thanks , Fred. > > Yes, I need the list of island polygons i use the > ST_NumInteriorRings(), ... but only obtain the number , and i > need obtain the list of feature island. > > How resolve this? > > regards , salas > > > > -----Original Message----- > From: Fred Lehodey > > To: PostGIS Users Discussion > > > Date: Thu, 10 Dec 2009 19:48:17 +0000 > Subject: Re: [postgis-users] how obtain the interior parcels > > Hi Salas, > are "interior parcels" islands ? > > ST_NumInteriorRings(geometry) > Return the number of interior rings of the first polygon > in the geometry. Return NULL if there is no polygon in > the geometry. > ST_NumInteriorRing(geometry) > Synonym to NumInteriorRings(geometry). The OpenGIS specs > are ambiguous about the exact function naming, so we > provide both spellings. > ST_InteriorRingN(geometry,integer) > Return the N'th interior ring of the polygon geometry. > Return NULL if the geometry is not a polygon or the > given N is out of range. > > Fred. > > > On Thu, Dec 10, 2009 at 7:35 PM, Fsalas > wrote: > > Hi, > I have a table parcels , and I need obtain the list of > the only interior parcels, the parcels is not overlap. > I test ST_Contains(), ST_Intersects() but the result is > not correct. > > Salas. > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > ------------------------------------------------------------------------ > -- H?vard Tveite Department of Mathematical Sciences and Technology, UMB Dr?bakveien 31, POBox 5003, N-1432 ?s, NORWAY Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/ From fsalas at geocuba.cu Thu Dec 17 11:37:26 2009 From: fsalas at geocuba.cu (fsalas) Date: Thu, 17 Dec 2009 13:37:26 -0600 Subject: [postgis-users] how obtain the interior parcels References: <2119adb60912100123p5df98f0fj3d1e281de2554678@mail.gmail.com><314332.74742.qm@web33202.mail.mud.yahoo.com> <00a201ca7f3f$e9e3fb60$3998a8c0@deltha> <4B2A6741.7080802@umb.no> Message-ID: <011301ca7f50$938b1f80$3998a8c0@deltha> Dear, Havard My definition of the interior is , the parcels that be inside other parcels without overlap. I have been revised the information and the result is fine. In this moment I need add other condition, that of this selection maintain the parcels that don't touch other interior parcels. Is this possible? This is the Fred solutions: SELECT ST_InteriorRingN((the_geom),s) FROM datnivel3, generate_series(1,(SELECT max(ST_NumInteriorRing(the_geom)) FROM datnivel3)) s WHERE ST_NumInteriorRing(the_geom) > 0 AND ST_InteriorRingN(the_geom,s) IS NOT NULL How implement the other conditions? Thanks , Francisco Salas ----- Original Message ----- From: "Havard Tveite" To: "fsalas" ; "PostGIS Users Discussion" Sent: Thursday, December 17, 2009 11:15 AM Subject: Re: [postgis-users] how obtain the interior parcels > Dear Salas, > > What is your definition of interior? > From the picture, it looks as if all your interior parcels > are selected (shown in purple). Could you point out any > interior parcels that are not selected? > > H?vard > > fsalas wrote: >> Hi, Fred >> I tested your solution but as you can see en the picture , only select a >> few interior parcels , My question is >> Why Do not select the other interior parcels? >> Thanks >> Salas MSc Francisco D. Salas Rosette >> Director Agencia I+D Aplicado a la Geom?tica >> >> ----- Original Message ----- >> *From:* Fred Lehodey >> *To:* PostGIS Users Discussion >> >> *Sent:* Friday, December 11, 2009 9:58 AM >> *Subject:* Re: [postgis-users] how obtain the interior parcels >> >> Hi Salas, >> not sure this is the better way, but.. ;-) >> ... (you need POLYGONs, use ST_Dump() if MULTIPOLYGONs) >> >> you can try something like this: >> >> SELECT ST_InteriorRingN((the_geom),s) >> FROM your_parcels , generate_series(1,(SELECT >> max(ST_NumInteriorRing(the_geom)) FROM your_parcels)) s >> WHERE ST_NumInteriorRing(the_geom) > 0 >> AND ST_InteriorRingN(the_geom,s) IS NOT NULL >> >> >> Fred... >> >> >> >> On Thu, Dec 10, 2009 at 8:13 PM, Fsalas > > wrote: >> >> Thanks , Fred. >> Yes, I need the list of island polygons i use the >> ST_NumInteriorRings(), ... but only obtain the number , and i >> need obtain the list of feature island. >> How resolve this? >> regards , salas >> >> -----Original Message----- >> From: Fred Lehodey > > >> To: PostGIS Users Discussion >> > > >> Date: Thu, 10 Dec 2009 19:48:17 +0000 >> Subject: Re: [postgis-users] how obtain the interior parcels >> >> Hi Salas, >> are "interior parcels" islands ? >> >> ST_NumInteriorRings(geometry) >> Return the number of interior rings of the first polygon >> in the geometry. Return NULL if there is no polygon in >> the geometry. >> ST_NumInteriorRing(geometry) >> Synonym to NumInteriorRings(geometry). The OpenGIS specs >> are ambiguous about the exact function naming, so we >> provide both spellings. >> ST_InteriorRingN(geometry,integer) >> Return the N'th interior ring of the polygon geometry. >> Return NULL if the geometry is not a polygon or the >> given N is out of range. >> >> Fred. >> >> >> On Thu, Dec 10, 2009 at 7:35 PM, Fsalas > > wrote: >> >> Hi, >> I have a table parcels , and I need obtain the list of >> the only interior parcels, the parcels is not overlap. >> I test ST_Contains(), ST_Intersects() but the result is >> not correct. >> Salas. >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> >> >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> ------------------------------------------------------------------------ >> > > -- > H?vard Tveite > Department of Mathematical Sciences and Technology, UMB > Dr?bakveien 31, POBox 5003, N-1432 ?s, NORWAY > Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/ > From kneufeld at refractions.net Thu Dec 17 13:35:39 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Thu, 17 Dec 2009 13:35:39 -0800 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: <4B2A51B7.30707@vti.bund.de> References: <4B2A4DEF.7070401@vti.bund.de> <4B2A51B7.30707@vti.bund.de> Message-ID: <4B2AA42B.5070401@refractions.net> http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING Try: FOR target IN EXECUTE text_expression LOOP ... END LOOP; I usually do something like this: DECLARE ... schemaname text := 'myschema'; tablename text := 'mytable'; sql text; r record; BEGIN; sql := 'SELECT ... FROM ' || quote_ident(schemaname) || '.' || quote_ident(tablename); RAISE DEBUG '%s', sql; FOR r IN EXECUTE sql LOOP ... END LOOP END; -- Kevin Birgit Laggner wrote: > Yes, I have noticed that, but I don't know how to do that, especially at > defining my n (loop end point variable). I tried various versions (also > with execute), but without success. > > Birgit. > > On 17.12.2009 16:38, David William Bitner wrote: >> Birgit, >> >> The problem may be that you are creating a varchar variable for your >> schema name and then you are trying to use it in an instance that is >> expecting a database object. Anytime you are trying to insert >> variables as database objects, you need to construct your query as a >> string and use execute similar as to how you are creating your insert >> statement. >> >> David >> >> On Thu, Dec 17, 2009 at 9:27 AM, Birgit Laggner >> > wrote: >> >> Dear list, >> >> I am trying to generalize a pl/pgsql function I have written (see >> below). I would like to define schema and table names, as well as >> certain column names, in the function call (as in the PostGIS function >> AddGeometryColumn) in order to use them to define schema and table >> names >> and everything else within the function queries. >> >> My problem is, that postgres doesn't recognize the defined variable >> names if I call them in a FROM clause or INSERT INTO. This is the >> error >> message: >> >> ERROR: Schema ?schemaname? does not exist >> LINE 1: SELECT count( $1 ) from schemaname.table_a >> ^ >> QUERY: SELECT count( $1 ) from schemaname.table_a >> CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at >> assignment >> >> I can't imagine that it should be impossible to use variable >> schema and >> table names in a plpgsql function. So, if anybody has suggestions, I >> would be quite happy. >> >> Thanks and regards, >> >> Birgit. >> >> My PostGIS version: 1.4.0-10.1 >> My PostgreSQL version: 8.4.1-2.1 >> >> My pl/pgsql function: >> >> CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname >> varchar(20), table_a varchar(50), a_id varchar(20), table_b >> varchar(50), >> b_id varchar(20), intersection varchar(60)) RETURNS void AS >> $BODY$ >> >> DECLARE >> counter integer; >> recordset_object RECORD; >> i integer; >> n integer; >> >> BEGIN >> >> counter := 0; >> n := count(a_id) from schemaname.table_a; >> >> --1. Intersection: >> >> FOR i in 1..n LOOP >> >> RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; >> >> FOR recordset_object IN >> >> SELECT >> a.a_id , >> b.b_id, >> ST_intersection(a.the_geom, b.the_geom) AS the_geom >> FROM schemaname.table_a a, schemaname.table_b b >> WHERE a.a_id=i and >> st_intersects(a.the_geom, b.the_geom) and >> a.the_geom && b.the_geom >> >> LOOP >> >> execute >> 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', >> ''||b_id||'', the_geom) '|| >> 'VALUES ( '|| >> ''||recordset_object||'.''||a_id||'', '|| >> ''||recordset_object||'.''||b_id||'', '|| >> ''||recordset_object||'.the_geom);'; >> /* >> alternatively: >> INSERT INTO schemaname.intersection (a_id, b_id, the_geom) >> VALUES ( >> recordset_object.a_id, >> recordset_object.b_id, >> recordset_object.the_geom); >> */ >> counter := counter + 1; >> >> RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; >> >> END LOOP; >> >> counter := 0; >> >> END LOOP; >> >> END; >> $BODY$ >> LANGUAGE 'plpgsql' VOLATILE; >> ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), >> table_a >> varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), >> intersection varchar(60)) OWNER TO postgres; >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> >> >> -- >> ************************************ >> David William Bitner >> >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From monty at english.net Thu Dec 17 13:40:37 2009 From: monty at english.net (Bryan Montgomery) Date: Thu, 17 Dec 2009 16:40:37 -0500 Subject: [postgis-users] Problem trying to import data from wetlands.fws.gov Message-ID: Hi, We've bene trying to import shape files from the website here. (RI is relatively small). I can display the shape files on udig, but have not been able to use shp2pgsql to import them an make sense of it. I tried running INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 924, 'sr-org', 24, '', 'PROJCS["NAD_1983_Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers"],PARAMETER["False_Easting",00000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]'); and use that as the srid of the imported data. Trying to st_transofrm that to 4326 or 32015 on windows with postgresql 8.4.1 crashed the server. We've also run it on 8.2 on linux - which doesn't die. However, the results are essentially garbage. I assume there is something (probably simple) that we are missing. Can someon point us in the right direction to get this converted? >From what I can tell, udig sees thespatial reference as posted below. I used a link from http://spatialreference.org/ref/sr-org/24/postgis/ as the basis for creating the srid above. PROJCS["NAD_1983_Albers", GEOGCS["GCS_North_American_1983", DATUM["D_North_American_1983", SPHEROID["GRS_1980", 6378137.0, 298.257222101]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH]], PROJECTION["Albers_Conic_Equal_Area"], PARAMETER["central_meridian", -96.0], PARAMETER["latitude_of_origin", 23.0], PARAMETER["standard_parallel_1", 29.5], PARAMETER["false_easting", 0.0], PARAMETER["false_northing", 0.0], PARAMETER["standard_parallel_2", 45.5], UNIT["m", 1.0], AXIS["x", EAST], AXIS["y", NORTH]] Thanks, Bryan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Thu Dec 17 13:41:15 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Thu, 17 Dec 2009 13:41:15 -0800 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: <4B2AA42B.5070401@refractions.net> References: <4B2A4DEF.7070401@vti.bund.de> <4B2A51B7.30707@vti.bund.de> <4B2AA42B.5070401@refractions.net> Message-ID: <4B2AA57B.1020807@refractions.net> Small typo ... it's not RAISE DEBUG '%s', sql; but RAISE DEBUG '%', sql; Kevin Neufeld wrote: > http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING > > > Try: > > FOR target IN EXECUTE text_expression LOOP > ... > END LOOP; > > > > I usually do something like this: > > DECLARE > ... > schemaname text := 'myschema'; > tablename text := 'mytable'; > sql text; > r record; > > BEGIN; > sql := 'SELECT ... FROM ' || quote_ident(schemaname) || '.' || > quote_ident(tablename); > RAISE DEBUG '%s', sql; > > FOR r IN EXECUTE sql LOOP > ... > END LOOP > END; > > -- Kevin > > Birgit Laggner wrote: >> Yes, I have noticed that, but I don't know how to do that, especially >> at defining my n (loop end point variable). I tried various versions >> (also with execute), but without success. >> >> Birgit. >> >> On 17.12.2009 16:38, David William Bitner wrote: >>> Birgit, >>> >>> The problem may be that you are creating a varchar variable for your >>> schema name and then you are trying to use it in an instance that is >>> expecting a database object. Anytime you are trying to insert >>> variables as database objects, you need to construct your query as a >>> string and use execute similar as to how you are creating your insert >>> statement. >>> >>> David >>> >>> On Thu, Dec 17, 2009 at 9:27 AM, Birgit Laggner >>> > wrote: >>> >>> Dear list, >>> >>> I am trying to generalize a pl/pgsql function I have written (see >>> below). I would like to define schema and table names, as well as >>> certain column names, in the function call (as in the PostGIS >>> function >>> AddGeometryColumn) in order to use them to define schema and table >>> names >>> and everything else within the function queries. >>> >>> My problem is, that postgres doesn't recognize the defined variable >>> names if I call them in a FROM clause or INSERT INTO. This is the >>> error >>> message: >>> >>> ERROR: Schema ?schemaname? does not exist >>> LINE 1: SELECT count( $1 ) from schemaname.table_a >>> ^ >>> QUERY: SELECT count( $1 ) from schemaname.table_a >>> CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at >>> assignment >>> >>> I can't imagine that it should be impossible to use variable >>> schema and >>> table names in a plpgsql function. So, if anybody has suggestions, I >>> would be quite happy. >>> >>> Thanks and regards, >>> >>> Birgit. >>> >>> My PostGIS version: 1.4.0-10.1 >>> My PostgreSQL version: 8.4.1-2.1 >>> >>> My pl/pgsql function: >>> >>> CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname >>> varchar(20), table_a varchar(50), a_id varchar(20), table_b >>> varchar(50), >>> b_id varchar(20), intersection varchar(60)) RETURNS void AS >>> $BODY$ >>> >>> DECLARE >>> counter integer; >>> recordset_object RECORD; >>> i integer; >>> n integer; >>> >>> BEGIN >>> >>> counter := 0; >>> n := count(a_id) from schemaname.table_a; >>> >>> --1. Intersection: >>> >>> FOR i in 1..n LOOP >>> >>> RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; >>> >>> FOR recordset_object IN >>> >>> SELECT >>> a.a_id , >>> b.b_id, >>> ST_intersection(a.the_geom, b.the_geom) AS the_geom >>> FROM schemaname.table_a a, schemaname.table_b b >>> WHERE a.a_id=i and >>> st_intersects(a.the_geom, b.the_geom) and >>> a.the_geom && b.the_geom >>> >>> LOOP >>> >>> execute >>> 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', >>> ''||b_id||'', the_geom) '|| >>> 'VALUES ( '|| >>> ''||recordset_object||'.''||a_id||'', '|| >>> ''||recordset_object||'.''||b_id||'', '|| >>> ''||recordset_object||'.the_geom);'; >>> /* >>> alternatively: >>> INSERT INTO schemaname.intersection (a_id, b_id, the_geom) >>> VALUES ( >>> recordset_object.a_id, >>> recordset_object.b_id, >>> recordset_object.the_geom); >>> */ >>> counter := counter + 1; >>> >>> RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; >>> >>> END LOOP; >>> >>> counter := 0; >>> >>> END LOOP; >>> >>> END; >>> $BODY$ >>> LANGUAGE 'plpgsql' VOLATILE; >>> ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), >>> table_a >>> varchar(50), a_id varchar(20), table_b varchar(50), b_id >>> varchar(20), >>> intersection varchar(60)) OWNER TO postgres; >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at postgis.refractions.net >>> >>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>> >>> >>> >>> >>> -- >>> ************************************ >>> David William Bitner >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at postgis.refractions.net >>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From anthony.mcclure at universalmind.com Fri Dec 18 09:52:48 2009 From: anthony.mcclure at universalmind.com (Anthony McClure) Date: Fri, 18 Dec 2009 11:52:48 -0600 Subject: [postgis-users] Reverse X and Y coordinates? Message-ID: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> Good day, I have a problem that I cannot find a solution to. I have the X and Y coordinates reversed in the geometries within my database. I need the X's to become Y's and the Y's to become X's. The geometries are all polygons or multi-polygons. Is there anything within PostGIS I can execute SQL wise to do this? The only other thing I can think of is to write code to go through all of the points and reverse them manually which obviously I am hoping to avoid. Thanks for the help, Anthony This email, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this email, you are hereby notified that any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately and permanently delete the original and any copy of any email and any printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pramsey at opengeo.org Fri Dec 18 09:57:03 2009 From: pramsey at opengeo.org (Paul Ramsey) Date: Fri, 18 Dec 2009 09:57:03 -0800 Subject: [postgis-users] Reverse X and Y coordinates? In-Reply-To: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> References: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> Message-ID: <30fe546d0912180957v21fece6etd76ba64dc23d5124@mail.gmail.com> Not currently available, but a worthy feature! I'll ticket it. http://trac.osgeo.org/postgis/ticket/354 BTW, how did you end up with polygons with reversed coordinates? P. On Fri, Dec 18, 2009 at 9:52 AM, Anthony McClure wrote: > Good day, > > I have a problem that I cannot find a solution to.? I have the X and Y > coordinates reversed in the geometries within my database.? I need the X's > to become Y's and the Y's to become X's.? The geometries are all polygons or > multi-polygons.? Is there anything within PostGIS I can execute SQL wise to > do this? > > The only other thing I can think of is to write code to go through all of > the points and reverse them manually which obviously I am hoping to avoid. > > Thanks for the help, > Anthony > > This email, and any attachments thereto, is intended > only for use by the addressee(s) named herein and may > contain legally privileged and/or confidential information. > If you are not the intended recipient of this email, you > are hereby notified that any dissemination, distribution > or copying of this email, and any attachments thereto, > is strictly prohibited. If you have received this e-mail in > error, please immediately and permanently delete the > original and any copy of any email and any printout > thereof. > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > From olivier.courtin at oslandia.com Fri Dec 18 10:15:50 2009 From: olivier.courtin at oslandia.com (Olivier Courtin) Date: Fri, 18 Dec 2009 19:15:50 +0100 Subject: [postgis-users] Reverse X and Y coordinates? In-Reply-To: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> References: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> Message-ID: <03A4640C-F6D5-4B53-85B5-4EE006CED251@oslandia.com> On Dec 18, 2009, at 6:52 PM, Anthony McClure wrote: Hi, > I have a problem that I cannot find a solution to. I have the X and > Y coordinates reversed in > the geometries within my database. I need the X's to become Y's and > the Y's to become X's. > The geometries are all polygons or multi-polygons. Is there > anything within PostGIS I can > execute SQL wise to do this? That's a pure hack (never been designed for this) But if you have SVN PostGIS (with libxml2) : SELECT st_astext(st_geomfromgml(st_asgml(3, st_astext('POINT(1 0)'), 8, 16))); Will output: POINT(0 1) -- Olivief From cnieman at dmsolutions.ca Fri Dec 18 11:10:20 2009 From: cnieman at dmsolutions.ca (Christy Nieman) Date: Fri, 18 Dec 2009 14:10:20 -0500 Subject: [postgis-users] ST_Difference lots of lines with lots of polygons Message-ID: <4B2BD39C.5050802@dmsolutions.ca> Hello, I have been having difficulty figuring out how I might go about doing a difference of many lines and polygons. For context, I have many (> 3,000,000) contour lines that I want to difference based on many (> 180,000) lakes. My goal is to remove the sections of the lines that are within the polygons. I know that I can use ST_Difference(aLine, aPolygon) to do this for one feature, but, what would the syntax look like to go though all my line and all my polygons and return just the lines/parts of lines that are outside of the polygons (and do this in as quickly and resource-friendly way as possible)? The machine I am working on is a relatively well-powered desktop (quad core, 6GB RAM). Thanks for any insight/suggestions, Christy -- Christy Nieman GIS Technician DM Solutions Group, Inc. Email: cnieman at dmsolutions.ca Web: http://dmsolutions.ca Web: http://research.dmsolutions.ca From kneufeld at refractions.net Fri Dec 18 19:02:53 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Fri, 18 Dec 2009 19:02:53 -0800 Subject: [postgis-users] Reverse X and Y coordinates? In-Reply-To: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> References: <18bca3040912180952i3ea2c255r8b8820f00e8917d0@mail.gmail.com> Message-ID: <4B2C425D.20506@refractions.net> What about rotating about the line y=x? SELECT ST_AsText(ST_Affine( column1, cos(pi()/2), sin(pi()/2), sin(pi()/2), cos(pi()/2), 0, 0 )) FROM (VALUES ('POINT(4 3)'), ('LINESTRING(1 2, 59 34, -9 3)'), ('POLYGON (( 2 13, 6 12, 4 8, 2 7, 2 13 ), ( 4 12, 3 10, 3 9, 4 10, 4 12 ))') ) a; st_astext ------------------------------------------------------------- POINT(3 4) LINESTRING(2 1,34 59,3 -9) POLYGON((13 2,12 6,8 4,7 2,13 2),(12 4,10 3,9 3,10 4,12 4)) (3 rows) -- Kevin Anthony McClure wrote: > Good day, > > I have a problem that I cannot find a solution to. I have the X and Y > coordinates reversed in the geometries within my database. I need the > X's to become Y's and the Y's to become X's. The geometries are all > polygons or multi-polygons. Is there anything within PostGIS I can > execute SQL wise to do this? > > The only other thing I can think of is to write code to go through all > of the points and reverse them manually which obviously I am hoping to > avoid. > > Thanks for the help, > Anthony > This email, and any attachments thereto, is intended > only for use by the addressee(s) named herein and may > contain legally privileged and/or confidential information. > If you are not the intended recipient of this email, you > are hereby notified that any dissemination, distribution > or copying of this email, and any attachments thereto, > is strictly prohibited. If you have received this e-mail in > error, please immediately and permanently delete the > original and any copy of any email and any printout > thereof. > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Fri Dec 18 20:52:52 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Fri, 18 Dec 2009 20:52:52 -0800 Subject: [postgis-users] ST_Difference lots of lines with lots of polygons In-Reply-To: <4B2BD39C.5050802@dmsolutions.ca> References: <4B2BD39C.5050802@dmsolutions.ca> Message-ID: <4B2C5C24.5060007@refractions.net> Hmm. Another use case for having topology in PostGIS ... if only :) Well, I think my approach would be to iterate through your polygons and do as you suggest, use ST_Difference, but use a collection of all the lines that overlap the polygon and the polygon as parameters. 1. First identity all the lines that potentially overlap a polygon CREATE TABLE overlapping_contours AS SELECT a.id AS poly_id, b.id AS cont_id, b.geom FROM poly a, contours b WHERE a.geom && b.geom; 2. Remove all original contour lines so you don't get duplicates later DELETE FROM contours WHERE id IN (SELECT cont_id FROM overlapping_contours); 3. Create multilinestring of the contours around every polygon (to be used as input into ST_Difference) CREATE TABLE grouped_contours AS SELECT poly_id, ST_Collect(geom) AS geom FROM overlapping_contours GROUP BY poly_id 4. Subtract the polys from the multilinestrings UPDATE grouped_contours a SET geom = ST_Difference(a.geom, b.geom) FROM polys b WHERE a.poly_id = b.id; 5. Expand and insert the mlines back into the contours table INSERT INTO contours (geom) SELECT (ST_Dump(geom)).geom FROM grouped_contours; None of this code is tested, and obviously you'll need to add indexes to your intermediate tables, but it might be a start. Note that PostgreSQL does not use more than one CPU at a time per query. I could see this taking quite a long time. To speed things up, you might try partitioning your polygons into 4 logical groups and run things concurrently. IE, in step one, add the filter AND a.id < 50000. Then, at the same time, run another query using AND a.id >=50000 AND a.id < 100000. Just a thought. Cheers, Kevin Christy Nieman wrote: > Hello, > > I have been having difficulty figuring out how I might go about doing > a difference of many lines and polygons. For context, I have many (> > 3,000,000) contour lines that I want to difference based on many (> > 180,000) lakes. My goal is to remove the sections of the lines that > are within the polygons. I know that I can use ST_Difference(aLine, > aPolygon) to do this for one feature, but, what would the syntax look > like to go though all my line and all my polygons and return just the > lines/parts of lines that are outside of the polygons (and do this in > as quickly and resource-friendly way as possible)? The machine I am > working on is a relatively well-powered desktop (quad core, 6GB RAM). > > Thanks for any insight/suggestions, > > Christy From cnieman at dmsolutions.ca Sat Dec 19 07:32:11 2009 From: cnieman at dmsolutions.ca (Christy Nieman) Date: Sat, 19 Dec 2009 10:32:11 -0500 Subject: [postgis-users] ST_Difference lots of lines with lots of polygons In-Reply-To: <4B2C5C24.5060007@refractions.net> References: <4B2BD39C.5050802@dmsolutions.ca> <4B2C5C24.5060007@refractions.net> Message-ID: <4B2CF1FB.9000306@dmsolutions.ca> Kevin, Thanks for responding. I'll give it a shot Monday morning when I'm back at work, and will report back on how it goes. Christy On 12/18/2009 11:52 PM, Kevin Neufeld wrote: > Hmm. Another use case for having topology in PostGIS ... if only :) > > Well, I think my approach would be to iterate through your polygons > and do as you suggest, use ST_Difference, but use a collection of all > the lines that overlap the polygon and the polygon as parameters. > > 1. First identity all the lines that potentially overlap a polygon > CREATE TABLE overlapping_contours AS > SELECT a.id AS poly_id, b.id AS cont_id, b.geom > FROM poly a, contours b > WHERE a.geom && b.geom; > > 2. Remove all original contour lines so you don't get duplicates later > DELETE FROM contours WHERE id IN (SELECT cont_id FROM > overlapping_contours); > > 3. Create multilinestring of the contours around every polygon (to be > used as input into ST_Difference) > CREATE TABLE grouped_contours AS > SELECT poly_id, ST_Collect(geom) AS geom > FROM overlapping_contours > GROUP BY poly_id > > 4. Subtract the polys from the multilinestrings > UPDATE grouped_contours a > SET geom = ST_Difference(a.geom, b.geom) > FROM polys b > WHERE a.poly_id = b.id; > > 5. Expand and insert the mlines back into the contours table > INSERT INTO contours (geom) > SELECT (ST_Dump(geom)).geom > FROM grouped_contours; > > None of this code is tested, and obviously you'll need to add indexes > to your intermediate tables, but it might be a start. Note that > PostgreSQL does not use more than one CPU at a time per query. I > could see this taking quite a long time. To speed things up, you > might try partitioning your polygons into 4 logical groups and run > things concurrently. IE, in step one, add the filter AND a.id < > 50000. Then, at the same time, run another query using AND a.id > >=50000 AND a.id < 100000. Just a thought. > > Cheers, > Kevin > > Christy Nieman wrote: >> Hello, >> >> I have been having difficulty figuring out how I might go about doing >> a difference of many lines and polygons. For context, I have many (> >> 3,000,000) contour lines that I want to difference based on many (> >> 180,000) lakes. My goal is to remove the sections of the lines that >> are within the polygons. I know that I can use ST_Difference(aLine, >> aPolygon) to do this for one feature, but, what would the syntax look >> like to go though all my line and all my polygons and return just the >> lines/parts of lines that are outside of the polygons (and do this in >> as quickly and resource-friendly way as possible)? The machine I am >> working on is a relatively well-powered desktop (quad core, 6GB RAM). >> >> Thanks for any insight/suggestions, >> >> Christy > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Sat Dec 19 10:02:47 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Sat, 19 Dec 2009 10:02:47 -0800 Subject: [postgis-users] Problem trying to import data from wetlands.fws.gov In-Reply-To: References: Message-ID: <4B2D1547.4020709@refractions.net> It looks like your insert statement is missing the proj4 text string. PostGIS doesn't use the spatialreference wkt at all, rather, it delegates it's transformations to proj4. Bryan Montgomery wrote: > Hi, > We've bene trying to import shape files from the website here. (RI is > relatively small). I can display the shape files on udig, but have not > been able to use shp2pgsql to import them an make sense of it. > > I tried running INSERT into spatial_ref_sys (srid, auth_name, > auth_srid, proj4text, srtext) > values ( 924, 'sr-org', 24, '', > 'PROJCS["NAD_1983_Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers"],PARAMETER["False_Easting",00000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]'); > and use that as the srid of the imported data. Trying to st_transofrm > that to 4326 or 32015 on windows with postgresql 8.4.1 crashed the > server. We've also run it on 8.2 on linux - which doesn't die. > > However, the results are essentially garbage. I assume there is > something (probably simple) that we are missing. Can someon point us > in the right direction to get this converted? > > From what I can tell, udig sees thespatial reference as posted below. > I used a link from > http://spatialreference.org/ref/sr-org/24/postgis/ as the basis for > creating the srid above. > PROJCS["NAD_1983_Albers", > GEOGCS["GCS_North_American_1983", > DATUM["D_North_American_1983", > SPHEROID["GRS_1980", 6378137.0, 298.257222101]], > PRIMEM["Greenwich", 0.0], > UNIT["degree", 0.017453292519943295], > AXIS["Lon", EAST], > AXIS["Lat", NORTH]], > PROJECTION["Albers_Conic_Equal_Area"], > PARAMETER["central_meridian", -96.0], > PARAMETER["latitude_of_origin", 23.0], > PARAMETER["standard_parallel_1", 29.5], > PARAMETER["false_easting", 0.0], > PARAMETER["false_northing", 0.0], > PARAMETER["standard_parallel_2", 45.5], > UNIT["m", 1.0], > AXIS["x", EAST], > AXIS["y", NORTH]] > Thanks, > Bryan. > > > ------------------------------------------------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From nicklas.aven at jordogskog.no Sun Dec 20 02:14:20 2009 From: nicklas.aven at jordogskog.no (Nicklas =?iso-8859-1?Q?Av=E9n?=) Date: Sun, 20 Dec 2009 11:14:20 +0100 Subject: [postgis-users] ST_Difference lots of lines with lots of polygons Message-ID: <200912201014.nBKAEKxD004600@mail-core.space2u.com> Another approach could be to cut the lines up with the linestrings from st_exteriorring of the polygons after using st_dump (if there is multipolygons) and st_dumprings (if there is "holes in the poygons)then use st_dump on the resulting cutted lines and after that delete all lines that is within polygons. /Nicklas 2009-12-19 Christy Nieman wrote: Kevin, > >Thanks for responding. I'll give it a shot Monday morning when I'm back >at work, and will report back on how it goes. > >Christy > >On 12/18/2009 11:52 PM, Kevin Neufeld wrote: >> Hmm. Another use case for having topology in PostGIS ... if only :) >> >> Well, I think my approach would be to iterate through your polygons >> and do as you suggest, use ST_Difference, but use a collection of all >> the lines that overlap the polygon and the polygon as parameters. >> >> 1. First identity all the lines that potentially overlap a polygon >> CREATE TABLE overlapping_contours AS >> SELECT a.id AS poly_id, b.id AS cont_id, b.geom >> FROM poly a, contours b >> WHERE a.geom && b.geom; >> >> 2. Remove all original contour lines so you don't get duplicates later >> DELETE FROM contours WHERE id IN (SELECT cont_id FROM >> overlapping_contours); >> >> 3. Create multilinestring of the contours around every polygon (to be >> used as input into ST_Difference) >> CREATE TABLE grouped_contours AS >> SELECT poly_id, ST_Collect(geom) AS geom >> FROM overlapping_contours >> GROUP BY poly_id >> >> 4. Subtract the polys from the multilinestrings >> UPDATE grouped_contours a >> SET geom = ST_Difference(a.geom, b.geom) >> FROM polys b >> WHERE a.poly_id = b.id; >> >> 5. Expand and insert the mlines back into the contours table >> INSERT INTO contours (geom) >> SELECT (ST_Dump(geom)).geom >> FROM grouped_contours; >> >> None of this code is tested, and obviously you'll need to add indexes >> to your intermediate tables, but it might be a start. Note that >> PostgreSQL does not use more than one CPU at a time per query. I >> could see this taking quite a long time. To speed things up, you >> might try partitioning your polygons into 4 logical groups and run >> things concurrently. IE, in step one, add the filter AND a.id < >> 50000. Then, at the same time, run another query using AND a.id >> >=50000 AND a.id < 100000. Just a thought. >> >> Cheers, >> Kevin >> >> Christy Nieman wrote: >>> Hello, >>> >>> I have been having difficulty figuring out how I might go about doing >>> a difference of many lines and polygons. For context, I have many (> >>> 3,000,000) contour lines that I want to difference based on many (> >>> 180,000) lakes. My goal is to remove the sections of the lines that >>> are within the polygons. I know that I can use ST_Difference(aLine, >>> aPolygon) to do this for one feature, but, what would the syntax look >>> like to go though all my line and all my polygons and return just the >>> lines/parts of lines that are outside of the polygons (and do this in >>> as quickly and resource-friendly way as possible)? The machine I am >>> working on is a relatively well-powered desktop (quad core, 6GB RAM). >>> >>> Thanks for any insight/suggestions, >>> >>> Christy >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >_______________________________________________ >postgis-users mailing list >postgis-users at postgis.refractions.net >http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From monty at english.net Mon Dec 21 09:25:15 2009 From: monty at english.net (Bryan Montgomery) Date: Mon, 21 Dec 2009 12:25:15 -0500 Subject: [postgis-users] Problem trying to import data from wetlands.fws.gov Message-ID: Thanks, yes that was my mistake in this case and was why postgresql was crashing (a slightly different id was used on the other version of postgresql). That said, I now used this sql: INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 96630, 'sr-org', 6630, '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ', 'PROJCS["NAD_1983_Albers",GEOGCS["NAD83", DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AUTHORITY["EPSG","4269"]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["standard_parallel_1",29.5],PARAMETER["standard_parallel_2",45.5],PARAMETER["latitude_of_center",23],PARAMETER["longitude_of_center",-96],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["meters",1]]'); (copied from http://code.google.com/p/bpgeo/source/browse/trunk/ubuntu_build/install_all.sh ). Initially I thought that it was still wrong, as it gave back some values I'm not used to working with (we typically only work in South East NY). However, after testing more thoroughly, it does seem to have resolved the issue. Thanks for pointing out my omission and making me double check the data :) Would it make any sense to include this reference in the spatial ref sys as a default - or is it just the Feds being difficult and obscure :) Bryan. ------------------------------ > > It looks like your insert statement is missing the proj4 text string. > PostGIS doesn't use the spatialreference wkt at all, rather, it > delegates it's transformations to proj4. > > Bryan Montgomery wrote: > > Hi, > > We've bene trying to import shape files from the website here. (RI is > > relatively small). I can display the shape files on udig, but have not > > been able to use shp2pgsql to import them an make sense of it. > > > > I tried running INSERT into spatial_ref_sys (srid, auth_name, > > auth_srid, proj4text, srtext) > > values ( 924, 'sr-org', 24, '', > > > 'PROJCS["NAD_1983_Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers"],PARAMETER["False_Easting",00000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]'); > > and use that as the srid of the imported data. Trying to st_transofrm > > that to 4326 or 32015 on windows with postgresql 8.4.1 crashed the > > server. We've also run it on 8.2 on linux - which doesn't die. > > > > However, the results are essentially garbage. I assume there is > > something (probably simple) that we are missing. Can someon point us > > in the right direction to get this converted? > > > > From what I can tell, udig sees thespatial reference as posted below. > > I used a link from > > http://spatialreference.org/ref/sr-org/24/postgis/ as the basis for > > creating the srid above. > > PROJCS["NAD_1983_Albers", > > GEOGCS["GCS_North_American_1983", > > DATUM["D_North_American_1983", > > SPHEROID["GRS_1980", 6378137.0, 298.257222101]], > > PRIMEM["Greenwich", 0.0], > > UNIT["degree", 0.017453292519943295], > > AXIS["Lon", EAST], > > AXIS["Lat", NORTH]], > > PROJECTION["Albers_Conic_Equal_Area"], > > PARAMETER["central_meridian", -96.0], > > PARAMETER["latitude_of_origin", 23.0], > > PARAMETER["standard_parallel_1", 29.5], > > PARAMETER["false_easting", 0.0], > > PARAMETER["false_northing", 0.0], > > PARAMETER["standard_parallel_2", 45.5], > > UNIT["m", 1.0], > > AXIS["x", EAST], > > AXIS["y", NORTH]] > > Thanks, > > Bryan. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > postgis-users mailing list > > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > > ------------------------------ > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > End of postgis-users Digest, Vol 90, Issue 6 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brianp at occinc.com Mon Dec 21 09:26:27 2009 From: brianp at occinc.com (Brian Peschel) Date: Mon, 21 Dec 2009 11:26:27 -0600 Subject: [postgis-users] Combining squares In-Reply-To: References: Message-ID: <4B2FAFC3.4040206@occinc.com> I have an unusual problem I was wondering if there is way for PostGIS to solve for me. I have squares. A lot of squares. Thousands of squares. I would love to combine them into one or more larger polygons. But, they must valid polygons, non-reentrant. For example. if you have a 3x3 grid of squares, ABC RST XYZ and I want to combine all but the center, I would need either 2 polygons (something like ABC and RXYZT), or one polygon with an inner ring. Does this make sense? Anyone done something like this, with or without PostGIS? - Brian From ml at 3.141592654.de Mon Dec 21 13:50:01 2009 From: ml at 3.141592654.de (Andreas) Date: Mon, 21 Dec 2009 22:50:01 +0100 (CET) Subject: [postgis-users] Combining squares In-Reply-To: <31497427.59.1261432102123.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <17097520.61.1261432201623.JavaMail.root@store1.zcs.ext.wpsrv.net> Hi Brian, > I have squares. A lot of squares. Thousands of squares. I would > love > to combine them into one or more larger polygons. But, they must > valid > polygons, non-reentrant. For example. if you have a 3x3 grid of > squares, > ABC > RST > XYZ > and I want to combine all but the center, I would need either 2 > polygons > (something like ABC and RXYZT), or one polygon with an inner ring. Assuming there is a table 'squares' containing a geometry type 'the_geom', this one produces a polygon having an inner ring: SELECT ST_Difference(ST_Union(the_geom), (SELECT the_geom FROM squares WHERE id='S')) FROM squares Best Regards, Andreas From paul.malm at saabgroup.com Tue Dec 22 00:15:20 2009 From: paul.malm at saabgroup.com (Malm Paul) Date: Tue, 22 Dec 2009 09:15:20 +0100 Subject: [postgis-users] maps as cchema??? In-Reply-To: <4AC0BC7A.60303@usgs.gov> References: <49383B4A.5090006@usgs.gov> <493D7343.50205@usgs.gov> <493EC04B.9050406@usgs.gov> <4ABDF635.5050806@comcast.net> <4ABE2A28.5000905@pobox.com> <4AC02540.2010002@usgs.gov> <4AC079A4.9060208@siriusit.co.uk> <4AC0BC7A.60303@usgs.gov> Message-ID: <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se> Hi list, Today I have several charts (could be in different scales, different source types etc.) as separate databases and I've imported them ito a viewer. When I'm picking an object to view the information I must first connect and go through all the databases seperately. Is there a way to store the charts so that it is possible to make one search around a pick point and get all found objects from all charts and all layers? I still want the charts to be oganized as separate units, perhaps as different schemas. Is this possible to achieve and what is the drawbacks? Kind regars, Paul From birgit.laggner at vti.bund.de Tue Dec 22 03:58:04 2009 From: birgit.laggner at vti.bund.de (Birgit Laggner) Date: Tue, 22 Dec 2009 12:58:04 +0100 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: <4B2AA57B.1020807@refractions.net> References: <4B2A4DEF.7070401@vti.bund.de> <4B2A51B7.30707@vti.bund.de> <4B2AA42B.5070401@refractions.net> <4B2AA57B.1020807@refractions.net> Message-ID: <4B30B44C.9030801@vti.bund.de> Hi Kevin, for the defining of n, your suggestions works perfectly well. But in the next step, I try to assign a record as an intersection of 2 tables. I tried to solve this with a nested loop. But the problem is, after assigning the records for table a and b, I can't address certain fields within the records anymore, which would be necessary for the intersection loop. By now, the part in question of my function looks like this (r_a, r_b are declared as record, sql_a, sql_b are declared as text): sql_a := 'select gid, '||a_id||' as '||a_id||', the_geom from '||quote_ident(schemaname)||'.'||quote_ident(table_a); raise debug '%', sql_a; raise notice '%', sql_a; sql_b := 'select gid, '||b_id||' as '||b_id||', the_geom from '||quote_ident(schemaname)||'.'||quote_ident(table_b); raise debug '%', sql_b; FOR r_a in execute sql_a LOOP FOR r_b in execute sql_b LOOP FOR recordset_object IN execute 'select '||quote_ident(r_a.a_id) ||', '||quote_ident(r_b.b_id) ||', ST_intersection('||quote_ident(r_a.the_geom)||', '||quote_ident(r_b.the_geom)||') AS the_geom WHERE st_intersects('||quote_ident(r_a.the_geom)||', '||quote_ident(r_b.the_geom)||') and '||quote_ident(r_a.the_geom)||' && '||quote_ident(r_b.the_geom) LOOP execute 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', ''||b_id||'', the_geom) '|| 'VALUES ( '|| ''||recordset_object||'.''||a_id||'', '|| ''||recordset_object||'.''||b_id||'', '|| ''||recordset_object||'.the_geom);'; END LOOP; END LOOP; END LOOP; And the error message, I get, is: ERROR: Record ?r_a? hat no field ?a_id? Any ideas, how to handle this? Thanks a lot and merry christmas, Birgit. On 17.12.2009 22:41, Kevin Neufeld wrote: > Small typo ... it's not > RAISE DEBUG '%s', sql; > but > RAISE DEBUG '%', sql; > > Kevin Neufeld wrote: >> http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-RECORDS-ITERATING >> >> >> Try: >> >> FOR target IN EXECUTE text_expression LOOP >> ... >> END LOOP; >> >> >> >> I usually do something like this: >> >> DECLARE >> ... >> schemaname text := 'myschema'; >> tablename text := 'mytable'; >> sql text; >> r record; >> >> BEGIN; >> sql := 'SELECT ... FROM ' || quote_ident(schemaname) || '.' || >> quote_ident(tablename); >> RAISE DEBUG '%s', sql; >> >> FOR r IN EXECUTE sql LOOP >> ... >> END LOOP >> END; >> >> -- Kevin >> >> Birgit Laggner wrote: >>> Yes, I have noticed that, but I don't know how to do that, >>> especially at defining my n (loop end point variable). I tried >>> various versions (also with execute), but without success. >>> >>> Birgit. >>> >>> On 17.12.2009 16:38, David William Bitner wrote: >>>> Birgit, >>>> >>>> The problem may be that you are creating a varchar variable for >>>> your schema name and then you are trying to use it in an instance >>>> that is expecting a database object. Anytime you are trying to >>>> insert variables as database objects, you need to construct your >>>> query as a string and use execute similar as to how you are >>>> creating your insert statement. >>>> >>>> David >>>> >>>> On Thu, Dec 17, 2009 at 9:27 AM, Birgit Laggner >>>> > >>>> wrote: >>>> >>>> Dear list, >>>> >>>> I am trying to generalize a pl/pgsql function I have written (see >>>> below). I would like to define schema and table names, as well as >>>> certain column names, in the function call (as in the PostGIS >>>> function >>>> AddGeometryColumn) in order to use them to define schema and table >>>> names >>>> and everything else within the function queries. >>>> >>>> My problem is, that postgres doesn't recognize the defined >>>> variable >>>> names if I call them in a FROM clause or INSERT INTO. This is the >>>> error >>>> message: >>>> >>>> ERROR: Schema ?schemaname? does not exist >>>> LINE 1: SELECT count( $1 ) from schemaname.table_a >>>> ^ >>>> QUERY: SELECT count( $1 ) from schemaname.table_a >>>> CONTEXT: PL/pgSQL function "_laggner_b_pgintersection" line 16 at >>>> assignment >>>> >>>> I can't imagine that it should be impossible to use variable >>>> schema and >>>> table names in a plpgsql function. So, if anybody has >>>> suggestions, I >>>> would be quite happy. >>>> >>>> Thanks and regards, >>>> >>>> Birgit. >>>> >>>> My PostGIS version: 1.4.0-10.1 >>>> My PostgreSQL version: 8.4.1-2.1 >>>> >>>> My pl/pgsql function: >>>> >>>> CREATE OR REPLACE FUNCTION _laggner_b_pgintersection(schemaname >>>> varchar(20), table_a varchar(50), a_id varchar(20), table_b >>>> varchar(50), >>>> b_id varchar(20), intersection varchar(60)) RETURNS void AS >>>> $BODY$ >>>> >>>> DECLARE >>>> counter integer; >>>> recordset_object RECORD; >>>> i integer; >>>> n integer; >>>> >>>> BEGIN >>>> >>>> counter := 0; >>>> n := count(a_id) from schemaname.table_a; >>>> >>>> --1. Intersection: >>>> >>>> FOR i in 1..n LOOP >>>> >>>> RAISE NOTICE 'Beginn Intersection Tabelle 1, Polygon %', i; >>>> >>>> FOR recordset_object IN >>>> >>>> SELECT >>>> a.a_id , >>>> b.b_id, >>>> ST_intersection(a.the_geom, b.the_geom) AS the_geom >>>> FROM schemaname.table_a a, schemaname.table_b b >>>> WHERE a.a_id=i and >>>> st_intersects(a.the_geom, b.the_geom) and >>>> a.the_geom && b.the_geom >>>> >>>> LOOP >>>> >>>> execute >>>> 'INSERT INTO ''||schemaname||''.''||intersection||'' >>>> (''||a_id||'', >>>> ''||b_id||'', the_geom) '|| >>>> 'VALUES ( '|| >>>> ''||recordset_object||'.''||a_id||'', '|| >>>> ''||recordset_object||'.''||b_id||'', '|| >>>> ''||recordset_object||'.the_geom);'; >>>> /* >>>> alternatively: >>>> INSERT INTO schemaname.intersection (a_id, b_id, the_geom) >>>> VALUES ( >>>> recordset_object.a_id, >>>> recordset_object.b_id, >>>> recordset_object.the_geom); >>>> */ >>>> counter := counter + 1; >>>> >>>> RAISE NOTICE 'Schreibe Intersection-Polygon %', counter ; >>>> >>>> END LOOP; >>>> >>>> counter := 0; >>>> >>>> END LOOP; >>>> >>>> END; >>>> $BODY$ >>>> LANGUAGE 'plpgsql' VOLATILE; >>>> ALTER FUNCTION _laggner_b_pgintersection(schemaname varchar(20), >>>> table_a >>>> varchar(50), a_id varchar(20), table_b varchar(50), b_id >>>> varchar(20), >>>> intersection varchar(60)) OWNER TO postgres; >>>> >>>> _______________________________________________ >>>> postgis-users mailing list >>>> postgis-users at postgis.refractions.net >>>> >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>>> >>>> >>>> >>>> >>>> -- >>>> ************************************ >>>> David William Bitner >>>> >>>> >>>> _______________________________________________ >>>> postgis-users mailing list >>>> postgis-users at postgis.refractions.net >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>>> >>> >>> ------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> postgis-users mailing list >>> postgis-users at postgis.refractions.net >>> http://postgis.refractions.net/mailman/listinfo/postgis-users >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From paul.malm at saabgroup.com Tue Dec 22 04:43:40 2009 From: paul.malm at saabgroup.com (Malm Paul) Date: Tue, 22 Dec 2009 13:43:40 +0100 Subject: [postgis-users] schema In-Reply-To: <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se> References: <49383B4A.5090006@usgs.gov> <493D7343.50205@usgs.gov> <493EC04B.9050406@usgs.gov> <4ABDF635.5050806@comcast.net> <4ABE2A28.5000905@pobox.com> <4AC02540.2010002@usgs.gov> <4AC079A4.9060208@siriusit.co.uk> <4AC0BC7A.60303@usgs.gov> <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se> Message-ID: <9CE1BBC0D3132A43A391263616F51E7D609C81A4D9@corpappl079.corp.saab.se> Hi, how can I create a secondary schema that includes all postgis functions as the default schema does? Kind regards, Paul From robhyx at gmail.com Tue Dec 22 06:22:06 2009 From: robhyx at gmail.com (Robert Hicks) Date: Tue, 22 Dec 2009 09:22:06 -0500 Subject: [postgis-users] Quick way to query table for 'intersects'? Message-ID: Hey all, I am trying to find the quickest way to query a table in my database and grab only the records that have a geom that intersects with another geom. Basically, the query is going to be triggered by a user clicking on a map, from there I have a lat and a lon. I post the info to my server, create a geom from that point, and then I need to grab all the rows from the table that intersects with that geom. I tried grabbing all of them and iterating one at a time but that was too time consuming (via JDBC). Is there a stored procedure for this? Thanks! -- web http://www.hyxspace.com aim hyx1138 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Liford at gd-ais.com Tue Dec 22 08:43:10 2009 From: Michael.Liford at gd-ais.com (Liford, Michael W.) Date: Tue, 22 Dec 2009 11:43:10 -0500 Subject: [postgis-users] PostGIS Installer Hangs Message-ID: Just installed PostgreSQL 8.4. Tried to install PostGIS and it hung on checking for an existing PostGIS installation. Downloaded PostGIS 1.4 separately and tried to install. This time it hung on creating a template database. Windows XP 32-bit OS. Any help appreciated. Mike Liford Oracle DBA General Dynamics AIS Office: (937)427-4461 Base: (937)522-6249 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Tue Dec 22 09:21:59 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Tue, 22 Dec 2009 09:21:59 -0800 Subject: [postgis-users] schema In-Reply-To: <9CE1BBC0D3132A43A391263616F51E7D609C81A4D9@corpappl079.corp.saab.se> References: <49383B4A.5090006@usgs.gov> <493D7343.50205@usgs.gov> <493EC04B.9050406@usgs.gov> <4ABDF635.5050806@comcast.net> <4ABE2A28.5000905@pobox.com> <4AC02540.2010002@usgs.gov> <4AC079A4.9060208@siriusit.co.uk> <4AC0BC7A.60303@usgs.gov> <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se> <9CE1BBC0D3132A43A391263616F51E7D609C81A4D9@corpappl079.corp.saab.se> Message-ID: <4B310037.2040002@refractions.net> You only need to install PostGIS once, into one schema, typically 'public'. As long as your user's search_path contains the schema you installed PostGIS into, you'll have access to all the PostGIS functions, no matter what schema you are referencing. You can read up on schemas here: http://www.postgresql.org/docs/8.4/static/ddl-schemas.html Cheers, Kevin Malm Paul wrote: > Hi, > how can I create a secondary schema that includes all postgis functions as the default schema does? > > Kind regards, > Paul > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From kneufeld at refractions.net Tue Dec 22 10:46:04 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Tue, 22 Dec 2009 10:46:04 -0800 Subject: [postgis-users] plpgsql - problem using variable schema and table names In-Reply-To: <4B30B44C.9030801@vti.bund.de> References: <4B2A4DEF.7070401@vti.bund.de> <4B2A51B7.30707@vti.bund.de> <4B2AA42B.5070401@refractions.net> <4B2AA57B.1020807@refractions.net> <4B30B44C.9030801@vti.bund.de> Message-ID: <4B3113EC.6020803@refractions.net> Hi Birgit, Hmmm, it looks like you have a few errors in your script. Comments inline. Birgit Laggner wrote: > Hi Kevin, > > for the defining of n, your suggestions works perfectly well. But in the > next step, I try to assign a record as an intersection of 2 tables. I > tried to solve this with a nested loop. But the problem is, after > assigning the records for table a and b, I can't address certain fields > within the records anymore, which would be necessary for the > intersection loop. > > By now, the part in question of my function looks like this (r_a, r_b > are declared as record, sql_a, sql_b are declared as text): > > sql_a := 'select gid, '||a_id||' as '||a_id||', the_geom from > '||quote_ident(schemaname)||'.'||quote_ident(table_a); I'm assuming, based on your original post, that 'a_id' is a parameter you wish to pass as a parameter to the function. You may want to quote_ident it as well to properly handle special characters, etc that may occur in the column name. > > raise debug '%', sql_a; > raise notice '%', sql_a; > > sql_b := 'select gid, '||b_id||' as '||b_id||', the_geom from > '||quote_ident(schemaname)||'.'||quote_ident(table_b); Same as for sql_a. > > raise debug '%', sql_b; > > FOR r_a in execute sql_a LOOP > > FOR r_b in execute sql_b LOOP > > FOR recordset_object IN execute 'select > '||quote_ident(r_a.a_id) ||', > '||quote_ident(r_b.b_id) ||', > ST_intersection('||quote_ident(r_a.the_geom)||', > '||quote_ident(r_b.the_geom)||') AS the_geom > WHERE st_intersects('||quote_ident(r_a.the_geom)||', > '||quote_ident(r_b.the_geom)||') and > '||quote_ident(r_a.the_geom)||' && '||quote_ident(r_b.the_geom) > Ok. Here r_a is referencing a field called a_id. So unless you've declared the text variable a_id to be 'a_id' (or passed it as a parameter with the same name), you'll get the error you see below. In the sql_a declaration above, change the select clause to 'select gid, ' || quote_ident(a_id) || ' AS a_id, the_geom from '... Similar for sql_b. Also, you are dereferencing the geometry fields which would be very slow. Your call to quote_ident(r_a.the_geom) is taking the geometry field in record r_a and casting the whole thing to text so it can be used in the textual execute statement. > LOOP > > execute > 'INSERT INTO ''||schemaname||''.''||intersection||'' (''||a_id||'', > ''||b_id||'', the_geom) '|| > 'VALUES ( '|| > ''||recordset_object||'.''||a_id||'', '|| > ''||recordset_object||'.''||b_id||'', '|| > ''||recordset_object||'.the_geom);'; > > END LOOP; > END LOOP; > END LOOP; > > And the error message, I get, is: > > ERROR: Record ?r_a? hat no field ?a_id? > > Any ideas, how to handle this? > > Thanks a lot and merry christmas, > > Birgit. > This seems waaaay too complicated and I don't think passing the geometry around like that will work for you. If I may suggest, I think you could replace all three LOOPs with a single sql statement (logically, it looks like it should do the same thing): CREATE OR REPLACE FUNCTION _laggner_b_pgintersection( schemaname varchar(20), table_a varchar(50), a_id varchar(20), table_b varchar(50), b_id varchar(20), intersection varchar(60)) RETURNS void AS $BODY$ BEGIN EXECUTE 'INSERT INTO ' || quote_ident(schemaname) || '.' || quote_ident(intersection) || '(a.' || quote_ident(a_id) || ', b.' || quote_ident(b_id) ||', ST_Intersection(a.the_geom, b.the_geom) ' || 'FROM ' || quote_ident(schemaname) || '.' || quote_ident(table_a) || ' AS a, ' || quote_ident(schemaname) || '.' || quote_ident(table_b) || ' AS b ' || 'WHERE ST_Intersects(a.the_geom, b.the_geom)'; END $BODY$ The only thing that is quoted here are the schema, table, and column names. The query is parsed once by the query planner and then executed. We're not casting geometries to text and back into the database again. Is there a particular reason you broke out query into 3 main LOOPs? I hope this helps. You too, have a very Merry Christmas. Cheers, Kevin From Michael.Liford at gd-ais.com Tue Dec 22 12:27:44 2009 From: Michael.Liford at gd-ais.com (Liford, Michael W.) Date: Tue, 22 Dec 2009 15:27:44 -0500 Subject: [postgis-users] schema In-Reply-To: <4B310037.2040002@refractions.net> References: <49383B4A.5090006@usgs.gov> <493D7343.50205@usgs.gov> <493EC04B.9050406@usgs.gov> <4ABDF635.5050806@comcast.net> <4ABE2A28.5000905@pobox.com> <4AC02540.2010002@usgs.gov> <4AC079A4.9060208@siriusit.co.uk><4AC0BC7A.60303@usgs.gov> <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se><9CE1BBC0D3132A43A391263616F51E7D609C81A4D9@corpappl079.corp.saab.se> <4B310037.2040002@refractions.net> Message-ID: I finally got PostGIS to install by not creating the spatial database. Seems that is where the problem is. Mike -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Kevin Neufeld Sent: Tuesday, December 22, 2009 12:22 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] schema You only need to install PostGIS once, into one schema, typically 'public'. As long as your user's search_path contains the schema you installed PostGIS into, you'll have access to all the PostGIS functions, no matter what schema you are referencing. You can read up on schemas here: http://www.postgresql.org/docs/8.4/static/ddl-schemas.html Cheers, Kevin Malm Paul wrote: > Hi, > how can I create a secondary schema that includes all postgis functions as the default schema does? > > Kind regards, > Paul > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From brianp at occinc.com Tue Dec 22 13:02:11 2009 From: brianp at occinc.com (Brian Peschel) Date: Tue, 22 Dec 2009 15:02:11 -0600 Subject: [postgis-users] Combining squares In-Reply-To: References: Message-ID: <4B3133D3.1060602@occinc.com> Hi Brian, > >> I have squares. A lot of squares. Thousands of squares. I would >> love >> to combine them into one or more larger polygons. But, they must >> valid >> polygons, non-reentrant. For example. if you have a 3x3 grid of >> squares, >> ABC >> RST >> XYZ >> and I want to combine all but the center, I would need either 2 >> polygons >> (something like ABC and RXYZT), or one polygon with an inner ring. >> > Assuming there is a table 'squares' containing a geometry type 'the_geom', this one produces a polygon having an inner ring: > > SELECT > ST_Difference(ST_Union(the_geom), (SELECT the_geom FROM squares WHERE id='S')) > FROM squares > > Best Regards, > Andreas > Does this return a multipolyon or a single polygon? I didn't state this originally, but I have disjointed squares. So if you look at a grid: ABCDEF OPQRST UVWXYZ I might have ABCEFOQUVW ABC EF O Q UVW So I would want one polygon with ABCQWVU and one with EF - Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From kneufeld at refractions.net Tue Dec 22 15:05:10 2009 From: kneufeld at refractions.net (Kevin Neufeld) Date: Tue, 22 Dec 2009 15:05:10 -0800 Subject: [postgis-users] schema In-Reply-To: References: <49383B4A.5090006@usgs.gov> <493D7343.50205@usgs.gov> <493EC04B.9050406@usgs.gov> <4ABDF635.5050806@comcast.net> <4ABE2A28.5000905@pobox.com> <4AC02540.2010002@usgs.gov> <4AC079A4.9060208@siriusit.co.uk><4AC0BC7A.60303@usgs.gov> <9CE1BBC0D3132A43A391263616F51E7D609C81A478@corpappl079.corp.saab.se><9CE1BBC0D3132A43A391263616F51E7D609C81A4D9@corpappl079.corp.saab.se> <4B310037.2040002@refractions.net> Message-ID: <4B3150A6.9020703@refractions.net> Sorry, I think there's a confusion here of terminology. I meant to say you only need to spatial enable a PostgreSQL database once (that is, you only need to import the lwpostgis.sql and spatial_ref_sys.sql files once into your database). You don't need to import the functions into every schema. -- Kevin Liford, Michael W. wrote: > I finally got PostGIS to install by not creating the spatial database. > Seems that is where the problem is. > > Mike > > -----Original Message----- > From: postgis-users-bounces at postgis.refractions.net > [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of > Kevin Neufeld > Sent: Tuesday, December 22, 2009 12:22 PM > To: PostGIS Users Discussion > Subject: Re: [postgis-users] schema > > You only need to install PostGIS once, into one schema, typically > 'public'. As long as your user's search_path > contains the schema you installed PostGIS into, you'll have access to > all the PostGIS functions, no matter what schema > you are referencing. > > You can read up on schemas here: > http://www.postgresql.org/docs/8.4/static/ddl-schemas.html > > Cheers, > Kevin > > Malm Paul wrote: >> Hi, >> how can I create a secondary schema that includes all postgis > functions as the default schema does? >> Kind regards, >> Paul >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From ml at 3.141592654.de Tue Dec 22 17:59:38 2009 From: ml at 3.141592654.de (Andreas) Date: Wed, 23 Dec 2009 02:59:38 +0100 (CET) Subject: [postgis-users] Combining squares In-Reply-To: <26429893.53.1261533377304.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <22427644.55.1261533578044.JavaMail.root@store1.zcs.ext.wpsrv.net> Hi, > SELECT > ST_Difference(ST_Union(the_geom), (SELECT the_geom FROM squares WHERE > id='S')) > FROM squares > [...] > Does this return a multipolyon or a single polygon? I think it depends on whether or not the result is presentable as a single polygon. I had a test case which consisted of disjoint squares which touch each other - in this case the upper query resulted in a single polygon. > I didn't state > this originally, but I have disjointed squares. So if you look at a > grid : > ABCDEF > OPQRST > UVWXYZ > I might have ABCEFOQUVW > ABC EF > O Q > UVW > So I would want one polygon with ABCQWVU and one with EF As far as I know, you may want to produce a multi-polygon M and then use generate_series [1] and ST_GeometryN [2] for retrieving one row for each single-polygon in M - I'm not quite sure on how to do that syntactically, but there is an example in [2], which may help you out. Best regards, Andreas [1] http://www.postgresql.org/docs/8.4/interactive/functions-srf.html [2] http://postgis.refractions.net/docs/ST_GeometryN.html From ml at 3.141592654.de Tue Dec 22 18:16:29 2009 From: ml at 3.141592654.de (Andreas) Date: Wed, 23 Dec 2009 03:16:29 +0100 (CET) Subject: [postgis-users] Quick way to query table for 'intersects'? In-Reply-To: <20765372.62.1261534520772.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <751053.64.1261534589620.JavaMail.root@store1.zcs.ext.wpsrv.net> Hi Robert, > I am trying to find the quickest way to query a table in my > database and grab only the records that have a geom that intersects > with another geom. Not sure if I got your question right. Perhaps the spatial predicate ST_Intersects(geom1, geom2) may be sufficient [1]? Something like this: SELECT ... FROM your_table WHERE ST_Intersects(the_geom, ST_GeomFromText('your WKT here', srid)) Best regards, Andreas [1] http://postgis.refractions.net/docs/ST_Intersects.html From lr at pcorp.us Wed Dec 23 22:42:01 2009 From: lr at pcorp.us (Paragon Corporation) Date: Thu, 24 Dec 2009 01:42:01 -0500 Subject: [postgis-users] [postgis-devel] [PostGIS] #311: Rename postgis.sql topostgis-1.5.sql In-Reply-To: References: <049.3cbe93fa765b3213bffcb983e6e7964c@osgeo.org><058.0148bae89391f9ed8aabd4b7ac2a7011@osgeo.org>, <30fe546d0912232133h786cb54ey4afe5519b7237fd3@mail.gmail.com> Message-ID: Paul, Mark can correct me, but I do believe the " Mark has a rage-induced aneurism and dies tragically." Goes with plan 2 :) or I at least will have a rage induced aneurism with plan 2. There are already thousands of files in share/contrib so I don't even run my sql files from that folder when I am installing PostGIS on Linux (I use the source folder). In other cases it really doesn't matter since other contribs usually have just one sql file and one uninstall (maybe). Now FWIW, I can grudgingly live with the versioned file names. Just can't live with everything in the same folder. Especially when we are talking about (n) postgis.sql, (n*4) postgis_upgrade..., (n) postgis_uninstall Thanks, Regina ---------------------- Well, that leaves us with several options, all of which gores someone's ox: 1. Leave the install exactly the way it is now, and Regina continues to make a "special" one for Windows. Unix and Windows don't match, directory-wise, but they do match filename-wise. Unix has less version info in the .sql files than Windows. 2. Change the install to have a versioned postgis-1.5.sql file installed directly into share/contrib along with all the other .sql files. Unix and Windows don't match directory-wise or file-wise, but Unix users get a versioned .sql file to match their .so files. 3. Hack the Makefile to override the pgxs install and installdirs targets to replicate Regina's Windows scheme. Unix and Windows match both directory-wise and file-wise, and Unix gets some version information to go with their .sql files. Mark has a rage-induced aneurism and dies tragically. Anyone care to start choosing so we can have a release? P. On Wed, Dec 23, 2009 at 5:50 PM, PostGIS wrote: > Comment (by robe): > > contrib/postgis (this is folder shared by all that contains proj) > contrib/postgis-1.4 > contrib/postgis-1.5 > _______________________________________________ postgis-devel mailing list postgis-devel at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-devel ----------------------------------------- The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer. From hemantbist at gmail.com Thu Dec 24 21:41:03 2009 From: hemantbist at gmail.com (Hemant Bist) Date: Fri, 25 Dec 2009 00:41:03 -0500 Subject: [postgis-users] "Resampling" polyline shapefiles. Message-ID: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> I have a polyline shapefile with each polyline having 200 segements with each segments length roughly 1 meter. I want to "resample" the polylines to have roughly 10 meter segment size and each polyline having roughly 20 segments. I understand this may result in some loss of information. Can postgis help me with some conversion like this. I need this done somewhat quickly. I have looked at the documentation but did not find anything relevant. I have installed postgis on ubuntu and ran some queries. That's my level of familiarity with postgis. Would appreciate any pointers. Best, HB -------------- next part -------------- An HTML attachment was scrubbed... URL: From epailty at googlemail.com Fri Dec 25 05:49:26 2009 From: epailty at googlemail.com (Brian Modra) Date: Fri, 25 Dec 2009 15:49:26 +0200 Subject: [postgis-users] "Resampling" polyline shapefiles. In-Reply-To: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> References: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> Message-ID: <5a9699850912250549s17ea707cj4f76835922d0cc81@mail.gmail.com> 2009/12/25 Hemant Bist : > I have a polyline shapefile with each polyline having 200 segements with > each segments length roughly 1 meter. I want to "resample" the polylines to > have roughly 10 meter segment size and each polyline having roughly 20 > segments. I understand this may result in some loss of information. > > > Can postgis help me with some? conversion like this. I need this done > somewhat quickly. I have looked at the documentation but did not find > anything relevant. > I have installed postgis on ubuntu and ran some queries. That's my level of > familiarity with postgis. > Would appreciate any pointers. http://postgis.refractions.net/docs/ST_Simplify.html http://postgis.refractions.net/docs/ST_SimplifyPreserveTopology.html http://bostongis.org/PrinterFriendly.aspx?content_name=postgis_simplify http://old.nabble.com/simplify-a-linestring-to-n-points-td20632406.html > > Best, > HB > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > > -- Brian Modra Land line: +27 23 5411 462 Mobile: +27 79 69 77 082 5 Jan Louw Str, Prince Albert, 6930 Postal: P.O. Box 2, Prince Albert 6930 South Africa http://www.zwartberg.com/ From ml at 3.141592654.de Fri Dec 25 07:54:15 2009 From: ml at 3.141592654.de (Andreas) Date: Fri, 25 Dec 2009 16:54:15 +0100 (CET) Subject: [postgis-users] strange benchmark results In-Reply-To: <1408579.17.1261756239924.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <9511116.19.1261756454880.JavaMail.root@store1.zcs.ext.wpsrv.net> Hi folks, I'm in the middle of my bachelor thesis in computer science which is all about spatial databases. The main part is benchmarking most of the spatial functions described by OGC simple features on different spatial databases (postgis, ms sql server 2008, ibm db2 gse). The last days I ran the benchmark for PostGIS and had a first look on the results. Some test cases show a strange behaviour which I like to share here hoping for some feedback. The benchmark consists of 30 queries which are kept simple and mainly testing one OGC function at a time. The main aspect is measuring the query time via JDBC and via the output of "explain analyze". To achieve a better quality the whole benchmark is run multiple times ("rounds"). The benchmark was run on Windows XP (due to having ms sql server in the benchmark), 2 GB RAM, core 2 duo with default postgres configuration (I overlooked to tune, but will catch up) and having a GIST index on all geometry columns. PostgreSQL 8.4.1 and PostGIS 1.4.0. So there is a query like SELECT ST_Union(the_geom) FROM us_county which runs an aggregate union on single polygons of TIGER data. The odd result is, that over time (in the course of 100 rounds) the query time gets "shaked up", ranging from 100 seconds in the beginning up to 800 seconds in the end. Please see the first plot [1] for details. x-coordinate shows round n (1-100), y-coordinate the measured query time using EXPLAIN ANALYZE. There are other functions which show a similar behaviour (i.e. ST_Within, ST_Touches, ST_Buffer). These results are also shown on [1]. I appreciate any hint and feedback on these results. My (heavily guessed) interpretation of this one is that there may exist kind of leak and something like a garbage collection cleanup up in between. I'm quite sure that there is no other influence on the system the benchmark ran on. Running the benchmark on a ubuntu 64-bit does not show this behaviour (most results do have a small deviation). This leads me to a more general question: Is it in general advisable to run spatial databases on 64-bit OS? Another general question: Are there more specific tuning advices for postgis (regarding config) than those which apply to Postgres in general? If I may provide more information, please let me know. Thanks a lot! Best Regards, Andreas [1] http://students.fim.uni-passau.de/~brandlan/ba/benchmark/postgis-01/timeline_postgres_index.html From hobu.inc at gmail.com Fri Dec 25 10:27:01 2009 From: hobu.inc at gmail.com (Howard Butler) Date: Fri, 25 Dec 2009 12:27:01 -0600 Subject: [postgis-users] "Resampling" polyline shapefiles. In-Reply-To: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> References: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> Message-ID: <2E2DF876-1A25-4B19-AA33-641E0DB3D212@gmail.com> ogr2ogr -segmentize will do what you want. Otherwise http://yukongis.wik.is/How_To/Densify_Line has more info. On Dec 24, 2009, at 11:41 PM, Hemant Bist wrote: > I have a polyline shapefile with each polyline having 200 segements > with each segments length roughly 1 meter. I want to "resample" the > polylines to have roughly 10 meter segment size and each polyline > having roughly 20 segments. I understand this may result in some > loss of information. > > > Can postgis help me with some conversion like this. I need this > done somewhat quickly. I have looked at the documentation but did > not find anything relevant. > I have installed postgis on ubuntu and ran some queries. That's my > level of familiarity with postgis. > Would appreciate any pointers. > > Best, > HB > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users From hemantbist at gmail.com Fri Dec 25 12:13:20 2009 From: hemantbist at gmail.com (Hemant Bist) Date: Fri, 25 Dec 2009 15:13:20 -0500 Subject: [postgis-users] "Resampling" polyline shapefiles. In-Reply-To: <2E2DF876-1A25-4B19-AA33-641E0DB3D212@gmail.com> References: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> <2E2DF876-1A25-4B19-AA33-641E0DB3D212@gmail.com> Message-ID: <14d559700912251213j6d56769cx4af68dee8721a084@mail.gmail.com> Thanks everyone, Brians's suggestion of using ST_Simplify is working for me. My shapefiles had units of degrees so I had to use tolerance of 0.00001 to get maximum deviation of roughly 1 meter. I haven't tried ogr2ogr -segmetnize yet. I will try it and see it this works as well. Happy Holidays, HB On Fri, Dec 25, 2009 at 1:27 PM, Howard Butler wrote: > ogr2ogr -segmentize > > will do what you want. > > Otherwise http://yukongis.wik.is/How_To/Densify_Line has more info. > > > On Dec 24, 2009, at 11:41 PM, Hemant Bist wrote: > > I have a polyline shapefile with each polyline having 200 segements with >> each segments length roughly 1 meter. I want to "resample" the polylines to >> have roughly 10 meter segment size and each polyline having roughly 20 >> segments. I understand this may result in some loss of information. >> >> >> Can postgis help me with some conversion like this. I need this done >> somewhat quickly. I have looked at the documentation but did not find >> anything relevant. >> I have installed postgis on ubuntu and ran some queries. That's my level >> of familiarity with postgis. >> Would appreciate any pointers. >> >> Best, >> HB >> _______________________________________________ >> postgis-users mailing list >> postgis-users at postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ravivundavalli at yahoo.com Fri Dec 25 21:52:27 2009 From: ravivundavalli at yahoo.com (Ravi) Date: Fri, 25 Dec 2009 21:52:27 -0800 (PST) Subject: [postgis-users] "Resampling" polyline shapefiles. In-Reply-To: <14d559700912242141v58862459h64328c5003921874@mail.gmail.com> Message-ID: <386078.9371.qm@web65603.mail.ac4.yahoo.com> Hi Bist, this is easy in OpenJUMP, by just scalliing ten times. I dont think then you will loose any accuracy. This will give you a graphic front to evaluate the result too. Cheers Ravi Kumar --- On Fri, 25/12/09, Hemant Bist wrote: > From: Hemant Bist > Subject: [postgis-users] "Resampling" polyline shapefiles. > To: postgis-users at postgis.refractions.net > Date: Friday, 25 December, 2009, 11:11 AM > I have a polyline shapefile with each > polyline having 200 segements with each segments length > roughly 1 meter. I want to "resample" the > polylines to have roughly 10 meter segment size and each > polyline having roughly 20 segments. I understand this may > result in some loss of information. > > > > > Can postgis help me with some? conversion like this. I > need this done somewhat quickly. I have looked at the > documentation but did not find anything relevant. > I have installed postgis on ubuntu and ran some queries. > That's my level of familiarity with postgis. > > > Would appreciate any pointers. > > Best, > HB > > > -----Inline Attachment Follows----- > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/ From vega_l at yahoo.com Sat Dec 26 23:43:23 2009 From: vega_l at yahoo.com (vega_l at yahoo.com) Date: Sat, 26 Dec 2009 23:43:23 -0800 (PST) Subject: [postgis-users] Cannot erase Table Message-ID: <631859.78401.qm@web110310.mail.gq1.yahoo.com> Hello everyone, I hope someone can help me. This might sound very basic, but I can't erase the data table "forestshape". ??????????? List of relations ?Schema |?????? Name?????? | Type? | Owner --------+------------------+-------+------- ?public | forestshape????? | table | luis ?public | geometry_columns | table | luis ?public | spatial_ref_sys? | table | luis (3 rows) I'm the owner in this database named "luis" with user "luis". But when executing "DROP TABLE forestshape" and "DROP SEQUENCE forestshape", nothing happens, not even an error message is shown. When I execute "\dt", the table "forestshape" is still there. Here is the output of "\d forestshape" luis=# \d forestshape ?????????????????????????????? Table "public.forestshape" ??? Column??? |?? Type?? |?????????????????????????? Modifiers?????????????????????????? --------------+----------+--------------------------------------------------------------- ?ogc_fid????? | integer? | not null default nextval('forestshape_ogc_fid_seq'::regclass) ?wkb_geometry | geometry | ?cat????????? | integer? | ?id?????????? | integer? | ?area???????? | integer? | Indexes: ??? "forestshape_pk" PRIMARY KEY, btree (ogc_fid) ??? "forestshape_geom_idx" gist (wkb_geometry) Check constraints: ??? "enforce_dims_wkb_geometry" CHECK (ndims(wkb_geometry) = 2) ??? "enforce_geotype_wkb_geometry" CHECK (geometrytype(wkb_geometry) = 'POLYGON'::text OR wkb_geometry IS NULL) ??? "enforce_srid_wkb_geometry" CHECK (srid(wkb_geometry) = 32767) Any help is very much welcome. -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume at lelarge.info Sun Dec 27 00:21:41 2009 From: guillaume at lelarge.info (Guillaume Lelarge) Date: Sun, 27 Dec 2009 09:21:41 +0100 Subject: [postgis-users] Cannot erase Table In-Reply-To: <631859.78401.qm@web110310.mail.gq1.yahoo.com> References: <631859.78401.qm@web110310.mail.gq1.yahoo.com> Message-ID: <4B371915.8000301@lelarge.info> Le 27/12/2009 08:43, vega_l at yahoo.com a ?crit : > Hello everyone, I hope someone can help me. > > This might sound very basic, but I can't erase the data table "forestshape". > > List of relations > Schema | Name | Type | Owner > --------+------------------+-------+------- > public | forestshape | table | luis > public | geometry_columns | table | luis > public | spatial_ref_sys | table | luis > (3 rows) > > I'm the owner in this database named "luis" with user "luis". But when executing "DROP TABLE forestshape" and "DROP SEQUENCE forestshape", nothing happens, not even an error message is shown. When I execute "\dt", the table "forestshape" is still there. > Did you put a ; behind forestshape? as in DROP TABLE forestshape; I don't see any other reason why you have no message telling you the command failed. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com From vega_l at yahoo.com Sun Dec 27 03:49:44 2009 From: vega_l at yahoo.com (vega_l at yahoo.com) Date: Sun, 27 Dec 2009 03:49:44 -0800 (PST) Subject: [postgis-users] Cannot erase Table In-Reply-To: <4B371915.8000301@lelarge.info> Message-ID: <579429.10273.qm@web110303.mail.gq1.yahoo.com> Thank you very much for replying I didn't add any ";" at the end. Perhaps some more details would help: The "forestshape" table was created by importing a vector map with the command "v.in.ogr" from GRASS 6.4" into the PostGIS database "luis". Also, the user "luis" in PostGIS is associated to a password, lets say "1234". I'm using Ubuntu 9.04 (amd64) with postgis 1.3.3 and postgresql 8.3 , which according to the guys from UbuntuGIS, all these program versions work armoniously with QGIS 1.3. (I'm trying to be careful with program versions to avoid incompatibility issues while using OSGIS software) Does "DROP TABLE" should be used indicating a password? Luis Alberto. --- On Sun, 12/27/09, Guillaume Lelarge wrote: From: Guillaume Lelarge Subject: Re: [postgis-users] Cannot erase Table To: "PostGIS Users Discussion" Cc: vega_l at yahoo.com Date: Sunday, December 27, 2009, 5:21 PM Le 27/12/2009 08:43, vega_l at yahoo.com a ?crit : > Hello everyone, I hope someone can help me. > > This might sound very basic, but I can't erase the data table "forestshape". > >? ? ? ? ? ???List of relations >? Schema |? ? ???Name? ? ???| Type? | Owner > --------+------------------+-------+------- >? public | forestshape? ? ? | table | luis >? public | geometry_columns | table | luis >? public | spatial_ref_sys? | table | luis > (3 rows) > > I'm the owner in this database named "luis" with user "luis". But when executing "DROP TABLE forestshape" and "DROP SEQUENCE forestshape", nothing happens, not even an error message is shown. When I execute "\dt", the table "forestshape" is still there. > Did you put a ; behind forestshape? as in DROP TABLE forestshape; I don't see any other reason why you have no message telling you the command failed. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume at lelarge.info Sun Dec 27 04:59:45 2009 From: guillaume at lelarge.info (Guillaume Lelarge) Date: Sun, 27 Dec 2009 13:59:45 +0100 Subject: [postgis-users] Cannot erase Table In-Reply-To: <579429.10273.qm@web110303.mail.gq1.yahoo.com> References: <579429.10273.qm@web110303.mail.gq1.yahoo.com> Message-ID: <4B375A41.8090305@lelarge.info> Le 27/12/2009 12:49, vega_l at yahoo.com a ?crit : > Thank you very much for replying > > I didn't add any ";" at the end. You should. Did you try with? > Perhaps some more details would help: > > The "forestshape" table was created by importing a vector map with the command "v.in.ogr" from GRASS 6.4" into the PostGIS database "luis". > > Also, the user "luis" in PostGIS is associated to a password, lets say "1234". > > I'm using Ubuntu 9.04 (amd64) with postgis 1.3.3 and postgresql 8.3 , which according to the guys from UbuntuGIS, all these program versions work armoniously with QGIS 1.3. (I'm trying to be careful with program versions to avoid incompatibility issues while using OSGIS software) > > Does "DROP TABLE" should be used indicating a password? > No. See http://www.postgresql.org/docs/8.3/interactive/sql-droptable.html for more details. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com From vega_l at yahoo.com Sun Dec 27 06:12:46 2009 From: vega_l at yahoo.com (vega_l at yahoo.com) Date: Sun, 27 Dec 2009 06:12:46 -0800 (PST) Subject: [postgis-users] Cannot erase Table In-Reply-To: <4B375A41.8090305@lelarge.info> Message-ID: <235851.8235.qm@web110309.mail.gq1.yahoo.com> It worked! "DROP TABLE forestshape ; " It's my first day with this system, sorry for the rookie mistake. Thank you very much! --- On Sun, 12/27/09, Guillaume Lelarge wrote: From: Guillaume Lelarge Subject: Re: [postgis-users] Cannot erase Table To: vega_l at yahoo.com Cc: "PostGIS Users Discussion" Date: Sunday, December 27, 2009, 9:59 PM Le 27/12/2009 12:49, vega_l at yahoo.com a ?crit : > Thank you very much for replying > > I didn't add any ";" at the end. You should. Did you try with? > Perhaps some more details would help: > > The "forestshape" table was created by importing a vector map with the command "v.in.ogr" from GRASS 6.4" into the PostGIS database "luis". > > Also, the user "luis" in PostGIS is associated to a password, lets say "1234". > > I'm using Ubuntu 9.04 (amd64) with postgis 1.3.3 and postgresql 8.3 , which according to the guys from UbuntuGIS, all these program versions work armoniously with QGIS 1.3. (I'm trying to be careful with program versions to avoid incompatibility issues while using OSGIS software) > > Does "DROP TABLE" should be used indicating a password? > No. See http://www.postgresql.org/docs/8.3/interactive/sql-droptable.html for more details. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.cave-ayland at siriusit.co.uk Sun Dec 27 10:14:28 2009 From: mark.cave-ayland at siriusit.co.uk (Mark Cave-Ayland) Date: Sun, 27 Dec 2009 18:14:28 +0000 Subject: [postgis-users] strange benchmark results In-Reply-To: <9511116.19.1261756454880.JavaMail.root@store1.zcs.ext.wpsrv.net> References: <9511116.19.1261756454880.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <4B37A404.8060500@siriusit.co.uk> Andreas wrote: > Hi folks, > > I'm in the middle of my bachelor thesis in computer science which is all about spatial databases. The main part is benchmarking most of the spatial functions described by OGC simple features on different spatial databases (postgis, ms sql server 2008, ibm db2 gse). > > The last days I ran the benchmark for PostGIS and had a first look on the results. Some test cases show a strange behaviour which I like to share here hoping for some feedback. > > The benchmark consists of 30 queries which are kept simple and mainly testing one OGC function at a time. The main aspect is measuring the query time via JDBC and via the output of "explain analyze". To achieve a better quality the whole benchmark is run multiple times ("rounds"). > > The benchmark was run on Windows XP (due to having ms sql server in the benchmark), 2 GB RAM, core 2 duo with default postgres configuration (I overlooked to tune, but will catch up) and having a GIST index on all geometry columns. PostgreSQL 8.4.1 and PostGIS 1.4.0. > > So there is a query like > > SELECT ST_Union(the_geom) FROM us_county > > which runs an aggregate union on single polygons of TIGER data. > > The odd result is, that over time (in the course of 100 rounds) the query time gets "shaked up", ranging from 100 seconds in the beginning up to 800 seconds in the end. Please see the first plot [1] for details. x-coordinate shows round n (1-100), y-coordinate the measured query time using EXPLAIN ANALYZE. > > There are other functions which show a similar behaviour (i.e. ST_Within, ST_Touches, ST_Buffer). These results are also shown on [1]. > > I appreciate any hint and feedback on these results. My (heavily guessed) interpretation of this one is that there may exist kind of leak and something like a garbage collection cleanup up in between. > > I'm quite sure that there is no other influence on the system the benchmark ran on. > > Running the benchmark on a ubuntu 64-bit does not show this behaviour (most results do have a small deviation). This leads me to a more general question: Is it in general advisable to run spatial databases on 64-bit OS? > > Another general question: Are there more specific tuning advices for postgis (regarding config) than those which apply to Postgres in general? > > If I may provide more information, please let me know. > > Thanks a lot! > > Best Regards, > Andreas Hi Andreas, You should find that the results should be the same across any platform; however you've missed some very important information from your tests. The first questions I would like to ask are: i) Do you re-open a connection for every SELECT command you issue to the database, or do you use a new connection? If you don't, does it make a difference if you do? ii) Which versions of PostgreSQL/PostGIS are you using on both Windows and Ubuntu? The output of 'SELECT version(), postgis_full_version()' from both setups would be useful. In particular, this will confirm which versions of GEOS are being used in each setup. ATB, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs From jairosll at gmail.com Mon Dec 28 05:27:37 2009 From: jairosll at gmail.com (Jairo Sanchez) Date: Mon, 28 Dec 2009 05:27:37 -0800 (PST) Subject: [postgis-users] Jairo Sanchez wants to connect on LinkedIn Message-ID: <537772012.8601819.1262006857352.JavaMail.app@ech3-cdn11.prod> LinkedIn ------------ Jairo Sanchez requested to add you as a connection on LinkedIn: ------------------------------------------ Debasish, I'd like to add you to my professional network on LinkedIn. - Jairo Sanchez Accept invitation from Jairo Sanchez http://www.linkedin.com/e/hCr-kpR-ellPe2HLEFrNkpRQGIeYGikvtqzlsEBBAOlWAkdAjTkFlyK/blk/I1684729859_2/pmpxnSRJrSdvj4R5fnhv9ClRsDgZp6lQs6lzoQ5AomZIpn8_cBYVdjwVczsQe3oNiiZWoBFLq4N6nOYOdP4VczkPdjALrCBxbOYWrSlI/EML_comm_afe/ View invitation from Jairo Sanchez http://www.linkedin.com/e/hCr-kpR-ellPe2HLEFrNkpRQGIeYGikvtqzlsEBBAOlWAkdAjTkFlyK/blk/I1684729859_2/39vejkUej8Td3wSckALqnpPbOYWrSlI/svi/ ------------------------------------------ DID YOU KNOW you can conduct a more credible and powerful reference check using LinkedIn? Enter the company name and years of employment or the prospective employee to find their colleagues that are also in your network. This provides you with a more balanced set of feedback to evaluate that new hire. http://www.linkedin.com/e/rsr/inv-27/ ------ (c) 2009, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml at 3.141592654.de Mon Dec 28 07:43:37 2009 From: ml at 3.141592654.de (Andreas Brandl) Date: Mon, 28 Dec 2009 16:43:37 +0100 (CET) Subject: [postgis-users] strange benchmark results In-Reply-To: <13155965.53.1262014990196.JavaMail.root@store1.zcs.ext.wpsrv.net> Message-ID: <21916827.55.1262015017116.JavaMail.root@store1.zcs.ext.wpsrv.net> Hi Mark, ------ "Mark Cave-Ayland" schrieb: > Andreas wrote: > > [...] > > The last days I ran the benchmark for PostGIS and had a first look > on the results. Some test cases show a strange behaviour which I like > to share here hoping for some feedback. > > > > [...] > > You should find that the results should be the same across any > platform; 'platform' meaning either OS (i.e. win vs. linux) or architecture (i.e. 32 vs. 64-bit) or both (in this context)? > The first questions I would like to ask are: > > i) Do you re-open a connection for every SELECT command you issue to > the > database, or do you use a new connection? I do always use the same Connection for each and every test. This is mainly because this way it is more like a real world scenario in my opinion. > If you don't, does it make a > difference if you do? I will test with reconnecting for each test. However this will take some time and I'm going to post results as soon as I get them. > ii) Which versions of PostgreSQL/PostGIS are you using on both Windows > > and Ubuntu? The output of 'SELECT version(), postgis_full_version()' > from both setups would be useful. In particular, this will confirm > which > versions of GEOS are being used in each setup. The output on the windows machine (i.e. were those strange results originated from) is: PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS The postgres installation on ubuntu: PostgreSQL 8.4.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1, 64-bit POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS Apart from proj, architecture and compiler this looks quite the same. Thanks for your reply, this is a really interesting topic to me. :) Best Regards, Andreas From simon at spatialdbadvisor.com Mon Dec 28 14:36:14 2009 From: simon at spatialdbadvisor.com (Simon Greener) Date: Tue, 29 Dec 2009 09:36:14 +1100 Subject: [postgis-users] Jairo Sanchez wants to connect on LinkedIn In-Reply-To: <537772012.8601819.1262006857352.JavaMail.app@ech3-cdn11.prod> References: <537772012.8601819.1262006857352.JavaMail.app@ech3-cdn11.prod> Message-ID: Jairo, How do I know you? regards Simon On Tue, 29 Dec 2009 00:27:37 +1100, Jairo Sanchez wrote: > LinkedIn > ------------ > > Jairo Sanchez requested to add you as a connection on LinkedIn: > ------------------------------------------ > > Debasish, > > I'd like to add you to my professional network on LinkedIn. > > - Jairo Sanchez > > Accept invitation from Jairo Sanchez > http://www.linkedin.com/e/hCr-kpR-ellPe2HLEFrNkpRQGIeYGikvtqzlsEBBAOlWAkdAjTkFlyK/blk/I1684729859_2/pmpxnSRJrSdvj4R5fnhv9ClRsDgZp6lQs6lzoQ5AomZIpn8_cBYVdjwVczsQe3oNiiZWoBFLq4N6nOYOdP4VczkPdjALrCBxbOYWrSlI/EML_comm_afe/ > > View invitation from Jairo Sanchez > http://www.linkedin.com/e/hCr-kpR-ellPe2HLEFrNkpRQGIeYGikvtqzlsEBBAOlWAkdAjTkFlyK/blk/I1684729859_2/39vejkUej8Td3wSckALqnpPbOYWrSlI/svi/ > ------------------------------------------ > > DID YOU KNOW you can conduct a more credible and powerful reference check using LinkedIn? Enter the company name and years of employment or the prospective employee to find their colleagues that are also in your network. This provides you with a more balanced set of feedback to evaluate that new hire. > http://www.linkedin.com/e/rsr/inv-27/ > >------ > (c) 2009, LinkedIn Corporation > > -- SpatialDB Advice and Design, Solutions Architecture and Programming, Oracle Database 10g Administrator Certified Associate; Oracle Database 10g SQL Certified Professional Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE, Manifold GIS, FME, Radius Topology and Studio Specialist. 39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia. Website: www.spatialdbadvisor.com Email: simon at spatialdbadvisor.com Voice: +61 362 396397 Mobile: +61 418 396391 Skype: sggreener Longitude: 147.20515 (147? 12' 18" E) Latitude: -43.01530 (43? 00' 55" S) GeoHash: r22em9r98wg NAC:W80CK 7SWP3 From adi-4u at hotmail.com Mon Dec 28 20:06:34 2009 From: adi-4u at hotmail.com (Muhammad Adnan) Date: Tue, 29 Dec 2009 04:06:34 +0000 Subject: [postgis-users] postgis installation problem Message-ID: i am having a problem with installing postgis while running this command /usr/local/pgsql/bin/psql -d test -f /usr/share/postgresql/8.4/contrib/postgis.sql I got the following error message: BEGIN psql:/usr/share/postgresql/8.4/contrib/postgis.sql:53: NOTICE: type "spheroid" is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/postgresql/8.4/contrib/postgis.sql:53: ERROR: could not access file "$libdir/postgis-1.4": No such file or directory psql:/usr/share/postgresql/8.4/contrib/postgis.sql:59: ERROR: current transaction is aborted, commands ignored until end of transaction block psql:/usr/share/postgresql/8.4/contrib/postgis.sql:65: ERROR: current transaction is aborted, commands ignored until end of transaction block .................... psql:/usr/share/postgresql/8.4/contrib/postgis.sql:6949: ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK i tried to search on the web but could not figured it out the solution. I am installing the following packages on ubuntu 9.10 Apache-2.2.14 postgresql-8.4.1 php-5.2.12 proj-4.7.0 geos-3.2.0 postgis-1.4.0 I will appreciate if anyone cloud help me to solve this problem.Adnan _________________________________________________________________ Hotmail: Trusted email with Microsoft?s powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From devrim at gunduz.org Mon Dec 28 20:19:37 2009 From: devrim at gunduz.org (Devrim =?ISO-8859-1?Q?G=DCND=DCZ?=) Date: Tue, 29 Dec 2009 06:19:37 +0200 Subject: [postgis-users] postgis installation problem In-Reply-To: References: Message-ID: <1262060377.2528.171.camel@hp-laptop2.gunduz.org> On Tue, 2009-12-29 at 04:06 +0000, Muhammad Adnan wrote: > /usr/local/pgsql/bin/psql -d test > -f /usr/share/postgresql/8.4/contrib/postgis.sql > > I am installing the following packages on ubuntu 9.10 > postgresql-8.4.1 So your are not using the psql that is provided by PostgreSQL package itself, which is causing confusions. Either use distro's PostgreSQL, or compile PostGIS from sources, or edit postgis.sql so that it will point to correct $libdir. -- Devrim G?ND?Z, RHCE Command Prompt - http://www.CommandPrompt.com devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From pcreso at pcreso.com Mon Dec 28 20:50:27 2009 From: pcreso at pcreso.com (pcreso at pcreso.com) Date: Mon, 28 Dec 2009 20:50:27 -0800 (PST) Subject: [postgis-users] postgis installation problem In-Reply-To: <1262060377.2528.171.camel@hp-laptop2.gunduz.org> Message-ID: <639735.33701.qm@web33208.mail.mud.yahoo.com> Or install from packages built for your distribution, in which case no compilation is necessary. This should work for most common Linux distributions, which one are you using? Brent Wood --- On Tue, 12/29/09, Devrim G?ND?Z wrote: > From: Devrim G?ND?Z > Subject: Re: [postgis-users] postgis installation problem > To: "PostGIS Users Discussion" > Date: Tuesday, December 29, 2009, 5:19 PM > On Tue, 2009-12-29 at 04:06 +0000, > Muhammad Adnan wrote: > > /usr/local/pgsql/bin/psql -d test > > -f /usr/share/postgresql/8.4/contrib/postgis.sql > > > > > > I am installing the following packages on ubuntu 9.10 > > postgresql-8.4.1 > > > So your are not using the psql that is provided by > PostgreSQL package > itself, which is causing confusions. Either use distro's > PostgreSQL, or > compile PostGIS from sources, or edit postgis.sql so that > it will point > to correct $libdir. > -- > Devrim G?ND?Z, RHCE > Command Prompt - http://www.CommandPrompt.com > devrim~gunduz.org, devrim~PostgreSQL.org, > devrim.gunduz~linux.org.tr > http://www.gunduz.org? Twitter: http://twitter.com/devrimgunduz > > -----Inline Attachment Follows----- > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > From Harald.Budschedl at ikt.linz.at Tue Dec 29 02:16:32 2009 From: Harald.Budschedl at ikt.linz.at (Budschedl Harald) Date: Tue, 29 Dec 2009 11:16:32 +0100 Subject: [postgis-users] Geomedia Dataserver for PostGIS Message-ID: <755D7A8C698CE141BF7791E841710C7D7C94D00E1C@UGLCL01-MXS.ugl.linz.at> Hi PostGIS ppl! This is my first posting in this mailinglist. I just got out of a PostgreSQL-seminar last week, learning a lot about that DB. Definitely a cool thing! We are currently using ORACLE incl. Spatial in an Intergraph/Geomedia/Respublica environment, so I thought: "let's see what PostGIS will do for me". Setting up PostgreSQL 8.4 and PostGIS 1.4 was easy enough. I even created my own cadastre-database, as I wanted to test the PG-DB with that data. But how to get the data to PG? First I tried using Geomedia, but there is no PostGIS dataserver. *hint, hint* But thank god, there is FME to save the day. Shame though, the FME-Dataserver for Geomedia is just supporting read access. To write data into a PG-DB you'll have to use the Workbench. And so I did. Works fine so far. Then there were only 2 "quirks" to sort out. One is already solved, but I guess I have to take some time to figure out what is wrong with the second one. First problem: Even though I used the same (and correct) projection (AUT-GK31-5 in FME) in all my products, the data is off to the west about 30km, when I load it in Geomedia via FME-Dataserver. The Geoworkspace-Coordsys is ok, I checked that. When I load the data into FME-Viewer, the coordinates are ok. Solution: PostGIS saved the Data in EPSG:31258, which FME didn't understand correctly. "Save" and their austrian vendor "Axmann" were able to solve this problem very quickly. Second problem: Not all the attributes are shown in Geomedia, neither when I doubleclick an object to review the properties, nor when I check the featuredefinition itself. I have yet to check which attributefields are missing, but my first guess after a short check is, that there seems to be a problem with VARCHAR attributes. It's not just the data, but the whole fielddefinition is missing. Again, when I load the data in FME-Viewer, the attributes are all there. To find out more about the problem, I am currently trying to establish a WFS webservice on my testserver, using the UMN Mapserver on Apache. Quite a challenge for me, but I am learning ;) Geomedia will be able to access WFS with their own dataserver and I am curious to see, if the attribute-problem prevails or is gone. So here goes my call to all the "explorers who go boldly, where no Geomedian has gone before", and therefore have some experience with PostGIS and Geomedia: Any hints are greatly appreciated! Oh, yes, and if someone feels compelled to create a native PostGIS-Dataserver for Geomedia: that would be a hit! I am not a programmer (not anymore - stopped coding in the mid-90s), but from what I heared, this should not be much of a trouble for people with C# and/or .NET experience. A developmet environment incl. documentation comes with every Geomedia licence. But as I said, I'm no expert anymore. If there are any new developments, I'll try to keep you posted, if you are interested and my time allows it. Cya. Harry Freundliche Gr??e Harald Budschedl Geodaten Management (Geo) IKT Linz GmbH Ein Unternehmen der Stadt Linz 4040 Linz, Hauptstra?e 1-5 AUSTRIA Tel. +43 732 7070 3436 Fax +43 732 7070 54 3436 visit www.linz.at/ikt mailto: harald.budschedl at ikt.linz.at ________________________________ Diese Nachricht inklusive aller Anh?nge kann vertrauliche Informationen enthalten. Sie ist ausschlie?lich f?r die adressierten Personen bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe sind nicht gestattet. Sollten Sie nicht die richtige Adressatin/der richtige Adressat sein, vernichten Sie den gesamten Inhalt (? 93 Abs. 4 Telekommunikationsgesetz 2003) und informieren Sie bitte sofort den/die Absender/in. N?here Regelungen zur elektronischen Kommunikation mit der Stadt Linz finden Sie in den "Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend das E-Government der Stadt Linz (e-linz)" ( http://www.linz.at/images/AGB_egov_2008.pdf ) IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344 IKT Linz Infrastruktur GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321990s ++ UID-Nummer: ATU64664303 A-4020 Linz, Gruberstra?e 42, Tel. +43 732 7070 0, Fax: +43 732 7070 54 1555, office at ikt.linz.at, www.linz.at/ikt Linz ist 2009 Kulturhauptstadt Europas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.gillet at market-ip.com Tue Dec 29 02:39:32 2009 From: nicolas.gillet at market-ip.com (Nicolas Gillet - MARKET-IP) Date: Tue, 29 Dec 2009 11:39:32 +0100 Subject: [postgis-users] linestring aggregation Message-ID: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> Hello I am trying to aggregate linestrings together based on their attributes and the fact that they are touching each other. Therefore I found out how to write a very basic aggregate function : CREATE AGGREGATE geometry_sum ( SFUNC = st_union, BASETYPE = geometry, STYPE = geometry); I can now aggregate my linestrings grouped by their names, importance, and so on but . I have trouble to group them by the fact that they are touching each other. e.g. linestring A, B and C have the same attributes but only A and B are touching each other. I would like as a result A+B in one record, and C in a second record. Does someone have any tips to share ? Thank you, Nicolas -------------- next part -------------- An HTML attachment was scrubbed... URL: From seanasy at gmail.com Tue Dec 29 06:33:53 2009 From: seanasy at gmail.com (Sean) Date: Tue, 29 Dec 2009 06:33:53 -0800 (PST) Subject: [postgis-users] linestring aggregation In-Reply-To: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> Message-ID: <59771139-0cd3-4b6d-bec6-d7df318c3302@h2g2000vbd.googlegroups.com> Sounds like ST_Touches: http://postgis.refractions.net/docs/ST_Touches.html Sean On Dec 29, 5:39?am, "Nicolas Gillet - MARKET-IP" wrote: > Hello > > I am trying to aggregate linestrings together based on their attributes and > the fact that they are touching each other. > > Therefore I found out how to write a very basic aggregate function : > > ? ?CREATE AGGREGATE geometry_sum ( > > ? ? ? ? ? ? ? ? SFUNC = st_union, > > ? ? ? ? ? ? ? ? BASETYPE = geometry, > > ? ? ? ? ? ? ? ? STYPE = geometry); > > I can now aggregate my linestrings grouped by their names, importance, and > so on but . I have trouble to group them by the fact that they are touching > each other. > > e.g. > > linestring A, B and C have the same attributes but only A and B are touching > each other. > > I would like as a result A+B in one record, and C in a second record. > > Does someone have any tips to share ? > > Thank you, > > Nicolas > > _______________________________________________ > postgis-users mailing list > postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/listinfo/postgis-users From nicolas.gillet at market-ip.com Tue Dec 29 06:42:18 2009 From: nicolas.gillet at market-ip.com (Nicolas Gillet - MARKET-IP) Date: Tue, 29 Dec 2009 15:42:18 +0100 Subject: [postgis-users] linestring aggregation In-Reply-To: <59771139-0cd3-4b6d-bec6-d7df318c3302@h2g2000vbd.googlegroups.com> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> <59771139-0cd3-4b6d-bec6-d7df318c3302@h2g2000vbd.googlegroups.com> Message-ID: <00eb01ca8895$1f24f1e0$5d6ed5a0$@gillet@market-ip.com> Hello Thanks for the answer, I knew about ST_touches(geometry, geometry) function. But I don't know how to use it in my aggregate query to group only the records that are touching each other SELECT name, code, geometry_sum(the_geom) FROM roads GROUP BY name, code, st_touches(???, the_geom) Or something like that (geometry_sum being my aggregate function). Any idea ? Nicolas -----Message d'origine----- De?: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de Sean Envoy??: mardi 29 d?cembre 2009 15:34 ??: postgis-users at postgis.refractions.net Objet?: Re: [postgis-users] linestring aggregation Sounds like ST_Touches: http://postgis.refractions.net/docs/ST_Touches.html Sean On Dec 29, 5:39?am, "Nicolas Gillet - MARKET-IP" wrote: > Hello > > I am trying to aggregate linestrings together based on their attributes and > the fact that they are touching each other. > > Therefore I found out how to write a very basic aggregate function : > > ? ?CREATE AGGREGATE geometry_sum ( > > ? ? ? ? ? ? ? ? SFUNC = st_union, > > ? ? ? ? ? ? ? ? BASETYPE = geometry, > > ? ? ? ? ? ? ? ? STYPE = geometry); > > I can now aggregate my linestrings grouped by their names, importance, and > so on but . I have trouble to group them by the fact that they are touching > each other. > > e.g. > > linestring A, B and C have the same attributes but only A and B are touching > each other. > > I would like as a result A+B in one record, and C in a second record. > > Does someone have any tips to share ? > > Thank you, > > Nicolas > > _______________________________________________ > postgis-users mailing list > postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/ listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From seanasy at gmail.com Tue Dec 29 08:21:02 2009 From: seanasy at gmail.com (Sean) Date: Tue, 29 Dec 2009 08:21:02 -0800 (PST) Subject: [postgis-users] linestring aggregation In-Reply-To: <00eb01ca8895$1f24f1e0$5d6ed5a0$@gillet@market-ip.com> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> <59771139-0cd3-4b6d-bec6-d7df318c3302@h2g2000vbd.googlegroups.com> <00eb01ca8895$1f24f1e0$5d6ed5a0$@gillet@market-ip.com> Message-ID: <9fe5a959-59ad-48ed-b060-0aea85609422@k9g2000vbl.googlegroups.com> I think you have to pull it out in the WHERE clause. I'm not sure if this will work, I'm not good at doing SQL in my head and can't test it right now: SELECT name, code, geometry_sum(r1.the_geom) FROM roads r1, roads r2 WHERE ST_Touches(r1.the_geom, r2.the_geom) GROUP BY name, code and you'll probably have to UNION this with a query that gets the pieces that don't touch. Sean On Dec 29, 9:42?am, "Nicolas Gillet - MARKET-IP" wrote: > Hello > > Thanks for the answer, > > I knew about ST_touches(geometry, geometry) function. > > But I don't know how to use it in my aggregate query to group only the > records that are touching each other > > SELECT name, code, geometry_sum(the_geom) FROM roads > GROUP BY name, code, st_touches(???, the_geom) > > Or something like that (geometry_sum being my aggregate function). > > Any idea ? > > Nicolas > > -----Message d'origine----- > De?: postgis-users-boun... at postgis.refractions.net > [mailto:postgis-users-boun... at postgis.refractions.net] De la part de Sean > Envoy??: mardi 29 d?cembre 2009 15:34 > ??: postgis-us... at postgis.refractions.net > Objet?: Re: [postgis-users] linestring aggregation > > Sounds like ST_Touches:http://postgis.refractions.net/docs/ST_Touches.html > > ? Sean > > On Dec 29, 5:39?am, "Nicolas Gillet - MARKET-IP" > > wrote: > > Hello > > > I am trying to aggregate linestrings together based on their attributes > and > > the fact that they are touching each other. > > > Therefore I found out how to write a very basic aggregate function : > > > ? ?CREATE AGGREGATE geometry_sum ( > > > ? ? ? ? ? ? ? ? SFUNC = st_union, > > > ? ? ? ? ? ? ? ? BASETYPE = geometry, > > > ? ? ? ? ? ? ? ? STYPE = geometry); > > > I can now aggregate my linestrings grouped by their names, importance, and > > so on but . I have trouble to group them by the fact that they are > touching > > each other. > > > e.g. > > > linestring A, B and C have the same attributes but only A and B are > touching > > each other. > > > I would like as a result A+B in one record, and C in a second record. > > > Does someone have any tips to share ? > > > Thank you, > > > Nicolas > > > _______________________________________________ > > postgis-users mailing list > > postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/ > listinfo/postgis-users > _______________________________________________ > postgis-users mailing list > postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/listinfo/postgis-users > > _______________________________________________ > postgis-users mailing list > postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/listinfo/postgis-users From ciesaremedina at hotmail.com Tue Dec 29 10:38:28 2009 From: ciesaremedina at hotmail.com (=?Windows-1252?B?Q+lzYXIgTWVkaW5h?=) Date: Tue, 29 Dec 2009 15:38:28 -0300 Subject: [postgis-users] GIST INDEX!! Message-ID: Dear all I am trying to do a tunning to my database, and i have many doubt, because i think that is very slow (with 3 o 4 users is slow) I have 2700 tables aprox. with geometry column in my database, the street's name, big avenues, regional boundaries, street types,comunal areas, etc. but the tables don't have a index in the geometry column !!!!!!! - Is recommended do a "GIST" index for each tables in my database? - Could be more fast, if that have a gist index? - What is the benefits ? kings regards, thank you... and happy new year. PD: Frecuently i do "vacuum" and "reindex" to my database C?sar http://www.linkedin.com/in/cesarmedinam http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail (dot) com msn: ciesareMedina (at) hotmail (dot) com skype: ciesare_medina CHILE. _________________________________________________________________ Windows Live: Make it easier for your friends to see what you?re up to on Facebook. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.hermansen at timberline.ca Tue Dec 29 11:07:39 2009 From: chris.hermansen at timberline.ca (Chris Hermansen) Date: Tue, 29 Dec 2009 11:07:39 -0800 Subject: [postgis-users] GIST INDEX!! In-Reply-To: References: Message-ID: <1262113659.1949.11.camel@temuko> C?sar; You need to be a bit more specific about what you mean by "slow". What operations precisely are slow? Having said that, in general any columns - spatial or otherwise - to which you refer in WHERE clauses in your SELECT statements should be considered for indexing, especially if you use them in join conditions. If you have a specific SELECT statement that gives you problems, you might try using an EXPLAIN or ANALYZE together with the statement as for example in http://www.postgresql.org/docs/8.1/static/sql-explain.html 2700 tables - that is a lot of tables. I have no idea if such a large number of tables will slow down query execution, but it seems possible. Do you really need that many tables? For example, if you have all the IGM shape files by map sheet for loading, you don't need to create a table for each shape file. Rather you might put all the different "caminos" shape files into one table, and the "comunas" into another, and so on. Sorry I'm just guessing at what you might be doing here, if I'm wrong please ignore! La documentaci?n de PostgreSQL es disponible en castellano, por ejemplo en el sitio http://palomo.usach.cl/docshtml/node4.html On Tue, 2009-12-29 at 15:38 -0300, C?sar Medina wrote: > Dear all > > > I am trying to do a tunning to my database, and i have many doubt, > because i think that is very slow (with 3 o 4 users is slow) > > > I have 2700 tables aprox. with geometry column in my database, the > street's name, big avenues, regional boundaries, street types,comunal > areas, etc. but the tables don't have a index in the geometry > column !!!!!!! - Is recommended do a "GIST" index for each tables in > my database? - Could be more fast, if that have a gist index? - What > is the benefits ? kings regards, thank you... and happy new year. > > > PD: Frecuently i do "vacuum" and "reindex" to my database > C?sar http://www.linkedin.com/in/cesarmedinam > http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail (dot) > com msn: ciesareMedina (at) hotmail (dot) com skype: ciesare_medina > > CHILE. > > > ______________________________________________________________________ > Windows Live: Make it easier for your friends to see what you?re up to > on Facebook. > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users -- Regards, Chris Hermansen ? mailto:chris.hermansen at timberline.ca tel+1.604.714.2878 ? fax+1.604.733.0631 ? mob+1.778.840.4625 Timberline Natural Resource Group ? http://www.timberline.ca 401 ? 958 West 8th Avenue ? Vancouver BC ? Canada ? V5Z 1E5 From fsalas at geocuba.cu Tue Dec 29 13:11:13 2009 From: fsalas at geocuba.cu (fsalas) Date: Tue, 29 Dec 2009 15:11:13 -0600 Subject: [postgis-users] select the interior parcels smaller than 25 hectares Message-ID: <003801ca88cb$84916460$3998a8c0@deltha> Hi, I used this SQL for select the interior parcels and obtained all interior parcels on the map.. SELECT ST_InteriorRingN((the_geom),s) FROM datnivel3, generate_series(1,(SELECT max(ST_NumInteriorRing(the_geom)) FROM datnivel3)) s WHERE ST_NumInteriorRing(the_geom) > 0 AND ST_InteriorRingN(the_geom,s) IS NOT NULL .However, I need select from "datnivel3" table, only the parcels smaller than 25 hectares, How can I implement this? Thank you, Salas From ciesaremedina at hotmail.com Tue Dec 29 12:26:17 2009 From: ciesaremedina at hotmail.com (=?Windows-1252?B?Q+lzYXIgTWVkaW5h?=) Date: Tue, 29 Dec 2009 17:26:17 -0300 Subject: [postgis-users] GIST INDEX!! In-Reply-To: <1262113659.1949.11.camel@temuko> References: , <1262113659.1949.11.camel@temuko> Message-ID: Hi Chris when i say "slow", i refer that is no so fast than googleMaps, extreme example.!!! This is a url with one commune, http://mapas.observatoriourbano.cl/localizacion/map.phtml?config=7101 In this case, we have 11 layer in database format (Geographic data). if you multiply 11 by 270 comunnes in my country, we have 2970 tables aprox, and when i do a zoom over a area, this show the area, but "slow". for this, I don't do anything relationated with WHERE clause, i don't use dificult SQL, just show the layer in the mapfile with: "DATA the_geom from (SELECT the_geom,gid FROM vii_talca_areacomunal) AS pas_pred3 USING UNIQUE gid USING SRID=-1" as a complement in Hardware, i have two Virtual Machine:1.- Database server, AMD Opteron 64, 2,4 Ghz, 4GB Ram2.- Page server, AMD Opteron 64, 2,4 Ghz, 2GB Ram in Software, Linux fedora, php pages, apache, postgresql with postgis, mapserver and p.mapper I don't know what i have to do, to do it map more fast !!!! thank very much.!!!! C?sar http://www.linkedin.com/in/cesarmedinam http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail (dot) com msn: ciesareMedina (at) hotmail (dot) com skype: ciesare_medina > From: chris.hermansen at timberline.ca > To: postgis-users at postgis.refractions.net > Date: Tue, 29 Dec 2009 11:07:39 -0800 > Subject: Re: [postgis-users] GIST INDEX!! > > C?sar; > > You need to be a bit more specific about what you mean by "slow". What > operations precisely are slow? > > Having said that, in general any columns - spatial or otherwise - to > which you refer in WHERE clauses in your SELECT statements should be > considered for indexing, especially if you use them in join conditions. > If you have a specific SELECT statement that gives you problems, you > might try using an EXPLAIN or ANALYZE together with the statement as for > example in > > http://www.postgresql.org/docs/8.1/static/sql-explain.html > > 2700 tables - that is a lot of tables. I have no idea if such a large > number of tables will slow down query execution, but it seems possible. > > Do you really need that many tables? For example, if you have all the > IGM shape files by map sheet for loading, you don't need to create a > table for each shape file. Rather you might put all the different > "caminos" shape files into one table, and the "comunas" into another, > and so on. Sorry I'm just guessing at what you might be doing here, if > I'm wrong please ignore! > > La documentaci?n de PostgreSQL es disponible en castellano, por ejemplo > en el sitio > > http://palomo.usach.cl/docshtml/node4.html > > On Tue, 2009-12-29 at 15:38 -0300, C?sar Medina wrote: > > Dear all > > > > > > I am trying to do a tunning to my database, and i have many doubt, > > because i think that is very slow (with 3 o 4 users is slow) > > > > > > I have 2700 tables aprox. with geometry column in my database, the > > street's name, big avenues, regional boundaries, street types,comunal > > areas, etc. but the tables don't have a index in the geometry > > column !!!!!!! - Is recommended do a "GIST" index for each tables in > > my database? - Could be more fast, if that have a gist index? - What > > is the benefits ? kings regards, thank you... and happy new year. > > > > > > PD: Frecuently i do "vacuum" and "reindex" to my database > > C?sar http://www.linkedin.com/in/cesarmedinam > > http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail (dot) > > com msn: ciesareMedina (at) hotmail (dot) com skype: ciesare_medina > > > > CHILE. > > > > > > ______________________________________________________________________ > > Windows Live: Make it easier for your friends to see what you?re up to > > on Facebook. > > _______________________________________________ > > postgis-users mailing list > > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > -- > Regards, > > Chris Hermansen ? mailto:chris.hermansen at timberline.ca > tel+1.604.714.2878 ? fax+1.604.733.0631 ? mob+1.778.840.4625 > Timberline Natural Resource Group ? http://www.timberline.ca > 401 ? 958 West 8th Avenue ? Vancouver BC ? Canada ? V5Z 1E5 > > > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users _________________________________________________________________ Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail?. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.ribot at gmail.com Tue Dec 29 14:42:37 2009 From: nicolas.ribot at gmail.com (Nicolas Ribot) Date: Tue, 29 Dec 2009 23:42:37 +0100 Subject: [postgis-users] select the interior parcels smaller than 25 hectares In-Reply-To: <003801ca88cb$84916460$3998a8c0@deltha> References: <003801ca88cb$84916460$3998a8c0@deltha> Message-ID: <28de5e310912291442i1f1c2309j889f3d2d3bcc3003@mail.gmail.com> > Hi, > I ?used this SQL for select the interior parcels and obtained all interior > parcels on the map.. > > SELECT ST_InteriorRingN((the_geom),s) > FROM datnivel3, generate_series(1,(SELECT max(ST_NumInteriorRing(the_geom)) > FROM datnivel3)) s > WHERE ST_NumInteriorRing(the_geom) > 0 > AND ST_InteriorRingN(the_geom,s) IS NOT NULL > > .However, I need select from "datnivel3" table, only the parcels ?smaller > than 25 hectares, > How can I implement this? > Hi, st_area is your friend: add a where clause concerning the area: ... and st_area(the_geom) < 250000 (verifiy your data are stored in metric projection system, or at least represent meters. And if it is not the case, reproject your data into a metric coordinate system before applying the area condition (st_transform to reproject the data) HTH Nicolas From ivan.mincik at gmail.com Tue Dec 29 15:05:40 2009 From: ivan.mincik at gmail.com (Ivan Mincik) Date: Wed, 30 Dec 2009 00:05:40 +0100 Subject: [postgis-users] GIST INDEX!! In-Reply-To: References: <1262113659.1949.11.camel@temuko> Message-ID: <1ed604b80912291505p6978b647qbb6f5ffcf55d235f@mail.gmail.com> > in Software, > Linux fedora, php pages, apache, postgresql with postgis, mapserver and > p.mapper > I don't know what i have to do, to do it ?map more fast !!!! Dear Cesar, using GIST index in geographic database is nearly a must, but still You can't compare to Google maps, which is using different technology. p.mapper is fetching data from database and rendering a new map every time You move in the map. Google maps is using pre-cached map tiles, which are rendered once and than served from cache as static images with very good performance. I recommend You to move to OpenLayers and Tilecache. Ivan From chris.hermansen at timberline.ca Tue Dec 29 15:17:14 2009 From: chris.hermansen at timberline.ca (Chris Hermansen) Date: Tue, 29 Dec 2009 15:17:14 -0800 Subject: [postgis-users] GIST INDEX!! In-Reply-To: References: , <1262113659.1949.11.camel@temuko> Message-ID: <1262128634.2055.32.camel@temuko> Hi C?sar; Ok so I think part of your problem is that you have the data for each comuna in a separate table. Really, there should only be 11 tables in your database, one for each layer. Your speed problem comes from opening all the tables to do the queries. This will be S L O W. What you need to do is create a database with a table for eg "caminos". Then you must convert each IGM caminos shape file to a postgis load file and load each one of those converted shape files INTO THE SAME TABLE. If you are using ogr2ogr there is an option to append data to an existing table. Therefore, for the first comuna, create the table; for the subsequent 269, append the data to the same table you created. Do you follow me? Once you have all the data loaded, then you should create GIST indexes on your 11 tables' geometry columns. Si quieres discutirlo en castellano por favor enviame un email privado. On Tue, 2009-12-29 at 17:26 -0300, C?sar Medina wrote: > Hi Chris > > > when i say "slow", i refer that is no so fast than googleMaps, extreme > example.!!! > > > This is a url with one commune, > http://mapas.observatoriourbano.cl/localizacion/map.phtml?config=7101 > > > In this case, we have 11 layer in database format (Geographic data). > if you multiply 11 by 270 comunnes in my country, we have 2970 tables > aprox, and when i do a zoom over a area, this show the area, but > "slow". > > > > > for this, I don't do anything relationated with WHERE clause, i don't > use dificult SQL, just show the layer in the mapfile with: > > > "DATA the_geom from (SELECT the_geom,gid FROM vii_talca_areacomunal) > AS pas_pred3 USING UNIQUE gid USING SRID=-1" > > > as a complement > in Hardware, i have two Virtual Machine: > 1.- Database server, AMD Opteron 64, 2,4 Ghz, 4GB Ram > 2.- Page server, AMD Opteron 64, 2,4 Ghz, 2GB Ram > > > in Software, > Linux fedora, php pages, apache, postgresql with postgis, mapserver > and p.mapper > > > I don't know what i have to do, to do it map more fast !!!! > > > thank very much.!!!! > > C?sar http://www.linkedin.com/in/cesarmedinam > http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail (dot) > com msn: ciesareMedina (at) hotmail (dot) com skype: ciesare_medina > > > > > > > From: chris.hermansen at timberline.ca > > To: postgis-users at postgis.refractions.net > > Date: Tue, 29 Dec 2009 11:07:39 -0800 > > Subject: Re: [postgis-users] GIST INDEX!! > > > > C?sar; > > > > You need to be a bit more specific about what you mean by "slow". > What > > operations precisely are slow? > > > > Having said that, in general any columns - spatial or otherwise - to > > which you refer in WHERE clauses in your SELECT statements should be > > considered for indexing, especially if you use them in join > conditions. > > If you have a specific SELECT statement that gives you problems, you > > might try using an EXPLAIN or ANALYZE together with the statement as > for > > example in > > > > http://www.postgresql.org/docs/8.1/static/sql-explain.html > > > > 2700 tables - that is a lot of tables. I have no idea if such a > large > > number of tables will slow down query execution, but it seems > possible. > > > > Do you really need that many tables? For example, if you have all > the > > IGM shape files by map sheet for loading, you don't need to create a > > table for each shape file. Rather you might put all the different > > "caminos" shape files into one table, and the "comunas" into > another, > > and so on. Sorry I'm just guessing at what you might be doing here, > if > > I'm wrong please ignore! > > > > La documentaci?n de PostgreSQL es disponible en castellano, por > ejemplo > > en el sitio > > > > http://palomo.usach.cl/docshtml/node4.html > > > > On Tue, 2009-12-29 at 15:38 -0300, C?sar Medina wrote: > > > Dear all > > > > > > > > > I am trying to do a tunning to my database, and i have many doubt, > > > because i think that is very slow (with 3 o 4 users is slow) > > > > > > > > > I have 2700 tables aprox. with geometry column in my database, the > > > street's name, big avenues, regional boundaries, street > types,comunal > > > areas, etc. but the tables don't have a index in the geometry > > > column !!!!!!! - Is recommended do a "GIST" index for each tables > in > > > my database? - Could be more fast, if that have a gist index? - > What > > > is the benefits ? kings regards, thank you... and happy new year. > > > > > > > > > PD: Frecuently i do "vacuum" and "reindex" to my database > > > C?sar http://www.linkedin.com/in/cesarmedinam > > > http://foss4gchile.blogspot.com/ mail: ciesareMedina (at) gmail > (dot) > > > com msn: ciesareMedina (at) hotmail (dot) com skype: > ciesare_medina > > > > > > CHILE. > > > > > > > > > > ______________________________________________________________________ > > > Windows Live: Make it easier for your friends to see what you?re > up to > > > on Facebook. > > > _______________________________________________ > > > postgis-users mailing list > > > postgis-users at postgis.refractions.net > > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > > > -- > > Regards, > > > > Chris Hermansen ? mailto:chris.hermansen at timberline.ca > > tel+1.604.714.2878 ? fax+1.604.733.0631 ? mob+1.778.840.4625 > > Timberline Natural Resource Group ? http://www.timberline.ca > > 401 ? 958 West 8th Avenue ? Vancouver BC ? Canada ? V5Z 1E5 > > > > > > _______________________________________________ > > postgis-users mailing list > > postgis-users at postgis.refractions.net > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > ______________________________________________________________________ > Windows Live Hotmail: Your friends can get your Facebook updates, > right from Hotmail?. > _______________________________________________ > postgis-users mailing list > postgis-users at postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users -- Regards, Chris Hermansen ? mailto:chris.hermansen at timberline.ca tel+1.604.714.2878 ? fax+1.604.733.0631 ? mob+1.778.840.4625 Timberline Natural Resource Group ? http://www.timberline.ca 401 ? 958 West 8th Avenue ? Vancouver BC ? Canada ? V5Z 1E5 From ivan.mincik at gmail.com Tue Dec 29 15:31:08 2009 From: ivan.mincik at gmail.com (Ivan Mincik) Date: Wed, 30 Dec 2009 00:31:08 +0100 Subject: [postgis-users] GIST INDEX!! In-Reply-To: <1ed604b80912291505p6978b647qbb6f5ffcf55d235f@mail.gmail.com> References: <1262113659.1949.11.camel@temuko> <1ed604b80912291505p6978b647qbb6f5ffcf55d235f@mail.gmail.com> Message-ID: <1ed604b80912291531u4acfd24ei7c29dd55c5238d00@mail.gmail.com> One more advice. If Your tables for every area are the same, I will suggest You having same tables merged in to one. It is better for management and maybe You can also gain some performance. From ERandall at eriecountygov.org Wed Dec 30 05:28:12 2009 From: ERandall at eriecountygov.org (Randall, Eric) Date: Wed, 30 Dec 2009 08:28:12 -0500 Subject: [postgis-users] Jairo Sanchez wants to connect on LinkedIn In-Reply-To: <537772012.8601819.1262006857352.JavaMail.app@ech3-cdn11.prod> Message-ID: I'd rather be LinkedOff than LinkedOn, but I'd rather be LinkedOn than LinkedIn. -Eric -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of Jairo Sanchez Sent: Monday, December 28, 2009 8:28 AM To: Debasish Sahu Subject: [postgis-users] Jairo Sanchez wants to connect on LinkedIn LinkedIn Jairo Sanchez requested to add you as a connection on LinkedIn: Debasish, I'd like to add you to my professional network on LinkedIn. - Jairo Sanchez Accept View invitation from Jairo Sanchez DID YOU KNOW you can conduct a more credible and powerful reference check using LinkedIn? Enter the company name and years of employment or the prospective employee to find their colleagues that are also in your network. This provides you with a more balanced set of feedback to evaluate that new hire. ? 2009, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.gillet at market-ip.com Wed Dec 30 06:07:16 2009 From: nicolas.gillet at market-ip.com (Nicolas Gillet - MARKET-IP) Date: Wed, 30 Dec 2009 15:07:16 +0100 Subject: [postgis-users] linestring aggregation In-Reply-To: <9fe5a959-59ad-48ed-b060-0aea85609422@k9g2000vbl.googlegroups.com> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> <59771139-0cd3-4b6d-bec6-d7df318c3302@h2g2000vbd.googlegroups.com> <00eb01ca8895$1f24f1e0$5d6ed5a0$@gillet@market-ip.com> <9fe5a959-59ad-48ed-b060-0aea85609422@k9g2000vbl.googlegroups.com> Message-ID: <00af01ca8959$6465ac80$2d310580$@gillet@market-ip.com> Hello, Thanks for the tips I did not think about using my table twice. I search a bit around your suggested query SELECT r1.name, r1.code, geometry_sum(r1.the_geom) FROM road r1, road r2 WHERE ST_Touches(r1.the_geom, r2.the_geom) GROUP BY r1.name, r1.code Unfortunately I did not get what I want that way. It doesn't respect my touching condition. I made an small test on 16 piece of linestrings representing two parallel lines (of 8 pieces each) I named them A and B like this (all the items on the same line are connected) B1 B2 B3 B4 A5 A6 A7 A8 A1 A2 A3 A4 B5 B6 B7 B8 As a result I should have had 4 records (B1 B2 B3 B4) (A5 A6 A7 A8) (A1 A2 A3 A4) (B5 B6 B7 B8) But I actually got 2 records, all the "A" together and all the "B" together. (I put my test table at the end of this message if someone wants to give a try) Maybe there could be something special to do in the aggregate declaration to put a condition on the aggregation but I did not find anything like this :s Nicolas Test table CREATE TABLE road ( id integer NOT NULL, "name" character varying(50) NOT NULL, code integer NOT NULL, the_geom geometry NOT NULL, CONSTRAINT roads PRIMARY KEY (id) ) WITH ( OIDS=FALSE ); INSERT INTO road (id, name, code, the_geom) VALUES (1, 'Road 1', 1, ST_GeometryFromText('LINESTRING(0 0, 2 0, 4 0)', 4326)), (2, 'Road 1', 1, ST_GeometryFromText('LINESTRING(4 0, 6 0, 8 0)', 4326)), (3, 'Road 1', 1, ST_GeometryFromText('LINESTRING(8 0, 10 0, 12 0)', 4326)), (4, 'Road 1', 1, ST_GeometryFromText('LINESTRING(12 0, 14 0, 16 0)', 4326)), (5, 'Road 2', 1, ST_GeometryFromText('LINESTRING(16 0, 18 0, 20 0)', 4326)), (6, 'Road 2', 1, ST_GeometryFromText('LINESTRING(20 0, 22 0, 24 0)', 4326)), (7, 'Road 2', 1, ST_GeometryFromText('LINESTRING(24 0, 26 0, 28 0)', 4326)), (8, 'Road 2', 1, ST_GeometryFromText('LINESTRING(28 0, 30 0, 32 0)', 4326)), (9, 'Road 2', 1, ST_GeometryFromText('LINESTRING(0 1, 2 1, 4 1)', 4326)), (10, 'Road 2', 1, ST_GeometryFromText('LINESTRING(4 1, 6 1, 8 1)', 4326)), (11, 'Road 2', 1, ST_GeometryFromText('LINESTRING(8 1, 10 1, 12 1)', 4326)), (12, 'Road 2', 1, ST_GeometryFromText('LINESTRING(12 1, 14 1, 16 1)', 4326)), (13, 'Road 1', 1, ST_GeometryFromText('LINESTRING(16 1, 18 1, 20 1)', 4326)), (14, 'Road 1', 1, ST_GeometryFromText('LINESTRING(20 1, 22 1, 24 1)', 4326)), (15, 'Road 1', 1, ST_GeometryFromText('LINESTRING(24 1, 26 1, 28 1)', 4326)), (16, 'Road 1', 1, ST_GeometryFromText('LINESTRING(28 1, 30 1, 32 1)', 4326)); -----Message d'origine----- De?: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de Sean Envoy??: mardi 29 d?cembre 2009 17:21 ??: postgis-users at postgis.refractions.net Objet?: Re: [postgis-users] linestring aggregation I think you have to pull it out in the WHERE clause. I'm not sure if this will work, I'm not good at doing SQL in my head and can't test it right now: SELECT name, code, geometry_sum(r1.the_geom) FROM roads r1, roads r2 WHERE ST_Touches(r1.the_geom, r2.the_geom) GROUP BY name, code and you'll probably have to UNION this with a query that gets the pieces that don't touch. Sean From arnaud.listes at codata.eu Wed Dec 30 06:20:13 2009 From: arnaud.listes at codata.eu (Arnaud Lesauvage) Date: Wed, 30 Dec 2009 15:20:13 +0100 Subject: [postgis-users] linestring aggregation In-Reply-To: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> Message-ID: <4B3B619D.1000307@codata.eu> Le 29/12/2009 11:39, Nicolas Gillet - MARKET-IP a ?crit : > I am trying to aggregate linestrings together based on their attributes and > the fact that they are touching each other. > > Therefore I found out how to write a very basic aggregate function : > > CREATE AGGREGATE geometry_sum ( > SFUNC = st_union, > BASETYPE = geometry, > STYPE = geometry); Nicolas, what does your geometry_sum function do precisely ? There is a ST_Linemerge function that takes a collection of linestrings as an argument and merges them together into a multilinestring. Maybe it doesn't give you the result you expect ? With a table "thetable" having an "attrib" field and a "geom" field, I would write the query like this : SELECT attrib, (st_dump(merged_geom)).geom FROM ( SELECT attrib, ST_Linemerge(ST_Collect(geom)) AS merged_geom FROM thetable GROUP BY attrib ) AS subq; Does this solve your problem ? Regards, Arnaud From nicolas.gillet at market-ip.com Wed Dec 30 08:41:38 2009 From: nicolas.gillet at market-ip.com (Nicolas Gillet - MARKET-IP) Date: Wed, 30 Dec 2009 17:41:38 +0100 Subject: [postgis-users] [SOLVED]: linestring aggregation In-Reply-To: <4B3B619D.1000307@codata.eu> References: <00a501ca8873$3521bae0$9f6530a0$@gillet@market-ip.com> <4B3B619D.1000307@codata.eu> Message-ID: <00b001ca896e$f544b8d0$dfce2a70$@gillet@market-ip.com> Hello, Thank you very much this works fine. You taught me two major things I didn't know. First I had re-invented the wheel with my geometry_sum function with was plainly what st_collect did in a much faster way. Second, I had never use ST_linemerge which does a true merge of line strings, not simply making a multilinstring of them. I was afraid that adding all the lines and then split them would take a huge lot of time but actually it was very fast ! With your tips I have strongly improved my treatments. Thank you very much Nicolas. -----Message d'origine----- De?: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] De la part de Arnaud Lesauvage Envoy??: mercredi 30 d?cembre 2009 15:20 ??: postgis-users at postgis.refractions.net Objet?: Re: [postgis-users] linestring aggregation Le 29/12/2009 11:39, Nicolas Gillet - MARKET-IP a ?crit : > I am trying to aggregate linestrings together based on their attributes and > the fact that they are touching each other. > > Therefore I found out how to write a very basic aggregate function : > > CREATE AGGREGATE geometry_sum ( > SFUNC = st_union, > BASETYPE = geometry, > STYPE = geometry); Nicolas, what does your geometry_sum function do precisely ? There is a ST_Linemerge function that takes a collection of linestrings as an argument and merges them together into a multilinestring. Maybe it doesn't give you the result you expect ? With a table "thetable" having an "attrib" field and a "geom" field, I would write the query like this : SELECT attrib, (st_dump(merged_geom)).geom FROM ( SELECT attrib, ST_Linemerge(ST_Collect(geom)) AS merged_geom FROM thetable GROUP BY attrib ) AS subq; Does this solve your problem ? Regards, Arnaud _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users From ahmettemiz88 at gmail.com Wed Dec 30 23:55:32 2009 From: ahmettemiz88 at gmail.com (ahmet temiz) Date: Thu, 31 Dec 2009 09:55:32 +0200 Subject: [postgis-users] suitable projection Message-ID: <37ee0090912302355y37f8c925w171f2a08f6fa73ba@mail.gmail.com> hello Do I have to change my geographic projection (4326) for calculating area and length of some features. Which projection do I have to transform from geographic projection. Ahmet Temiz regards Happy New Year From lr at pcorp.us Thu Dec 31 01:25:19 2009 From: lr at pcorp.us (Paragon Corporation) Date: Thu, 31 Dec 2009 04:25:19 -0500 Subject: [postgis-users] suitable projection In-Reply-To: <37ee0090912302355y37f8c925w171f2a08f6fa73ba@mail.gmail.com> References: <37ee0090912302355y37f8c925w171f2a08f6fa73ba@mail.gmail.com> Message-ID: Ahmet, If you only care about distance, length and area measurement, you may want to try PostGIS 1.5 which has the new geography type specifically designed for this kind of thing. Help us stress test it now or you can wait a couple of weeks for it to be officially released. If you want to do lots of geometry processing then you'll probably want to stick with geometry, but you'll need to learn a bit about spatial ref systems. It really depends the specific geographic location of your data and what you plan to do with it which srid you should use. Anyrate check out our FAQ on geography http://www.postgis.org/documentation/manual-svn/ch03.html#id2836961 Hope that helps, Regina -----Original Message----- From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of ahmet temiz Sent: Thursday, December 31, 2009 2:56 AM To: postgis-users at postgis.refractions.net Subject: [postgis-users] suitable projection hello Do I have to change my geographic projection (4326) for calculating area and length of some features. Which projection do I have to transform from geographic projection. Ahmet Temiz regards Happy New Year _______________________________________________ postgis-users mailing list postgis-users at postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users