<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      sumo——相關地圖文件格式轉換

      netconvert xodr 轉net.xml格式

      使用 netconvert 命令轉換
      netconvert --opendrive-files caoyang.xodr -o caoyang.net.xml

      使用工具類將caoyang.net.xml 轉 caoyang.geojson

      package com.ys.test.netxml_to_geojson;
      
      import org.w3c.dom.*;
      import javax.xml.parsers.*;
      import java.io.*;
      import org.json.*;
      
      public class NetXmlToGeoJson {
          public static void main(String[] args) throws IOException {
              final String netFile = "D:\\A_tool\\sumo-win64-1.20.0\\A-file\\xodr-demo\\caoyang.net.xml";
              final String shpFile = "D:\\A_tool\\sumo-win64-1.20.0\\A-file\\xodr-demo\\caoyang.geojson";
              try {
                  netxmlToGeojson(netFile, shpFile);
                  System.out.println("Conversion completed successfully.");
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
          public static void netxmlToGeojson(String netFile, String outputFile) throws Exception {
              // Parse the XML file
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document doc = builder.parse(new File(netFile));
              doc.getDocumentElement().normalize();
      
              // Initialize GeoJSON structure
              JSONArray featuresArray = new JSONArray();
      
              // Get all edges
              NodeList edgeList = doc.getElementsByTagName("edge");
              for (int i = 0; i < edgeList.getLength(); i++) {
                  Node edgeNode = edgeList.item(i);
                  if (edgeNode.getNodeType() == Node.ELEMENT_NODE) {
                      Element edge = (Element) edgeNode;
      
                      // Extract coordinates from lanes
                      JSONArray coordinates = new JSONArray();
                      NodeList laneList = edge.getElementsByTagName("lane");
                      for (int j = 0; j < laneList.getLength(); j++) {
                          Node laneNode = laneList.item(j);
                          if (laneNode.getNodeType() == Node.ELEMENT_NODE) {
                              Element lane = (Element) laneNode;
                              String shape = lane.getAttribute("shape");
                              String[] points = shape.split(" ");
                              for (String point : points) {
                                  String[] coords = point.split(",");
                                  double lon = Double.parseDouble(coords[0]);
                                  double lat = Double.parseDouble(coords[1]);
                                  coordinates.put(new JSONArray().put(lon).put(lat));
                              }
                          }
                      }
      
                      // Create feature object
                      JSONObject properties = new JSONObject()
                              .put("id", edge.getAttribute("id"))
                              .put("name", edge.getAttribute("name"));
      
                      JSONObject geometry = new JSONObject()
                              .put("type", "LineString")
                              .put("coordinates", coordinates);
      
                      JSONObject feature = new JSONObject()
                              .put("type", "Feature")
                              .put("geometry", geometry)
                              .put("properties", properties);
      
                      featuresArray.put(feature);
                  }
              }
      
              // Write to GeoJSON file
              JSONObject geojson = new JSONObject()
                      .put("type", "FeatureCollection")
                      .put("features", featuresArray);
      
              try (FileWriter file = new FileWriter(outputFile)) {
                  file.write(geojson.toString(4)); // Pretty print with indent of 4 spaces
              }
          }
      }
      

      OSGeo4W安裝gdal庫流程

      參考:https://blog.csdn.net/brucehaoLee/article/details/140928493

      ogr2ogr工具 .geojson轉 .shp

      ogr2ogr 是 GDAL(Geospatial Data Abstraction Library)的一部分,用于轉換矢量地理空間數據格式。GDAL 是一個開源的庫,提供了讀寫柵格和矢量地理空間數據格式的能力。ogr2ogr 專門處理矢量數據(如 Shapefile、GeoJSON、PostGIS 等),而 gdal_translate 和 gdalwarp 則主要用于柵格數據。
      命令
      ogr2ogr -f "ESRI Shapefile" output.shp caoyang.geojson

      OSGeo4W 安裝 ogr2osm

      OSGeo4W 沒有直接提供 ogr2osm 包,你需要手動安裝它。你可以通過 Python 的 pip 工具來安裝 ogr2osm。

      打開 OSGeo4W Shell:你可以在開始菜單中找到并啟動 OSGeo4W Shell。這將為你提供一個已經配置好環境變量的命令行界面。
      更新 pip(如果需要):
      python3 -m pip install --upgrade pip
      安裝 ogr2osm
      python3 -m pip install ogr2osm
      驗證安裝
      為了確保一切正常工作,你可以嘗試運行 ogr2osm 來查看幫助信息:
      ogr2osm --help

      posted @ 2024-12-16 16:30  渝思  閱讀(364)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 天天澡日日澡狠狠欧美老妇| 久久国产精99精产国高潮| 国产91丝袜在线播放动漫| 亚洲第一视频区| 亚洲国产码专区在线观看| 国语精品一区二区三区 | 亚洲av中文乱码一区二| 男女一级国产片免费视频| 18禁超污无遮挡无码网址| 镇康县| 99久久精品国产亚洲精品| 又爽又黄又无遮掩的免费视频| 在线aⅴ亚洲中文字幕| 欧美日产国产精品| 欧美乱妇高清无乱码免费| 亚洲熟妇国产熟妇肥婆| 亚洲香蕉免费有线视频| 国产精品久久久久7777| 亚洲欧洲日产国码无码久久99| 水蜜桃av无码| 国产精品人妻中文字幕| 影音先锋在线资源无码| 欧美亚洲色综久久精品国产| 亚洲人妻系列中文字幕| 国产乱子伦精品免费女| 日本亚洲欧洲免费无线码| 亚洲爆乳WWW无码专区| 亚洲天堂精品一区二区| 国产精品一二三区蜜臀av| 精品一区二区不卡无码AV| 99福利一区二区视频| 四虎永久在线精品免费看| 不卡国产一区二区三区| 中文字幕在线日韩| 久久一夜天堂av一区二区| 亚洲女同精品久久女同| 大陆熟妇丰满多毛xxxx| 国产亚洲精品久久久网站好莱| 亚洲人精品午夜射精日韩| 国产亚洲欧美在线观看三区| 2021亚洲国产精品无码|