[postgis-users] How do you obtaining a WGS-84 (4326) coordinate from a coordinate that has no SRID

0 views
Skip to first unread message

ILAN BENISTY

unread,
Aug 19, 2009, 3:11:18 PM8/19/09
to postgi...@postgis.refractions.net
Hi,

I am dealing with a problem where I am importing an AutoCAD description of an airport (DXF) into PostGIS.
I have a Python script which will import each coordinate to a PostGIS geometry with SRID = -1 (since I do not have real world coordinates, but Cartesian coordinates from a point of origin).
I do, however, have a lat/long reference point, which represents the origin of my x/y CAD coordinates.
I would like to be able to store my CAD coordinates points as Long/Lat (SRID=4326).
Any suggestions?

Thanks,

Ilan

David Fawcett

unread,
Aug 19, 2009, 4:06:18 PM8/19/09
to PostGIS Users Discussion
To me, the math in a geographic project is too complicated.

I would think about projecting your corner point to a local UTM
projection and then using the local coordinate values to calculate UTM
values for each point.

You could then transform your data back to geographic.

David.

> _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Eric B. Powell

unread,
Aug 19, 2009, 5:53:42 PM8/19/09
to PostGIS Users Discussion
> ------------------------------------------------------------------------

>
> _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
What country is the site in? What units are used for the drawings grid?
Do you know the geographic datum?

It may require a fair amount of pre-processign before the data can be
accurately (de)projected to LatLong.

Once the details of the drawing grid are known, there is a python
wrapper for Proj4 which could be used to (de)project the points on the
way into the database.

Eric

Rick

unread,
Aug 19, 2009, 9:21:25 PM8/19/09
to PostGIS Users Discussion
On Wed, Aug 19, 2009 at 5:53 PM, Eric B. Powell <ebpowe...@gmail.com> wrote:
ILAN BENISTY wrote:
Hi,

I am dealing with a problem where I am importing an AutoCAD description of an airport (DXF) into PostGIS.
I have a Python script which will import each coordinate to a PostGIS geometry with SRID = -1 (since I do not have real world coordinates, but Cartesian coordinates from a point of origin).
I do, however, have a lat/long reference point, which represents the origin of my x/y CAD coordinates.
I would like to be able to store my CAD coordinates points as Long/Lat (SRID=4326).
Any suggestions?

Thanks,

Ilan
------------------------------------------------------------------------


_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
 

I'll answer for Ilan, we work together

What country is the site in? What units are used for the drawings grid? Do you know the geographic datum?
 
Country: Canada, Units: meters, Datum: WGS84

I expect the solution is straightforward, but it is not obvious to us.


It may require a fair amount of pre-processign before the data can be accurately (de)projected to LatLong.

Once the details of the drawing grid are known, there is a python wrapper for Proj4 which could be used to (de)project the points on the way into the database.

We are very experienced programmers, but have a limited knowledge of SQL.  We've been working with it for a few years, but at this point have been able to get by quite nicely with the basics.

We have a fair knowledge of Geodesy.  It was my major, 20 years ago.

--
I'll give you the use case:

Currently we have a geometric database using PostgreSQL geometry types to represent aerodromes.  The origin of the grid is the centroid of the aerodrome, and that we have a Geodetic position for.  We use it, amoung other things, to plot radar targets.  The radar data arrives on the same grid, so up to this point our data registers, we display the live radar data as SVG in any browser that is not IE with one second updates.  This works well.

However, for many reasons, we have to go to a geodetic system.  We'll still use the same metric grid with an origin at the centroid for radar data, but to integrate with other systems we must maintain a geodetic database.

The aerodrome data arrives as DXF.  We have written an import filter in Python that parses in the DXF and converts it to Postgresql geometry.  It also maps the layer names to a standard.  Ilan, the author of this thread, is tasked with converting this to PostGIS so that we may merge with other systems that maintain geometry in WGS84.

The general coverage of the data is three or four kilometers.  Surface radar data arrives at a resolution of one meter, so if our accuracy is within 10cm we are more than good.  We assume a reasonably accurate centroid position and a Cartesian plane that does not extend more than 3 kilometers in any direction from the origin, so curvature error is not an issue.

--
The problem:

We have a metric cartesian data set.

We have a geodetic coordinate for the centroid of the aerodrome, which is the origin of our metric Cartesian data.

We need to convert this to geodetic to exchange data with other components of the air navigation system.

--
It seems to me that the solution might be to have PostGIS give us a coordinate for the centroid, transform the DXF coordinates during the parse operation, and then import it into PostGIS.

We don't know how to properly do that, and it's quite possible that that is not the ideal solution.

As I said, we are new to PostGIS, but we are keen to play.

 


Eric

_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



--
Cheers!
Rick

Eric B. Powell

unread,
Aug 19, 2009, 10:27:53 PM8/19/09
to PostGIS Users Discussion
Rick wrote:
>
>
> On Wed, Aug 19, 2009 at 5:53 PM, Eric B. Powell
> <ebpowe...@gmail.com <mailto:ebpowe...@gmail.com>> wrote:
>
> ILAN BENISTY wrote:
>
> Hi,
>
> I am dealing with a problem where I am importing an AutoCAD
> description of an airport (DXF) into PostGIS.
> I have a Python script which will import each coordinate to a
> PostGIS geometry with SRID = -1 (since I do not have real
> world coordinates, but Cartesian coordinates from a point of
> origin).
> I do, however, have a lat/long reference point, which
> represents the origin of my x/y CAD coordinates.
> I would like to be able to store my CAD coordinates points as
> Long/Lat (SRID=4326).
> Any suggestions?
>
> Thanks,
>
> Ilan
> ------------------------------------------------------------------------
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> <mailto:postgi...@postgis.refractions.net>
> <mailto:postgi...@postgis.refractions.net>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
I was thinking that, if you know the actual location of your points in a
projected coordinate system, (de)projecting them to LatLong on the way
into PostGIS could be done using the pyProj library which wraps Proj4 in
a python wrapper. As such, as the points are read in, re-project them
and write them in using st_geometryfromtext().

I have an example of this approach I can send if you like.

Regards,

Rick

unread,
Aug 19, 2009, 10:33:11 PM8/19/09
to PostGIS Users Discussion


On Wed, Aug 19, 2009 at 10:27 PM, Eric B. Powell <ebpowe...@gmail.com> wrote:
 
I was thinking that, if you know the actual location of your points in a projected coordinate system, (de)projecting them to LatLong on the way into PostGIS could be done using the pyProj library which wraps Proj4 in a python wrapper. As such, as the points are read in, re-project them and write them in using st_geometryfromtext().

I have an example of this approach I can send if you like.

Regards,


Eric


Yes please!

--
Cheers!
Rick

Reply all
Reply to author
Forward
0 new messages