示例#1
0
  void Preprocess::Callback::ProcessNode(const OSMId& id,
                                         const double& lon,
                                         const double& lat,
                                         const TagMap& tagMap)
  {
    RawNode      node;
    ObjectOSMRef object(id,
                        osmRefNode);

    if (id<lastNodeId) {
      nodeSortingError=true;
    }

    minCoord.Set(std::min(minCoord.GetLat(),lat),
                 std::min(minCoord.GetLon(),lon));

    maxCoord.Set(std::max(maxCoord.GetLat(),lat),
                 std::max(maxCoord.GetLon(),lon));

    coordCount++;

    StoreCoord(id,
               GeoCoord(lat,
                        lon));

    TypeInfoRef type=typeConfig->GetNodeType(tagMap);

    nodeStat[type->GetIndex()]++;

    if (!type->GetIgnore()) {
      node.SetId(id);
      node.SetType(type);
      node.SetCoords(lon,lat);

      node.Parse(progress,
                 *typeConfig,
                 tagMap);

      node.Write(*typeConfig,
                 nodeWriter);

      nodeCount++;
    }

    lastNodeId=id;
  }
示例#2
0
  void Preprocess::ProcessNode(const TypeConfig& typeConfig,
                               const OSMId& id,
                               const double& lon,
                               const double& lat,
                               const std::map<TagId,std::string>& tagMap)
  {
    RawNode    node;
    TypeId     type=typeIgnore;
    FileOffset nodeOffset;

    if (id<lastNodeId) {
      nodeSortingError=true;
    }

    typeConfig.GetNodeTypeId(tagMap,type);

    if (type!=typeIgnore) {
      typeConfig.ResolveTags(tagMap,tags);

      nodeWriter.GetPos(nodeOffset);

      node.SetId(id);
      node.SetType(type);
      node.SetCoords(lon,lat);
      node.SetTags(tags);

      node.Write(nodeWriter);

      nodeCount++;
    }
    else {
      nodeOffset=0;
    }

    StoreCoord(id,
               lat,
               lon);

    lastNodeId=id;
  }