Ejemplo n.º 1
0
 public static byte[] GeoProcessingWay(Way way, GeoTypeOGC geoTypeOgc)
 {
     switch (geoTypeOgc)
     {
         case GeoTypeOGC.LineString:
             return GeoProcessing.ConstructLineString(way.Nodes, way);
             break;
         case GeoTypeOGC.Polygon:
             return GeoProcessing.ConstructPolygon(way.Nodes, way);
             break;
     }
     throw new TypeLoadException("Geo type " + geoTypeOgc + " using Way not supported");
 }
Ejemplo n.º 2
0
        public static byte[] GeoProcessingWay(Way way, GeoTypeOGC geoTypeOgc)
        {
            switch (geoTypeOgc)
            {
            case GeoTypeOGC.LineString:
                return(GeoProcessing.ConstructLineString(way.Nodes, way));

                break;

            case GeoTypeOGC.Polygon:
                return(GeoProcessing.ConstructPolygon(way.Nodes, way));

                break;
            }
            throw new TypeLoadException("Geo type " + geoTypeOgc + " using Way not supported");
        }
Ejemplo n.º 3
0
 private void ProcessSectionGeoTypeOsm(XElement xGeoOsm, Dictionary <string, GeoTypeOGC> geoOsm)
 {
     if (XmlUtility.IsExistAttributesInXElement(xGeoOsm))
     {
         foreach (XElement xTags in xGeoOsm.Elements())
         {
             if (xTags.Attribute("geography") != null)
             {
                 GeoTypeOGC geoTypeOgc = this.GetTypeOGCFromSectionGeo(xTags.Attribute("geography").Value);
                 geoOsm.Add(xTags.Name.ToString(), geoTypeOgc);
             }
             else
             {
                 throw new XmlException("A tag " + xGeoOsm.Name.ToString() +
                                        @"/" + xTags.Name.ToString() + " attribute 'geography' is not found");
             }
         }
     }
 }
Ejemplo n.º 4
0
 private void ImportGeoWays()
 {
     if (_waysOsm.Count > 0)
     {
         DataTable waysOsm  = this.GetTableGeo();
         int       countRow = 0;
         foreach (KeyValuePair <Int64, Way> keyValuePair in _waysOsm)
         {
             countRow++;
             if (keyValuePair.Value.GeoType == null)
             {
                 continue;
             }
             GeoTypeOGC geoTypeOgc = keyValuePair.Value.GeoType.GeoTypeOGC;
             byte[]     way        = GeoProcessing.GeoProcessingWay(keyValuePair.Value, geoTypeOgc);
             if (way == null)
             {
                 continue;
             }
             DataRow dataRow = waysOsm.NewRow();
             dataRow["idGeo"]   = keyValuePair.Key;
             dataRow["bin"]     = way;
             dataRow["typeGeo"] = (Int16)geoTypeOgc;
             waysOsm.Rows.Add(dataRow);
             if (countRow == COUNT_ROW)
             {
                 this.ImportDataTableInDb(ref waysOsm, new GetTable(GetTableGeo));
                 countRow = 0;
             }
         }
         if (waysOsm.Rows.Count > 0)
         {
             this.ImportDataTableInDb(ref waysOsm, new GetTable(GetTableGeo));
         }
     }
 }
Ejemplo n.º 5
0
 public GeoType(GeoTypeOGC geoTypeOgc)
 {
     _geoTypeOgc = geoTypeOgc;
 }