Re: [postgis-users] USGS NED Dataset

2010-08-18 Thread Paragon Corporation
Steve,

Yes it can.  You would use gdal2wkraster.py  packaged with WKT Raster to
load the data in.  You'll need working GDAL and Python  2.5 (I think 2.6
works as well now though haven't tried with 2.6). 

>From there you should be able to use the ST_Intersects functions to cross
join your geometries with the elevation data.


Pierre has a tutorial here covering some exercises with elevation data.

http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01

The last chapter of our book covers various exercises in loading different
types of raster data and working with geometry/raster together.
http://www.postgis.us/chapter_13

 We are in the middle of updating that since some things have been
added/simplified since we last updated it.

Thanks,
Leo and Regina
http://www.postgis.us


 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Wednesday, August 18, 2010 4:36 PM
To: PostGIS Users Discussion
Subject: [postgis-users] USGS NED Dataset

Hi all,

Any thoughts on loading and using the USGS NED data set with postgis?

My goal would be to take something like the Tiger Street data and augment
that with elevation data for the Z values.

Does the new raster support facilitate doing this?
Has anyone already done this or can someone describe the process?

Thanks,
   -Steve
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] side location conflict GEOS touches() threw an error

2010-08-18 Thread David Epstein
Hello,

I have a postGIS polygon layer with about 320,000 rows. I am trying to
return a table with object_number and the average area of the
surrounding (touching) polygons. I am getting this error:


NOTICE:  TopologyException: side location conflict 1.34593e+07 289017
ERROR:  GEOS touches() threw an error!

** Error **

ERROR: GEOS touches() threw an error!
SQL state: XX000


I have tried to simplify the geometry many different times. Nothing
seems to solve the problem. I can process the first 20,000 rows
(object_number < 2) but something is causing problems after that. I
have pasted the script below, any suggestions would be welcomed!

Thank you,
-david


SELECT p1.ogc_fid, avg(p2.shape_area)
FROM parcels09_d3_v2_simplify as p1, parcels09_d3_v2_simplify as p2
WHERE st_touches(p1.wkb_geometry, p2.wkb_geometry) 
GROUP BY p1.ogc_fid
ORDER BY p1.ogc_fid


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Problem cleaning invalid geometries

2010-08-18 Thread L Bogert-O'Brien
I have been setting up a PostGIS database with the boundary files 
from Census Canada.  There are a number of invalid geometries, either 
Self-intersection at or near point X, Y or Ring Self-intersection at 
or near point X, Y, especially for the year 2006. For most of the 
files, the cleangeometry() function as found at 
http://www.sogis1.so.ch/sogis/dl/postgis/cleanGeometry.sql
created by Duster Horst with suggestions by Kevin Neufeld 
(http://www.mail-archive.com/postgis-users@postgis.refractions.net/msg03531.html) 
cleans the invalid geometries up (although I haven't checked them for 
errors such as  those Kevin talked about).  However, for several 
geometries, the process runs for a very long time and the cpu use is 
listed as 100% from running top.   One process I even left running 
for 2 days before killing it.  Also, it seems that even after the 
cleaning of these geometries is successful, requests such as "SELECT 
* FROM table WHERE NOT ST_ISVALID(the_geom);" take a long time to 
complete and are listed as using 100% of the CPU while they run.


Can anyone shed any light on why this might be?

I was also interested in why some of the function calls in the 
cleangeometry() function do not have the "ST_" prefix in front of 
them.  Is there any difference between a call to boundary and 
st_boundary, for example, in Postgis 1.4 or 1.5.  I am running this 
on Ubuntu LINUX with PostgresPlus 8.4SS from EnterpriseDB, since I 
always set the path as PATH=/opt/PostgresPlus/8.4SS/bin. This is with 
Postgis 1.4, I believe, although it looks like someone else on the 
machine has also enabled postgis 1.5 in the synaptic package manager.


Thanks,

Loretta


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] make install fails with PostGIS 1.5.1 on PostgreSQL 9.0 Beta4

2010-08-18 Thread Lee Hughes

make install fails with

