[mapserver-users] How to enter the projected coordinates in Postgis

Alexander Petkov greenkov at gmail.com
Fri Jul 31 11:37:52 EDT 2009


On Thu, Jul 30, 2009 at 8:57 AM, Suman
Chatterjee<schatterjee at addisontx.gov> wrote:
> Hi,
>
> I have created 2 tables in postGIS and POSTGreSQL  – in one, I am storing
> the GPS coordinates which are in the form of say lat= 32.4 and longitude =
> 72.45 ( which are in degrees) with SRID 2276
>
> And in another I am capturing the user defined points from a projected map
> in mapserver. So here the points are having the projected coordinates like
> 2479589   7037631.  The projection of the map has epsg=2276


One of your SRID codes will need to be corrected (I suspect the 1st
one). You are using coordinates in degrees, and some other units for
thesame SRID?

>
> Now I want to find the distance between the GPS points and the user defined
> point. For that I require the projected coordinates for both.
>
> So how can I store the projected coordinates of the GPS points in the table?
> Is there any function for that?

Once you get your coordinates in the same projection (you can use the
postgis transform function), you can use the postgis distance
function. And you wouldn't need to necessarily store the coordinates
captured from the user, just build a point geometry from the numbers.


Alex


More information about the mapserver-users mailing list