[postgis-users] Validating geomatries against a coordinate system

Robert Coup robert.coup at koordinates.com
Thu Dec 16 11:41:27 PST 2010


On Thu, Dec 16, 2010 at 9:32 PM, Mario T. de Sales <mts at dhigroup.com> wrote:

>
>
> 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 :)

-- 
Koordinates Ltd.
PO Box 1604, Shortland St, Auckland 1140, New Zealand
Phone +64-9-966 0433 Fax +64-9-969 0045
Web http://koordinates.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101217/aaffdfda/attachment.html>


More information about the postgis-users mailing list