[postgis-users] Help loading box (polygon) data, value of GiST on squares and 180 meridian question
Wood Brent
pcreso at pcreso.com
Thu Apr 15 10:12:42 PDT 2004
> Within the POLYGON(....) definition you need to wrap an extra set of
> brackets around each ring of you polygon, plus as you noted you need to
> make the last point equal to the first point. So the following should
> work for you:
>
> insert into chat_cell (cell_id,depth,substrate,the_geom) values
> (1,0,0,GeometryFromText('POLYGON((173.0000 -45.4834, 173.0000 -45.4668,
> 173.0166 -45.4668, 173.0166 -45.4834, 173.0000 -45.4834))',4326));
Gotcha. Makes sense now :-)
> > in a proj area instead?) Will -170 equate to 190?
>
> No, I don't think this is the case. I'm guessing that while the
> distance/area functions will still work correctly, it would still be
> better to use -180 to 180 as I think this is the standard used by the
> reprojection libraries and all the maps I've seen (anyone feel free to
> correct me on this). Note that PostGIS also has a translate(x,y,z)
> function which can probably do this for you, so if you can't change your
> data at source you could do something like:
The issue is when displaying data, most GIS show -180 at the LHS of the map &
+180 at the RHS. So when displaying data around New Zealand, it is split across
the world. While Arc users, for example, kludge a Mercator northings/eastings
with offset to move the problem central meridian, I use GMT, in which -170 does
map onto 190, as GMT is effectively is mod360 on longitutes if required. All my
data is lat/long & while I could reproject everything, I'd sooner find a model
which fits the real world data than fit the data to an artificial model (if
that makes sense)
I'll need to see how QGIS works with this, hopefully it will wrap intelligently
and I can use +-180, but if it is like Arc, Mapinfo, etc, lat/long data is not
mapped spherically. Once I get the data into PostGIS I'll see how QGIS displays
it.
The Genamap GIS deals ptretty well, there is an environment variable, LONG, set
to true or false depending on whether you are using 0-360 or +-180.
Interestingly, they use true for 0-360 :-)
Thanks for your help, much appreciated.
>
> insert into chat_cell (cell_id,depth,substrate,the_geom) values
> (1,0,0,translate(GeometryFromText('POLYGON((173.0000 -45.4834, 173.0000
> -45.4668, 173.0166 -45.4668, 173.0166 -45.4834, 173.0000
> -45.4834))',4326), -180.0, 0.0, 0.0));
>
>
> Hope this helps,
>
> Mark.
>
> ---
>
> Mark Cave-Ayland
> Webbased Ltd.
> Tamar Science Park
> Derriford
> Plymouth
> PL6 8BX
> England
>
> Tel: +44 (0)1752 764445
> Fax: +44 (0)1752 764446
>
>
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender. You
> should not copy it or use it for any purpose nor disclose or distribute
> its contents to any other person.
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list