[Gfoss] Problema conversione coordinate

chri chripell a gmail.com
Sab 1 Nov 2008 19:05:35 CET


On Sat, Nov 1, 2008 at 5:30 PM, chri <chripell a gmail.com> wrote:

> Probabilmente da buon neofita sto facendo qualche stupidata immane per
> questo vi chiedo qualche suggerimento in merito sul come procedere.
> Inoltre anche se c'è un modo diretto mi piacerebbe capire come
> impostare il WKT per la proiezione di cui sopra (anche un RTFM mi va
> bene).
>

Ho provato a salvare lo shapefile con le coordinate Gauss Boaga e
convertirlo con:

ogr2ogr -f "ESRI Shapefile" -s_srs "roma40.srs" -t_srs "EPSG:4326"
wgs84_shp IP000GM.shp

dove roma40.srs è

+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999600 +x_0=2520000 +y_0=0
+ellps=intl +units=m
+towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68

e tutto va alla grande. Non capisco perché il seguente frammento di codice:

import osgeo.osr
import osgeo.ogr
gb = osgeo.osr.SpatialReference()
gb.ImportFromEPSG(3004)
wgs84 = osgeo.osr.SpatialReference()
wgs84.ImportFromEPSG(4326)
tr = osgeo.osr.CoordinateTransformation(gb, wgs84)
tr.TransformPoint(2365622, 5118141, 0)

non è equivalente. Qualche suggerimento?

-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."


Maggiori informazioni sulla lista Gfoss