[postgis-users] ST_MakePolygon to represent a square
Aurélien ....
kinju59 at gmail.com
Mon Apr 19 02:41:59 PDT 2010
Thank you very much :) It's work well.
Thanks,
Aurélien
On Sun, Apr 18, 2010 at 10:23 PM, Paragon Corporation <lr at pcorp.us> wrote:
> Aurélien,
>
> Probably easier to use ST_MakeEnvelope to make a 4 sided polygon. Also
> remember x is long and y is lat
>
> http://www.postgis.org/documentation/manual-1.5/ST_MakeEnvelope.html
>
>
> INSERT INTO geo_countries (id, box)
> SELECT id, geography(ST_MakeEnvelope(min_longi, min_lati, max_longi,
> max_lati,4326))
> FROM countries;
>
>
> Leo and Regina,
> http://www.postgis.us
>
>
>
> ------------------------------
> *From:* postgis-users-bounces at postgis.refractions.net [mailto:
> postgis-users-bounces at postgis.refractions.net] *On Behalf Of *Aurélien
> ....
> *Sent:* Saturday, April 17, 2010 7:53 AM
> *To:* postgis-users at postgis.refractions.net
> *Subject:* [postgis-users] ST_MakePolygon to represent a square
>
> Hello everybody,
>
> I'm new on Postgis and I need help to create / fill a table.
>
> I have to make a column which represent a square (min_lati, min_longi,
> max_lati, max_longi). I've done this :
>
> CREATE TABLE geo_countries (
> id bigint PRIMARY KEY,
> box geography(POLYGON,4326));
>
> INSERT INTO geo_countries (id, box)
> SELECT id, ST_MakePolygon(??) FROM countries;
>
> Is the POLYGON type is correct to make this ?
>
> The "countries" table have the fields min/max lati/longi, but I don't know
> how to make a polygon with SQL command...
>
> Can you help me ?
>
> Thank you very much,
>
> Aurélien
>
>
> _______________________________________________
> 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: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100419/c4b49c7a/attachment.html>
More information about the postgis-users
mailing list