Hi mike

I was working on the shp2osm_simple.pl[1], to try to split in ways with
2000 nodes or less.
I attach a patch to do it, I'm not a perl programmer, but at the moment
the osm contain ways with 2000 nodes or less.

https://code.launchpad.net/~kosova/+junk/openstreetmapkosova

El sáb, 04-12-2010 a las 10:35 +0100, Mike Dupont escribió:

> changes to the code checked, int you can run it yourself like this:
> shp2osm_simple.pl --file=MunicipiosDepartamentos/ADM_Municipios.shp
> --prefix=ADM_Municipios --source=http://crisis.ofi.co/media/shp/
> --waysperfile=1
> 
> http://bazaar.launchpad.net/~kosova/+junk/openstreetmapkosova/changes 

-- 

Juan Pizarro
doingIT Ltda.
10 Oriente N°1887
Talca
                  Tel: +56 71 230476
                 Mob: +56 9 75891972
         E-Mail: [email protected]


Soluciones Informáticas
-----------------------------------------------------------------------------
OpenStreetMap.org: El Mapa Libre del Mundo 
droid.cl: Comunidad Chilena del sistema operativo Android

<<attachment: l_firma.png>>

=== modified file 'ShapeToOsm.pm'
--- ShapeToOsm.pm	2010-12-03 17:53:39 +0000
+++ ShapeToOsm.pm	2010-12-04 15:41:27 +0000
@@ -131,12 +131,21 @@
 sub polyline_out {
     my ( $pts, $tags, $connect_last_seg ) = @_;
 
-    my ( $first_node, $last_node, @segs );
+    my ( $first_node, $last_node, @segs);
+    my $nodecount = 0;
     for my $pt (@$pts) {
+        $nodecount++;
         my $node = node_out @$pt;
         push @segs, seg_out $last_node, $node;
         $last_node = $node;
         $first_node ||= $last_node;
+        if( $nodecount == 1999){
+            print "new way $nodecount\n";
+            push @segs, seg_out $last_node, $first_node
+              if $first_node && $connect_last_seg;
+            way_out \...@segs, $tags;
+            my ( $first_node, $last_node, @segs);
+        }
     }
     push @segs, seg_out $last_node, $first_node
       if $first_node && $connect_last_seg;

=== modified file 'shp2osm_simple.pl' (properties changed: -x to +x)
_______________________________________________
Talk-co mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk-co

Responder a