Hello, First,

First Last wrote:
> i'm just wondering, what happens to the coordinate values of a
> shapefile that is imported into postgresql-postgis? my shapefile is a
> world map in raw (geographic). so assuming its extent is 180E,90S -
> 180W,90N, does it become -180,-90 - 180, 90 when imported or 0,0 -
> 360, 180?

No, the ordinates will be imported 1:1. However, you should pass a
suitable SRID to shp2pgsql so the data can be interpreted in the correct
coordinate reference system.

> also, i'm getting the polygon intersection  of the world map and a
> user-defined extent (minx,miny - maxx, maxy) but sometimes i get an
> error like "invalid use of geometry collection". it works on some
> occasions though. any idea?

Hmm, could you send us the query or a small test case where the error
happens?

HTH,
Markus

>>
Perhaps I should give you the URL to my test page http://202.123.56.182/exer_v2.php

The application extracts from the database the objects that fall within the user-specified boundary. The resulting table will be converted to a shapefile and archived in a zip file. The database, by the way, was created by importing various shapefiles.

Before you use start using it, I must warn you that no error trapping has been set yet such that proper values must be fed into it for the mean time. You could enter invalid values for the coordinates of the bounding polygon and the page will not detect it and will try to process it.

1. Select 'polbndry' from the Layer dropdown. polbndry'
The page will not work on the other values because the column names of polbndry are currently hardcoded to the sql statement. I wanted to make an sql statement that will work on all the layers but a statment like "SELECT *, intersection(a.the_geom, b.the_geom)..." will raise an error due to a resulting duplicate name (i.e, the_geom). I'm still looking for a workaround on this.

2. For Xmin, Xmax, Ymin, and Ymax, enter 115, 125, 5, and 20, respectively. Click Process.
This will output work without error and provide a zip output.

3. Open a fresh page (sorry no reload script yet) then set the ff. values this time:
    Layer: polbndry
    Xmin:25  Xmax:50
    Ymin:5   Ymax:20
This time it will report an error - "type 'GEOMETRYCOLLECTION' is not Supported at this time." At first I thought the error is brought about by cookie cutting into an empty space, but it doesn't always seem to be the case when I tried plotting the coordinates of bounding polygons that returned errors. The other possibility is that a mixed geometry was created. But I wonder how could that be when all the inputs are of type polygon. Unfortunately there is no way for me to display graphically the resulting table.

By the way, i'll be very grateful if someone can provide ideas and suggestions on how to improve this kind of service that I'm trying to develop.

p.s.
I have this feeling that I'm not posting my reply the right way. I just copied the section that pertains to my thread, hit the reply button, pasted the content of the clipboard, then made my reply. If this is not the right way, just let me know.

 









_____________________________________________________________
Check out Atenista.Net (www.atenista.net)- new design, regular content and additional services!

