Sorry this is the patch.
At the moment only show segements ways with 2000 nodes.

El sáb, 04-12-2010 a las 12:55 -0300, Juan Pizarro escribió:

> 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


-- 

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>>

<<attachment: l_firma.png>>

=== modified file 'ShapeToOsm.pm'
--- ShapeToOsm.pm	2010-12-03 17:53:39 +0000
+++ ShapeToOsm.pm	2010-12-04 15:58:07 +0000
@@ -131,16 +131,25 @@
 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;
-    way_out \...@segs, $tags;
+#    push @segs, seg_out $last_node, $first_node
+#      if $first_node && $connect_last_seg;
+#    way_out \...@segs, $tags;
 }
 
 sub proc_obj {

=== 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