[Gdal-dev] Transforming shapefiles from euref89 to ed50

Jakob Simon-Gaarde/Trapsoft Inc Jakobs at trapezesoftware.com
Tue Apr 20 01:55:39 EDT 2004


Thanks - It helped move the coordinates into the right area, but there is
still something wrong - here is what I am doing:

>>> import osr
>>> f=open('euref89_32n.wkt')
>>> euref = f.read()
>>> euref=euref.replace('\n','')
>>> f.close()
>>> f=open('ed50_32n.wkt')
>>> ed50=f.read()
>>> ed50=ed50.replace('\n','')
>>> sr_euref = osr.SpatialReference()
>>> sr_euref.ImportFromESRI([euref])
0
>>> sr_ed50=osr.SpatialReference()
>>> sr_ed50.ImportFromESRI([ed50])
0
>>> t=osr.CoordinateTransformation(sr_euref,sr_ed50)
>>> t.TransformPoint(560728.35341,6079776.68768)
(560731.3203323764, 6079908.6868730783, 0.0)

should have been
(560728.35341 ; 6079776.68768) -> (560808.942 ; 6079982.529)

Any ideas??

By the way isn't there a collection of wkt-files somewhere that are
garanteed correct?

by the way the unnamed tool is ESRI MapObjects based.

Med venlig hilsen / Best regards
Jakob Simon-Gaarde

Trapeze Software Europe A/S
Tlf. 87 44 16 00


|---------+-------------------------------->
|         |           Frank Warmerdam      |
|         |           <warmerdam at pobox.com>|
|         |           Sent by:             |
|         |           gdal-dev-admin at remote|
|         |           sensing.org          |
|         |                                |
|         |                                |
|         |           19-04-2004 20:34     |
|         |           Please respond to    |
|         |           gdal-dev             |
|         |                                |
|---------+-------------------------------->
  >---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                             |
  |       To:       gdal-dev at remotesensing.org                                                                                                  |
  |       cc:                                                                                                                                   |
  |       Subject:  Re: [Gdal-dev] Transforming shapefiles from euref89 to ed50                                                                 |
  >---------------------------------------------------------------------------------------------------------------------------------------------|




Jakob Simon-Gaarde/Trapsoft Inc wrote:
> ogr2ogr -s_srs euref89_32n.wkt -t_srs ed50_32n.wkt out.shp stops_ll.shp
>
> where euref89_32n.wkt contains:
> PROJCS["ETRF_1989_UTM_Zone_32N",
>     GEOGCS["EUREF89_32N",
>         DATUM["ETRF_1989",
>             SPHEROID["WGS_1984",6378137.0,298.257223563]],
>         PRIMEM["Greenwich",9.0],
>         UNIT["Degree",0.0174532925199433]],

> and ed5089_32n.wkt contains:
> PROJCS["ED_1950_UTM_Zone_32N",
>     GEOGCS["GCS_European_1950",
>         DATUM["European_1950",
>             SPHEROID["International_1924",6378388,297]],
>         PRIMEM["Greenwich",0],
>         UNIT["Degree",0.0174532925199433]],
> What am I doing wrong - is it the wkt-files? I got those from two
> shapefiles with the projections I need.

Jacob,

I believe the problem is that you are indicating a prime meridian
of "Greenwich" at 9 degrees east of greenwich in the euref89 .wkt file.
I suspect the unnamed commerical software is ignoring the prime meridian
while OGR is trying to take it into account.

Best regards,
--
---------------------------------------+--------------------------------------

I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev








More information about the Gdal-dev mailing list