'/usr/local/pgsql/share/contrib/postgis-1.5'
make[1]: /usr/local/pgsql/share/contrib/postgis-1.5: Command not found

I see other similar posts in the archives, sounds like ver 1.5.2 will  
fix this. In the meantime, are there instructions for manually  
installing the compiled files? I tried the tips in sec 2.4.4 of the  
manual but am still missing components.


This is on CentOS 5.5.

Thanks for any help.

Lee
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] USGS NED Dataset

2010-08-18 Thread Stephen Woodbridge

Hi all,

Any thoughts on loading and using the USGS NED data set with postgis?

My goal would be to take something like the Tiger Street data and 
augment that with elevation data for the Z values.


Does the new raster support facilitate doing this?
Has anyone already done this or can someone describe the process?

Thanks,
  -Steve
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS requires

2010-08-18 Thread Mike Toews
On 18 August 2010 11:46, Paul Ramsey  wrote:
> If this isn't a ticket for qgis, it should be. They should be able to do 
> readonly access to tables and views that do not have unique keys, no excuses.

QGIS ticket #62 is four years old now: https://trac.osgeo.org/qgis/ticket/62

As mentioned earlier, you need to engineer a sequence in there
somewhere in a low-lying table that you can use in your view as your
surrogate primary key. It can be tricky, but there is always a way to
find it.

-Mike
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] QGIS requires

2010-08-18 Thread Andrea Peri
Using the plugin "RT SQL Layer" is possible to add to qgis a query sql .
It call directly posgres without use a memory provider, without save
temporary data on datafile and without creating temporary tables.
But again qgis need to have a field with unique integers.

I don't sure but perhaps to avoid this needed you can use the
"generate_series" to add a sequence number to your query sql.


-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS requires

2010-08-18 Thread Paul Ramsey
If this isn't a ticket for qgis, it should be. They should be able to do 
readonly access to tables and views that do not have unique keys, no excuses.

P.

On 2010-08-18, at 10:51 AM, William Furnass  wrote:

> Hi,
> 
> QGIS requires that all PostGIS tables/views have a numeric primary
> key.  As a result I have had to create many temporary tables solely
> for the purpose of viewing the results of queries when ideally I would
> have liked to create views from the majority of my queries.  Does
> anyone know if I can create on-the-fly a serial numeric column in
> queries/views to save me having to create so many temporary tables?
> It'd be grand if something like the following were possible:
> 
> CREATE VIEW my_view AS (SELECT numeric_id_generator(),
> St_Union(wkb_geometry) FROM my_subregions GROUP BY region_id);
> 
> Cheers,
> 
> Will
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS requires

2010-08-18 Thread Nicolas Ribot
On 18 August 2010 19:51, William Furnass  wrote:
> Hi,
>
> QGIS requires that all PostGIS tables/views have a numeric primary
> key.  As a result I have had to create many temporary tables solely
> for the purpose of viewing the results of queries when ideally I would
> have liked to create views from the majority of my queries.  Does
> anyone know if I can create on-the-fly a serial numeric column in
> queries/views to save me having to create so many temporary tables?
> It'd be grand if something like the following were possible:
>
> CREATE VIEW my_view AS (SELECT numeric_id_generator(),
> St_Union(wkb_geometry) FROM my_subregions GROUP BY region_id);
>
> Cheers,
>
> Will

Hi,

