Re: [postgis-users] Shape file importer. broken multipolygon

2010-08-18 Thread Nicolas Gillet - MARKET-IP
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark Cave-Ayland Sent: Wednesday, August 18, 2010 11:35 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Shape file importer. broken multipolygon Nicolas Gillet - MARKET-IP wrote: > Hello List, > > I used the PG

[postgis-users] Shape file importer. broken multipolygon

2010-08-17 Thread Nicolas Gillet - MARKET-IP
Hello List, I used the PGAdmin III plug-in to import shape files into my database but I'm facing a problem. The shape file I am importing contains multi-polygon but the resulting table after import contains only single polygon and some polygons are then lost. Only one polygon is imported for

Re: [postgis-users] How to change srid

2010-03-30 Thread Nicolas Gillet - MARKET-IP
Hello, Editing the geometry_column table is half part of the job. You have to update the geometries too. UPDATE table SET the_geom = ST_SetSRID(the_geom, 4326). Usually the SRID is -1 when you forget to set the srid when you import a shape file. Hope this helps. Nicolas.

Re: [postgis-users] shp2pgsql in quite mode????...(shp2pgsql -q)???

2010-03-29 Thread Nicolas Gillet - MARKET-IP
Hello, Indeed there is no “-q”. But are you sure that it actually is shp2pgsql that you want to quiet down ? (there are at most 15 lines) I think that what can annoy you is the output from the psql that usually is piped behind shp2pgsql. Psql do have a “-q” parameter. e.g. : shp2pgsql -W

Re: [postgis-users] Split a polygon to N linestrings (Solved)

2010-02-01 Thread Nicolas Gillet - MARKET-IP
ESTRING(4 4,4 0) LINESTRING(4 0,0 0) LINESTRING(1 1,1 2) LINESTRING(1 2,2 2) LINESTRING(2 2,2 1) LINESTRING(2 1,1 1) LINESTRING(5 5,5 6) LINESTRING(5 6,6 6) LINESTRING(6 6,6 5) LINESTRING(6 5,5 5) (12 rows) Cheers, Kevin On 1/29/2010 5:16 AM, Nicolas Gillet - MARKET-IP wrote: > Hello, &g

[postgis-users] Split a polygon to N linestrings

2010-01-29 Thread Nicolas Gillet - MARKET-IP
Hello, I am looking for some tips to split a polygon to its simplest linestrings. An example worth better than words : POLYGON((0 0, 0 1, 1 1, 1 0, 0 0)) Would become : MULTINLINESTRING((0 0, 0 1), (0 1, 1 1), (1 1, 1 0), (1 0, 0 0)) Every single linestring has to have two and only t

Re: [postgis-users] Finding if a polygons is fully covered by others [Solved]

2010-01-19 Thread Nicolas Gillet - MARKET-IP
Hello Thank you both for those inputs. I have finally decided to use a difference because in a second step the non-covered geometry interests me too. About my area solution, yes it worked because I am sure that my table contains only BBox and those are touching but never overlapping others. Tha

[postgis-users] Finding if a polygons is fully covered by others

2010-01-18 Thread Nicolas Gillet - MARKET-IP
Hello, I am looking for some help in optimizing a query. I have a table with bounding boxes and sometimes I need to find if a new given polygon can be fully covered by existing bounding boxes of my table. Right now I can find it out by summing the areas of intersections between my polyg

Re: [postgis-users] Huge query, out of memory

2010-01-15 Thread Nicolas Gillet - MARKET-IP
if I have solved it because I ran out of time a few months ago. But I attach the sql as a file with some descriptive texts. I intend to check it more properly and write some tutorial, but that will take some time before I can do. So, no guarantees :-) /Nicklas 2010-01-14 Nicolas Gillet - MARK

[postgis-users] Huge query, out of memory

2010-01-14 Thread Nicolas Gillet - MARKET-IP
Hello, I have a big shape file to process (about 300 Mo, 1.5 million records) I have to aggregate the touching linestrings having the same attributes therefore the best way I could find (with help of this mailing list) was to aggregate all the linestrings with the same attribute and then spli

[postgis-users] [SOLVED]: linestring aggregation

2009-12-30 Thread Nicolas Gillet - MARKET-IP
tgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] De la part de Arnaud Lesauvage Envoyé : mercredi 30 décembre 2009 15:20 À : postgis-users@postgis.refractions.net Objet : Re: [postgis-users] linestring aggregation Le 29/12/2009 11:39, Nicolas Gillet - M

Re: [postgis-users] linestring aggregation

2009-12-30 Thread Nicolas Gillet - MARKET-IP
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

Re: [postgis-users] linestring aggregation

2009-12-29 Thread Nicolas Gillet - MARKET-IP
tgis-users@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 toget

[postgis-users] linestring aggregation

2009-12-29 Thread Nicolas Gillet - MARKET-IP
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, BASE

Re: [postgis-users] shp2pgsql

2009-12-10 Thread Nicolas Gillet - MARKET-IP
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-boun...@postgis.refrac

Re: [postgis-users] New line in a notice.

2009-10-16 Thread Nicolas Gillet - MARKET-IP
___ From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Nicolas Gillet - MARKET-IP Sent: Thursday, October 15, 2009 3:31 AM To: postgis-users@postgis.refractions.net Subject: [postgis-users] New line in a notice. Hello I am

[postgis-users] New line in a notice.

2009-10-15 Thread Nicolas Gillet - MARKET-IP
Hello I am debugging a plpgsql script putting some RAISE NOTICE '.' in my code but in PG admin III in the "message Panel" all NOTICE messages are in one single line. It becomes impossible to read it . So I am looking for any tips helping me to display each NOTICE on a single line. I have

Re: [postgis-users] Update the geom of a table WHERE "i" is an even number

2009-10-13 Thread Nicolas Gillet - MARKET-IP
Hello Daniel, I am not very sure of your question but What about the modulo (%) operator ? - "WHERE i%10 = 0" This will keep only rows where the rest of division of i by 10 is 0. e.g. 15 % 10 = 5 KO (15 / 10 = 1 rest 5) 30 % 10 = 0 OK (30 / 10 = 3 rest 0) 23 % 10 = 2 KO (22 / 10 = 2 rest 3) ...

[postgis-users] Extract a part of a linestring

2009-09-29 Thread Nicolas Gillet - MARKET-IP
Hello, I am new in postgis environment and start to discover this powerful tool. I am facing problem with the data I have and need to transform them. I use a library to render maps based on "painter's algorithm". (We are especially focused on roads transportation elements). So to be mo