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

Suman Chatterjee schatterjee at addisontx.gov
Fri Jul 31 13:10:03 EDT 2009


Hi Alex,
Thank You very much for pointing out the mistake. But still I am facing
some problem. My GPS is collecting data in NAD1983 which I found
corresponds to SRID 4269. The extent of the Addison area is 
2445459.0713  7001896.9648  2514178.5480  7070616.4415
 It is in LCC NAD1983(ft) which I found to correspond with SRID 2276.
I am using the Transform function like below:
The coordinates with which I am testing are :lat 32.98 and long -96.83

Select ST_Transform(gpscoords,2276) from gpsdata;

But it is throwing error :
ERROR: transform: couldn't project point:-14 (latitude or longitude
exceeded)SQL state:XX000

Any idea how to proceed?
Thanks
Suman


-----Original Message-----
From: Alexander Petkov [mailto:greenkov at gmail.com] 
Sent: Friday, July 31, 2009 10:38 AM
To: Suman Chatterjee
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] How to enter the projected coordinates in
Postgis

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

*******************************************************************************************************************
This e-mail and any files or attachments transmitted with it contains Information that is confidential and privileged. This document may contain Protected Health Information (PHI) or other information that is intended only for the use of the individual(s) and entity(ies) to whom it is addressed. If you are the intended recipient, further disclosures are prohibited without proper authorization. If you are not the intended recipient, any disclosure, copying, printing, or use of this information is strictly prohibited and possibly a violation of federal or state law and regulations. If you have received this information in error, please delete it and notify Hamid Khaleghipour at 972-450-2868 immediately. Thank you.

*******************************************************************************************************************




More information about the mapserver-users mailing list