[Gfoss] prj2epsg

Penso che già conoscevate

http://prj2epsg.org/search

non sempre infallibile....ma a volte e a qualcuno potrebbe essere
utile...:slight_smile:

--
View this message in context: http://gfoss-geographic-free-and-open-source-software-italian-mailing.3056002.n2.nabble.com/prj2epsg-tp6246112p6246112.html
Sent from the Gfoss -- Geographic Free and Open Source Software - Italian mailing list mailing list archive at Nabble.com.

Penso che già conoscevate

http://prj2epsg.org/search

non sempre infallibile....ma a volte e a qualcuno potrebbe essere
utile...:slight_smile:

Usando GDAL (testato sulla 1.8) e senza usare un servizio on line.
Crea il file esriprj2standards ed inserisci le seguenti linee:

import sys
from osgeo import osr

def esriprj2standards(shapeprj_path):
    prj_file = open(shapeprj_path, 'r')
    prj_txt = prj_file.read()
    srs = osr.SpatialReference()
    srs.ImportFromESRI([prj_txt])
    print 'Shape prj is: %s' % prj_txt
    print 'WKT is: %s' % srs.ExportToWkt()
    print 'Proj4 is: %s' % srs.ExportToProj4()
    srs.AutoIdentifyEPSG()
    print 'EPSG is: %s' % srs.GetAuthorityCode(None)

esriprj2standards(sys.argv[1])

a questo punto puoi eseguire il programmino, dandogli in pasto un prj:

$ python esriprj2standards.py /home/pcorti/data/shapefile/country.prj
Shape prj is: GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
WKT is: GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Proj4 is: +proj=longlat +datum=WGS84 +no_defs
EPSG is: 4326

Divertiti a modificarlo come meglio credi, buon divertimento

ciao
P

--
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti

Grazie Paolo,
proverò...:wink:

--
View this message in context: http://gfoss-geographic-free-and-open-source-software-italian-mailing.3056002.n2.nabble.com/prj2epsg-tp6246112p6246288.html
Sent from the Gfoss -- Geographic Free and Open Source Software - Italian mailing list mailing list archive at Nabble.com.

Grazie Paolo.
Puoi metterlo sul wiki, cosi' che non rimanga seppellito nelgi archivi
della ML?
Grazie.

Il giorno mer, 06/04/2011 alle 16.37 +0200, Paolo Corti ha scritto:

Usando GDAL (testato sulla 1.8) e senza usare un servizio on line.
Crea il file esriprj2standards ed inserisci le seguenti linee:

import sys

--
http://www.faunalia.it/pc