parameters: (mapmatching, filepath, dataname= 'pointshapedata', 
                           parent = None, log = None)
return_statement: return True
docstring: Export GPS points to shapefile.
docstring_summary: Export GPS points to shapefile.
docstring_tokens: Export GPS points to shapefile .
function: def points_to_shapefile(mapmatching, filepath, dataname= 'pointshapedata', 
                           parent = None, log = None):
      """
      Export GPS points to shapefile.
      """
      net = mapmatching.get_scenario().net
      points = mapmatching.points
      trips = mapmatching.trips
      shapedata = shapeformat.Shapedata(parent,dataname, name = 'GPS points shape data', 
                                      filepath=filepath, 
                                      shapetype = shapeformat.SHAPETYPES['Point'],
                                      projparams_shape = net.get_projparams(),
                                      offset = net.get_offset(), log = log )
      
      #attrname, ftype, flen, fdigit = field
      attrlist = [\
      ('id','id','ID_POINT','N',12,0),
      ('timestamps','val','TIME','N',32,0),
      ('ids_trip','id','ID_TRIP','N',32,0),
      #('radii','val','RADIUS','N',5,3),
      ]
      # 
      
      
      print 'nodes_to_shapefile',filepath
      
      for attr in attrlist:
          shapedata.add_field(attr[2:])
      
  
      ids_point = points.select_ids(trips.ids_route_matched[points.ids_trip.get_value()]>-1)
      
      ids_shape = shapedata.add_rows(len(ids_point))
      #print '  shapedata.ID_ARC',shapedata.ID_ARC,'dir',dir(shapedata.ID_ARC)
      shapedata.ID_POINT[ids_shape] = ids_point
      shapedata.coords[ids_shape] = points.coords[ids_point]
      
          
      
      # copy rest of attributes
      for netattrname, gettype, shapeattrname,x1,x2,x3 in attrlist:
          if netattrname not in ('id',):
              getattr(shapedata,shapeattrname)[ids_shape] = getattr(points,netattrname)[ids_point]
          
      shapedata.adjust_fieldlength() 
      shapedata.export_shapefile()
      return True
function_tokens: def points_to_shapefile ( mapmatching , filepath , dataname = 'pointshapedata' , parent = None , log = None ) : net = mapmatching . get_scenario ( ) . net points = mapmatching . points trips = mapmatching . trips shapedata = shapeformat . Shapedata ( parent , dataname , name = 'GPS points shape data' , filepath = filepath , shapetype = shapeformat . SHAPETYPES [ 'Point' ] , projparams_shape = net . get_projparams ( ) , offset = net . get_offset ( ) , log = log ) #attrname, ftype, flen, fdigit = field attrlist = [ ( 'id' , 'id' , 'ID_POINT' , 'N' , 12 , 0 ) , ( 'timestamps' , 'val' , 'TIME' , 'N' , 32 , 0 ) , ( 'ids_trip' , 'id' , 'ID_TRIP' , 'N' , 32 , 0 ) , #('radii','val','RADIUS','N',5,3), ] #  print 'nodes_to_shapefile' , filepath for attr in attrlist : shapedata . add_field ( attr [ 2 : ] ) ids_point = points . select_ids ( trips . ids_route_matched [ points . ids_trip . get_value ( ) ] > - 1 ) ids_shape = shapedata . add_rows ( len ( ids_point ) ) #print '  shapedata.ID_ARC',shapedata.ID_ARC,'dir',dir(shapedata.ID_ARC) shapedata . ID_POINT [ ids_shape ] = ids_point shapedata . coords [ ids_shape ] = points . coords [ ids_point ] # copy rest of attributes for netattrname , gettype , shapeattrname , x1 , x2 , x3 in attrlist : if netattrname not in ( 'id' , ) : getattr ( shapedata , shapeattrname ) [ ids_shape ] = getattr ( points , netattrname ) [ ids_point ] shapedata . adjust_fieldlength ( ) shapedata . export_shapefile ( ) return True