If you control the table creation, or if you can recreate them, you
can enable oids on the table: this hidden column stores a unique
identifier and qgis seems to use it to identify geometries. (oids are
disabled by default on recent postgresql versions, to avoid a
potential problem if the total number of records in the database
exceed the integer type limit (~4 billions. see:
http://www.postgresql.org/docs/8.4/static/ddl-system-columns.html).

Otherwise, a sequence will do the trick, as Aman ( fastly ;) ) noted.

Nicolas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS requires

2010-08-18 Thread Aman Verma
Hi,

Yes, there is a way to do this.

First, you have to create a 'sequence'. But you only have to do this once. It 
won't really matter if several different tables are using the same sequence in 
your situation.

create sequence sq; -- You only have to do this once. You could also make a 
temporary sequence. create temporary...

CREATE VIEW my_view AS (SELECT 
nextval('sq'), -- this is the function to access the next number from your 
sequence.
St_Union(wkb_geometry) FROM my_subregions GROUP BY region_id);

aman


-Original Message-
From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of William 
Furnass
Sent: August 18, 2010 1:52 PM
To: PostGIS Users Discussion
Subject: [postgis-users] QGIS requires

Hi,

QGIS requires that all PostGIS tables/views have a numeric primary
key.  As a result I have had to create many temporary tables solely
for the purpose of viewing the results of queries when ideally I would
have liked to create views from the majority of my queries.  Does
anyone know if I can create on-the-fly a serial numeric column in
queries/views to save me having to create so many temporary tables?
It'd be grand if something like the following were possible:

CREATE VIEW my_view AS (SELECT numeric_id_generator(),
St_Union(wkb_geometry) FROM my_subregions GROUP BY region_id);

Cheers,

Will
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Trunk version problem with st_dumppoint

2010-08-18 Thread Olivier Courtin


On Aug 18, 2010, at 7:31 PM, Andrea Peri wrote:

psql:query.txt:19: ERROR:  could not find function  
"LWGEOM_numpoints_linestring"

in file "/usr/local/pgsql/lib/postgis-2.0.so"



Look like your PostGIS spatial function definitions is not synchronize  
with the .so

Try to recreate a new postgis database, it should work

--
Olivier



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Calculate Bounding Box of a point type table

2010-08-18 Thread Nicolas Ribot
> My fear of ST_Extent was the Note: warning in the users guide that it
> replaced the geometry metadata? And that I would have to re-set the srid
> after performing the query.
>

Hi

It does not replace the metadata, it just returns a bouding box
object, that does not keep track of the SRID.
So if you want to use st_extent in conjunction with geometries of the
table, you would have to cast it to a polygone, and to set the srid on
this polygon:

select st_asewkt(st_extent(st_geomfromtext('LINESTRING (0 0, 1 1)',
4326))::geometry);

vs

select st_asewkt(st_setsrid(st_extent(st_geomfromtext('LINESTRING (0
0, 1 1)', 4326))::geometry, 4326));

(you can use find_srid() instead of a hard-coded value, if you don't
know the geometries' SRID)

Nicolas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] QGIS requires

2010-08-18 Thread William Furnass
Hi,

QGIS requires that all PostGIS tables/views have a numeric primary
key.  As a result I have had to create many temporary tables solely
for the purpose of viewing the results of queries when ideally I would
have liked to create views from the majority of my queries.  Does
anyone know if I can create on-the-fly a serial numeric column in
queries/views to save me having to create so many temporary tables?
It'd be grand if something like the following were possible:

CREATE VIEW my_view AS (SELECT numeric_id_generator(),
St_Union(wkb_geometry) FROM my_subregions GROUP BY region_id);

Cheers,

Will
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ¿obtain the bounding box from gr up of poligon?

2010-08-18 Thread Nicolas Ribot
On 18 August 2010 21:05, salas  wrote:
> Hi, i have the parcels table , and select various polygon
>
> ¿ how i can obtain the boundary of this group?
>
> best regards, salas
>

Hi,

Or using the st_extent aggregate function
(http://postgis.refractions.net/docs/reference.html), eventually with
the group by operator to isolate sets of polygons.

Performing a union on the geometries to extract the bouding box may
take a lot of time.

Nicolas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Trunk version problem with st_dumppoint

2010-08-18 Thread Andrea Peri
Hi,
I'm having problems with some test with trunk version.

I'm try-ing to test the 2.0.0 trunk version on a RedHat 64 bit with postgres
8.4.4.

The version of postgis is this:

POSTGIS="2.0.0SVN" GEOS="3.3.0-CAPI-1.7.0" PROJ="Rel. 4.7.1, 23 September
2009" LIBXML="2.6.26" USE_STATS (procs from 2.0 r5705 need upgrade)

Try-ing this query from a file "query.txt":

INSERT INTO public._test_campionamento_mp (id,idrtt,geom) (
select
c.id,
c.idrtt,
st_union(c.geom)
from (
select
a.id as id,
a.idrtt as idrtt,
(ST_DumpPoints(a.geom)).* as geom
from
public._test_campionamento as a
) as c
group by
c.id,
c.idrtt
);

I see this error:

psql:query.txt:19: ERROR:  could not find function
"LWGEOM_numpoints_linestring"
in file "/usr/local/pgsql/lib/postgis-2.0.so"
CONTEXT:  SQL statement "SELECT ST_NumPoints( $1 )"
PL/pgSQL function "_st_dumppoints" line 67 at istruzione SQL
PL/pgSQL function "_st_dumppoints" line 24 at ciclo FOR su righe di SELECT
SQL function "st_dumppoints" statement 1

This query work perfectly on postgres 8.4.4. + postgis 1.5.1 on WinXP so I
don't understand what is missing ...



-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Calculate Bounding Box of a point type table

2010-08-18 Thread Appel, Tony
My fear of ST_Extent was the Note: warning in the users guide that it replaced 
the geometry metadata? And that I would have to re-set the srid after 
performing the query.



Tony Appel



The information contained in this communication may be CONFIDENTIAL and is 
intended only for the use of the recipient(s) named above. If you are not the 
intended recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication, or any of its contents, is 
strictly prohibited. If you have received this communication in error, please 
notify the sender and delete/destroy the original message and any copy of it 
from your computer or paper files. 
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ¿obtain the bounding box from gr up of poligon?

2010-08-18 Thread William Furnass
On 18 August 2010 20:05, salas  wrote:
> Hi, i have the parcels table , and select various polygon
>
> ¿ how i can obtain the boundary of this group?

Try:

SELECT St_Envelope(St_Union(my_geometry_column)) FROM parcels;

Omit the 'St_Envelope(...)' bit if you want a multipolygon comprised
of all polygons rather than a bounding box.

Will
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] ¿obtain the bounding box from gr up of poligon?

2010-08-18 Thread salas
Hi, i have the parcels table , and select various polygon 

¿ how i can obtain the boundary of this group?

best regards, salas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Calculate Bounding Box of a point type table

2010-08-18 Thread Daryl Herzmann
On Wed, Aug 18, 2010 at 10:24 AM, Appel, Tony  wrote:
> I find out what the bounding box is for a table that contains point geometry.
>
> Newb alert: I have read about box2b, st_extent, st_envelope but none of those 
> seem to be exactly what I need.
>
> Thanks in advance.

Hello,

Could you elaborate on why ST_Extent is not providing what you need?
For me, it works how I want :)

 select ST_Extent(geom) from lsrs_2010;
  st_extent
--
 BOX(-168.08 1.32,-64.7 70.6)
(1 row)

daryl
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Calculate Bounding Box of a point type table

2010-08-18 Thread Appel, Tony
I find out what the bounding box is for a table that contains point geometry.

Newb alert: I have read about box2b, st_extent, st_envelope but none of those 
seem to be exactly what I need.

Thanks in advance.


-Original Message-
From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of 
postgis-users-requ...@postgis.refractions.net
Sent: Thursday, August 12, 2010 2:00 PM
To: postgis-users@postgis.refractions.net
Subject: postgis-users Digest, Vol 100, Issue 10

Send postgis-users mailing list submissions to
postgis-users@postgis.refractions.net

To subscribe or unsubscribe via the World Wide Web, visit
http://postgis.refractions.net/mailman/listinfo/postgis-users
or, via email, send a message with subject or body 'help' to
postgis-users-requ...@postgis.refractions.net

You can reach the person managing the list at
postgis-users-ow...@postgis.refractions.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of postgis-users digest..."


Today's Topics:

   1. st_transform, irreversible? (Erik Rehn)
   2. Re: st_transform, irreversible? (Paul Ramsey)
   3. Re: st_transform, irreversible? (Paul Ramsey)
   4. making polygons from center + vertex (Arnaud Sahuguet)
   5. Re: making polygons from center + vertex (Francis Markham)
   6. Re: making polygons from center + vertex (Arnaud Sahuguet)
   7. Re: st_transform, irreversible? (Barend K?bben)
   8. Re: st_transform, irreversible? (Mike Toews)
   9. Re: st_transform, irreversible? (Ricardo Bayley)
  10. Turn restrictions and directions of road on postgis   pgrouting
  table. (FRANK RADA)
  11. Detecting wrong geometries (Andrea Peri)
  12. Re: Detecting wrong geometries (Nicolas Ribot)
  13. Re: Detecting wrong geometries (Andrea Peri)
  14. Convert already loaded table into a spatial table (points)
  (Appel, Tony)
  15. Detecting wrong geometries (Andrea Peri)
  16. Re: Convert already loaded table into a spatial table
  (points) (Fabio Renzo Panettieri)
  17. Re: Convert already loaded table into a spatial table
  (points) (Fabio Renzo Panettieri)
  18. Convert already loaded table into a spatial table (points)
  (Andrea Peri)
  19. Re: Convert already loaded table into a spatial   table
  (points) (Fred Lehodey)
  20. Re: Convert already loaded table into a spatial   table
  (points) (Paul Ramsey)


--

Message: 1
Date: Wed, 11 Aug 2010 22:10:14 +0200
From: Erik Rehn 
Subject: [postgis-users] st_transform, irreversible?
To: postgis-users@postgis.refractions.net
Message-ID: <4c6303a6.3010...@slagkryssaren.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello Postgis Users!

This is my first post on this list so I will start by asking
a simple (and probably stupid) question. :)

While using ST_AsKml() to produce an overlay for Google Earth I
noticed that all my geometries where shifted slightly south-east.
I figured this had something to do with the transformation between
the projection that my geometries are stored in (SRID 3021) and WGS84
(4326) that is outputted by ST_AsKml()

Just to test I ran this:

SELECT ST_AsText(
 ST_Transform(
 ST_Transform(
 ST_GeomFromText('POINT(59 18)',4326),
 3021),
 4326));

I input a point in WGS84 (59,18), transforms it to 3021 and then back to
WGS84. The result I get is:
POINT(58.8672757036296 18.0394763349359)

Can anyone explain this? Am I missing something regarding ST_Transform()?

Im running Postgis 1.5 on Windows.

Thank you for any help!
/Erik

--
Erik Rehn
Slagkryssaren
e...@slagkryssaren.com
www.slagkryssaren.com


--

Message: 2
Date: Wed, 11 Aug 2010 13:35:46 -0700
From: Paul Ramsey 
Subject: Re: [postgis-users] st_transform, irreversible?
To: e...@slagkryssaren.com, PostGIS Users Discussion

Cc: meta...@lists.osgeo.org
Message-ID:

Content-Type: text/plain; charset=ISO-8859-1

Seems to be an underlying problem with proj4:

echo "59 21" | proj "+init=epsg:3021" | invproj "+init=epsg:3021"

58d49'47.733"E  21d2'54.745"N

And that's without doing the datum shift part.

P

On Wed, Aug 11, 2010 at 1:10 PM, Erik Rehn  wrote:
> Hello Postgis Users!
>
> This is my first post on this list so I will start by asking
> a simple (and probably stupid) question. :)
>
> While using ST_AsKml() to produce an overlay for Google Earth I
> noticed that all my geometries where shifted slightly south-east.
> I figured this had something to do with the transformation between
> the projection that my geometries are stored in (SRID 3021) and WGS84 (4326)
> that is outputted by ST_AsKml()
>
> Just to test I ran this:
>
> SELECT ST_AsText(
> ? ?ST_Transform(
> ? ? ? ?ST_Transform(
> ? ? ? ? ? ?ST_GeomFromText('POINT(59 18)',4326),
> ? ? ? ?3021),
> ? ?4326));
>
> I input a point in WGS84 (59,18), tra

Re: [postgis-users] GEOS pointonsurface() threw an error!

2010-08-18 Thread Ricardo Bayley
I hope to be testing it next week

On Wed, Aug 18, 2010 at 4:41 AM, Paragon Corporation  wrote:

> BTW -  If any windows users want to try the trunk version (PostGIS 2.0) --
> we have experimental binaries (fairly recent as of last week)
>
> Here
> http://www.postgis.org/download/windows/experimental.php
>
> Which includes lots more functions such as ST_MakeValid and ST_Split.  As
> welll as Polyhedral Surface support and Raster support.
>
> The PostGIS Team is always very excited to squash bugs early.  So please
> let
> us know if you find problems or have trouble using the binaries.
>
>
> Thanks,
> Regina and Leo
> http://www.postgis.us
>
>
>
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Andrea
> Peri 2007
> Sent: Wednesday, August 18, 2010 1:56 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] GEOS pointonsurface() threw an error!
>
> >My version is: "POSTGIS="1.5.0" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel.
> >4.6.1, 21 August 2008" LIBXML="2.7.6" USE_STATS"
> >PostgreSQL 8.4 running on a WINXP
> >
> >I was playing with the ST_IsValid() function and the ST_IsValidReason().
> >
> >What I notice is the geometry, of course, is not valid.
> >Reason: "Self-intersection[-6.4825e+006 -3.15411e+006]"
>
>
> With the trunk version there (postgis 2.0.0) you can try the
> ST_MakeValid(..)
>
> that turn the self-intersction in multi-polygon.
>
> Regards,
>
> Andrea.
>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2010-08-18 Thread Nicolas Gillet - MARKET-IP
Hello Mark,

