[Mapserver-users] SRS ogr2ogr - cs2cs - postgis
Jaime Mejía
jaime at maintask.com
Sat Jun 5 14:52:14 PDT 2004
This is a multi-part message in MIME format.
--------------000403060907070804090906
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hello.
I've simplified my problem, in order to get some help:
I have a shape file (attached) containing a single point (994097.623824
1003980.4918) in DATUM BOGOTA, called punto_prueba.shp.
When I try to transform it to WGS84 DATUM using ogr2ogr:
----------------------
ogr2ogr -s_srs EPSG:21892 -t_srs EPSG:4326 /home/jaime/resultado_wgs84
/home/jaime/punto_prueba.shp
----------------------
The point now have the following coordinates: -74.1341093150,4.6350408295
If I take the shape into postgis, and try to transform it, I get the
following:
----------------------
SELECT num_radicacion,the_geom,transform(the_geom,1) AS wgs84 FROM
expedientes WHERE num_radicacion=199931011;
num_radicacion | the_geom
| wgs84
----------------+------------------------------------------+--------------------------------------------------
199931011 | SRID=2;POINT(994097.623824 1003980.4918) |
SRID=1;POINT(-74.1306989066892 4.63219422246886)
----------------------
Finally, using cs2cs:
----------------------
jaime at fileserver[/maintask/clientes/creg]# cs2cs -v +proj=tmerc
+lat_0=4.599047222 +lon_0=-74.080916667 +k=1.000000 +x_0=1000000.000
+y_0=1tl +towgs84=307,304,-318,0,0,0,0 +to +proj=latlong +datum=WGS84
# ---- From Coordinate System ----
#Transverse Mercator
# Cyl, Sph&Ell
# +proj=tmerc +lat_0=4.599047222 +lon_0=-74.080916667 +k=1.000000
# +x_0=1000000.000 +y_0=1000000.000 +ellps=intl
# +towgs84=307,304,-318,0,0,0,0
#--- following specified but NOT used
# +ellps=clrk66
# ---- To Coordinate System ----
#Lat/long (Geodetic)
#
# +proj=latlong +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
994097.623824 1003980.4918
74d7'50.516"W 4d37'55.899"N 16.920
----------------------
74d7'50.516"W 4d37'55.899"N => -74.13069888888 4.63219416666
As you can see, the results are different (+/- 500 m):
With ogr2ogr: -74.1341093150,4.6350408295
With postgis: -74.1306989066892 4.63219422246886
With cs2cs:-74.13069888888 4.63219416666
So, I assume there is an error in the ogr2ogr command, or in ogr2ogr itself.
Somebody can help?
--------------000403060907070804090906
Content-Type: application/octet-stream;
name="punto_prueba.dbf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="punto_prueba.dbf"
A2gGBQEAAABhADgAAAAAAAAAAAAAAAAAAAAAAAAAAABQUk9HX0lEAAAAAE4AAAAABQAAAAAA
AAAAAAAAAAAAAExBQkVMAAAAAAAAQwAAAAAyAAAAAAAAAAAAAAAAAAAADSAgICAgMUNMIDcg
QSA3MC0xMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
--------------000403060907070804090906
Content-Type: application/octet-stream;
name="punto_prueba.shp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="punto_prueba.shp"
AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQOgDAAABAAAA/dtlP2NWLkGoNc37mKMuQf3b
ZT9jVi5BqDXN+5ijLkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAK
AQAAAP3bZT9jVi5BqDXN+5ijLkE=
--------------000403060907070804090906
Content-Type: application/octet-stream;
name="punto_prueba.shx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="punto_prueba.shx"
AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANugDAAABAAAA/dtlP2NWLkGoNc37mKMuQf3b
ZT9jVi5BqDXN+5ijLkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIAAAAK
--------------000403060907070804090906--
More information about the MapServer-users
mailing list