<br><br><div class="gmail_quote">On Thu, Dec 16, 2010 at 9:32 PM, Mario T. de Sales <span dir="ltr"><<a href="mailto:mts@dhigroup.com">mts@dhigroup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"> </p><p class="MsoNormal">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. </p>
<p class="MsoNormal"> </p><p class="MsoNormal">If the user specifies a wrong coordinate system, projecting data will not work correctly and PostGIS may throw errors.</p><p class="MsoNormal"> </p><p class="MsoNormal">Is there an easy way to check whether the geometry coordinates are within a “valid” extent for the coordinate system?</p>
</div></div></blockquote><div><br></div><div>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. </div>
<div><br></div><div>However, you're still going to get plenty of errors or data appearing in the wrong place. Might be better than nothing though :)</div><div><br></div><div>You can download the EPSG database from <a href="http://www.epsg.org/geodetic.html">http://www.epsg.org/geodetic.html</a> - grab the postgresql version and get stuck in.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Rob :)</div><div><br></div></div>-- <br>Koordinates Ltd.<br>PO Box 1604, Shortland St, Auckland 1140, New Zealand<br>
Phone +64-9-966 0433 Fax +64-9-969 0045<br>Web <a href="http://koordinates.com/">http://koordinates.com/</a><br>