I made a mistake in my previous mail.
The postgis version I used was 1.4.1. I was confused with the postigis I
installed a month ago in another computer.
I downloaded the windows package one click installer and then use the stack
builder to install the postgis extension.

As you said that it was fixed, I upgraded my server and extensions with the
new version of the windows installer.

Now everything works fine and GUI importer behaves perfectly.

Thank you , you put me on the right way.

Best regards.

Nicolas.

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark
Cave-Ayland
Sent: Wednesday, August 18, 2010 11:36 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Shape file importer. broken multipolygon


Hi Nicolas,

It looks as if this bug has already been fixed in r5195, and hence 
should be included from PostGIS 1.5.0 onwards. Where did you get your 
PostGIS binaries from?


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@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[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 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 every multi-polygon in the file.
>  
> If I use the shp2pqsql command line tool (instead of GUI), I have the 
> right result. My multi-polygons are as they're supposed to be.
> 
> So I think that the import plug-in is somehow configured to use 
> something like the "-S" forced switch of the shp2pqsql tool but I don't 
> find such option in the plug-in's options.
> 
> I use a PosgreSql 8.4, Postgis 1.5 with PgAdmin III.
> 
> The import plugin version is : shp2pgsql-gui $Revision: 5094 $.
> 
> Any idea of what's wrong ?
> 
> Thanks for any input.
> 
> Nicolas

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] which geometry type ?

