[Talk-de] shp2osm - überarbeitet
Michael Schmitt
m-schmitt at t-online.de
Mi Aug 13 16:20:58 UTC 2008
Tobias Wendorff schrieb:
> Hallo Leute,
>
> aus experimentellen Gründen habe ich gerade mal shp2osm von
> Gabriel Ebner auf den neusten Stand gebracht:
>
> http://raumplanung.tobwen.de/OSM/scripts/shp2osm_080811.pls
>
> Wenn ich diese blöde Proj.4-Library unter ActivePerl aktivieren
> könnte, würde ich die Erweiterung von Hermann Schwärzler
> integrieren. Diese ermöglicht "on the fly" Projektion.
>
>
Warum benutzt du nicht die Geo::Coordinates::UTM Library. Die ist in
http://ppm4.activestate.com/MSWin32-x86/5.8/822/package.xml
drinnen. Ich habe dann dein Script angepasst:
addiert ziemlich am Anfang:
# To reproject on the fly
use Geo::Coordinates::UTM;
$ellipsoid = "Bessel 1841";
$zone = '32U';
# my
($latitude,$longitude)=utm_to_latlon($ellipsoid,$zone,$easting,$northing);
und dann noch 'sub node_out geändert':
sub node_out {
# my ( $lon, $lat, $tags ) = @_;
# we have northing and easting
my ( $northing, $easting, $tags ) = @_;
my $id = $i--;
# reproject
my ($lat,$lon)=utm_to_latlon($ellipsoid,$zone,$easting,$northing);
print " <node id='$id' lat='$lat' lon='$lon'";
print " />\n";
$id;
}
Allerdings habe ich trotzdem Probleme mit deinem obigen Script. Es
werden nämlich die Ways
nicht mit </way> abgeschlossen und Polylines werden in lauter einzelnen
Ways ausgegeben.
Die Koordinaten stimmen auch noch nicht.
Output Bsp.:
<node id='-1' lat='25.4633292699211' lon='54.8293460435404' />
<node id='-2' lat='25.4754539701453' lon='54.833084783883' />
<way id='-3' action='modify' visible='true'>
<nd ref='-1' />
<nd ref='-2' />
<node id='-4' lat='25.4764055521393' lon='54.8335192119137' />
<way id='-5' action='modify' visible='true'>
<nd ref='-2' />
<nd ref='-4' />
<node id='-6' lat='25.4771693231125' lon='54.8332657751774' />
<way id='-7' action='modify' visible='true'>
Gruss mikes
Mehr Informationen über die Mailingliste Talk-de