[postgis-users] Validating geomatries against a coordinate system

Mario T. de Sales mts at dhigroup.com
Fri Dec 17 04:09:47 PST 2010


Will have a look at it.



Thanks for the help Rob



Mario



>

>

> In our project using PostGIS we need to import some shape files into

> PostGIS. Some of these shape files have no corresponding .prj file and thus

> we ask the user to specify the coordinate system for the shape file.

>

>

>

> If the user specifies a wrong coordinate system, projecting data will not

> work correctly and PostGIS may throw errors.

>

>

>

> Is there an easy way to check whether the geometry coordinates are within a

> "valid" extent for the coordinate system?

>



EPSG has an area-of-use defined for most SRIDs to give the *general*

location of where they apply to. So you could project those "corners" into

the projection itself and use the resulting coordinates as soft limits.



However, you're still going to get plenty of errors or data appearing in the

wrong place. Might be better than nothing though :)



You can download the EPSG database from http://www.epsg.org/geodetic.html -

grab the postgresql version and get stuck in.



Rob :)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101217/b7b3ecd1/attachment.html>


More information about the postgis-users mailing list