2010-08-18 Thread Maxime van Noppen
On 08/18/2010 02:51 PM, Mauricio Miranda wrote:
> 1) Create the geometry_column as generic type "GEOMETRY". It will allow you 
> to store any kind of geom.

Related question: is it possible to create a geometry index on such a
column ?

-- 
Maxime
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] which geometry type ?

2010-08-18 Thread Nicolas Ribot
On 18 August 2010 14:39, Armand Turpel  wrote:
> Hi,
> Which is the best strategy for storing geometries items if the type of
> geometries could be a point, line or polygon. Geometrycollection ? or
> storing items in different tables/columns with specific geometry type? What
> about storing everything as polygons? A point could be stored as a very
> small polygon.
>
>

Hi
I would say it really depends on what you are doing with these objects.
If you store all objects in the same column, with a generic 'geometry'
type and no check constraint on the column, then you won't be able to
use most of the postgis functions on these objects, as many functions
deal only with a geometry subtype (polygons, multi*, point, etc).
Same apply if you want to render this column, for instance with
mapserver, as you won't be able to tell MS how to render this
composite objects.

One column per geo type seems the be the "cleanest" way to store
objects to be able to manipulate them fully.

Nicolas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] which geometry type ?

2010-08-18 Thread Mauricio Miranda
On Aug 18, 2010, at 09:39 AM, Armand Turpel wrote:

> Hi,
> Which is the best strategy for storing geometries items if the type of 
> geometries could be a point, line or polygon. Geometrycollection ? or storing 
> items in different tables/columns with specific geometry type? What about 
> storing everything as polygons? A point could be stored as a very small 
> polygon.
> 

Hi Armand,

You have many options:

1) Create the geometry_column as generic type "GEOMETRY". It will allow you to 
store any kind of geom.
2) Create multiple fields in the same table (as you said).
3) Create multiple tables, one for each type.
4) Create one main table with the common fields and use inheritance to create a 
child table for each type.

Good luck!

--
Mauricio Miranda
Chief Development Officer
http://www.xoomcode.com

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] which geometry type ?

2010-08-18 Thread Armand Turpel

Hi,
Which is the best strategy for storing geometries items if the type of 
geometries could be a point, line or polygon. Geometrycollection ? or 
storing items in different tables/columns with specific geometry type? 
What about storing everything as polygons? A point could be stored as a 
very small polygon.


#
Scanned by MailMarshal - Marshal's comprehensive email content security solution. 
#

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2010-08-18 Thread Mark Cave-Ayland

Nicolas Gillet - MARKET-IP wrote:


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 every multi-polygon in the file.
 
If I use the shp2pqsql command line tool (instead of GUI), I have the 
right result. My multi-polygons are as they’re supposed to be.


So I think that the import plug-in is somehow configured to use 
something like the “-S” forced switch of the shp2pqsql tool but I don’t 
find such option in the plug-in’s options.


I use a PosgreSql 8.4, Postgis 1.5 with PgAdmin III.

The import plugin version is : shp2pgsql-gui $Revision: 5094 $.

Any idea of what’s wrong ?

Thanks for any input.

Nicolas


Hi Nicolas,

It looks as if this bug has already been fixed in r5195, and hence 
should be included from PostGIS 1.5.0 onwards. Where did you get your 
PostGIS binaries from?



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@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] help setting up postgis

2010-08-18 Thread Nicolas Ribot
On 17 August 2010 17:11, Jan Saalbach  wrote:
> Nicolas, thank you for your help. I have imported a set of points using a
> python to psql script which filled a GeometryColumn using the ST_MakePoint()
> function.
>
> Now I would like to visualize the points using uDig. Since the set imported
> is comprised of around 10 million points, drawing each point is not
> possible. What I would like to do is create and just draw a bounding box of
> the set of points. This way I could compare it to another set of points in
> respect of the position to each other.
>
> The thing I do not know yet is how to do it using postgis , i.e. which
> commands I need. Any tips on how I could go about visualizing two datasets
> of scattered points?
>
> Regards,
> Jan
>

Hi

There were some threads about displaying such points set.

Concerning the first question, you can use the table function
st_extent(), that returns the bounding box of a set of rows.
You could also use st_convexHull, to create a geometry representing
the convex hull of your point set, which will give you a more precise
picture of the pointset span. But it will take more time to compute.

Nicolas
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] GEOS pointonsurface() threw an error!

2010-08-18 Thread Paragon Corporation
BTW -  If any windows users want to try the trunk version (PostGIS 2.0) --
we have experimental binaries (fairly recent as of last week) 

Here
http://www.postgis.org/download/windows/experimental.php

Which includes lots more functions such as ST_MakeValid and ST_Split.  As
welll as Polyhedral Surface support and Raster support.

The PostGIS Team is always very excited to squash bugs early.  So please let
us know if you find problems or have trouble using the binaries.


Thanks,
Regina and Leo
http://www.postgis.us

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Andrea
Peri 2007
Sent: Wednesday, August 18, 2010 1:56 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] GEOS pointonsurface() threw an error!

>My version is: "POSTGIS="1.5.0" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 
>4.6.1, 21 August 2008" LIBXML="2.7.6" USE_STATS"
>PostgreSQL 8.4 running on a WINXP
>
>I was playing with the ST_IsValid() function and the ST_IsValidReason().
>
>What I notice is the geometry, of course, is not valid.
>Reason: "Self-intersection[-6.4825e+006 -3.15411e+006]"


With the trunk version there (postgis 2.0.0) you can try the
ST_MakeValid(..)

that turn the self-intersction in multi-polygon.

Regards,

Andrea.


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users