久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='M6SMu'></small><noframes id='M6SMu'>

<legend id='M6SMu'><style id='M6SMu'><dir id='M6SMu'><q id='M6SMu'></q></dir></style></legend>
    <i id='M6SMu'><tr id='M6SMu'><dt id='M6SMu'><q id='M6SMu'><span id='M6SMu'><b id='M6SMu'><form id='M6SMu'><ins id='M6SMu'></ins><ul id='M6SMu'></ul><sub id='M6SMu'></sub></form><legend id='M6SMu'></legend><bdo id='M6SMu'><pre id='M6SMu'><center id='M6SMu'></center></pre></bdo></b><th id='M6SMu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='M6SMu'><tfoot id='M6SMu'></tfoot><dl id='M6SMu'><fieldset id='M6SMu'></fieldset></dl></div>
    1. <tfoot id='M6SMu'></tfoot>

      • <bdo id='M6SMu'></bdo><ul id='M6SMu'></ul>

      1. 使用JAVA中的geotools從定義距離(km)內的線(GPS坐標

        Generate a polygon from a line(GPS coordinate) in a defined distance(km) with geotools in JAVA(使用JAVA中的geotools從定義距離(km)內的線(GPS坐標)生成多邊形)
      2. <i id='LmUxu'><tr id='LmUxu'><dt id='LmUxu'><q id='LmUxu'><span id='LmUxu'><b id='LmUxu'><form id='LmUxu'><ins id='LmUxu'></ins><ul id='LmUxu'></ul><sub id='LmUxu'></sub></form><legend id='LmUxu'></legend><bdo id='LmUxu'><pre id='LmUxu'><center id='LmUxu'></center></pre></bdo></b><th id='LmUxu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LmUxu'><tfoot id='LmUxu'></tfoot><dl id='LmUxu'><fieldset id='LmUxu'></fieldset></dl></div>

        <legend id='LmUxu'><style id='LmUxu'><dir id='LmUxu'><q id='LmUxu'></q></dir></style></legend>
            <tbody id='LmUxu'></tbody>

              <small id='LmUxu'></small><noframes id='LmUxu'>

              <tfoot id='LmUxu'></tfoot>
                • <bdo id='LmUxu'></bdo><ul id='LmUxu'></ul>
                  本文介紹了使用JAVA中的geotools從定義距離(km)內的線(GPS坐標)生成多邊形的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  使用 geotools 是否有可能從定義距離內的線 (coords[]) 生成多邊形?例如.(100,100), (101,100), (102,100) 距離 1 公里.所以從每一點它生成一個圓圈并變成某事.喜歡:

                  With geotools would it be possible that generating a polygon from a line (coords[]) in a defined distance? E.g. (100,100), (101,100), (102,100) with distance 1km. So from each point it generates a circle and becomes sth. like:

                  -------------之前

                  -------------- before

                  (========) 之后

                  (========) after

                  或者我必須先將 GPS 坐標轉換為以 km 為單位的正交坐標,然后使用三角函數生成多邊形,最后再將其轉換回 GPS?

                  Or I have to firstly convert GPS coordinates into orthogonal coordinates in km, and then generating a polygon using Trigonometric functions, and finally, convert it back into GPS?

                  推薦答案

                  最簡單的方法是調用底層 JTS 幾何的 buffer(distance) 方法.棘手的一點是處理與以米為單位的投影之間的重投影(因此您可以以米或公里為單位指定緩沖區).

                  At it's simplest you simply need to call the buffer(distance) method on the underlying JTS geometry. The tricky bit is handling the reprojection to and from a projection which is in meters (so you can specify your buffer in meters or kilometers).

                  public SimpleFeature bufferFeature(SimpleFeature feature,
                          Measure<Double, Length> distance) {
                      // extract the geometry
                      GeometryAttribute gProp = feature.getDefaultGeometryProperty();
                      CoordinateReferenceSystem origCRS = gProp.getDescriptor()
                          .getCoordinateReferenceSystem();
                  
                      Geometry geom = (Geometry) feature.getDefaultGeometry();
                      Geometry pGeom = geom;
                      MathTransform toTransform,fromTransform = null;
                      // reproject the geometry to a local projection
                      if (!(origCRS instanceof ProjectedCRS)) {
                  
                          Point c = geom.getCentroid();
                          double x = c.getCoordinate().x;
                          double y = c.getCoordinate().y;
                  
                          String code = "AUTO:42001," + x + "," + y;
                          // System.out.println(code);
                          CoordinateReferenceSystem auto;
                          try {
                          auto = CRS.decode(code);
                           toTransform = CRS.findMathTransform(
                              DefaultGeographicCRS.WGS84, auto);
                           fromTransform = CRS.findMathTransform(auto,
                              DefaultGeographicCRS.WGS84);
                          pGeom = JTS.transform(geom, toTransform);
                          } catch (MismatchedDimensionException | TransformException
                              | FactoryException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                          }
                  
                      }
                  
                      // buffer
                      Geometry out = buffer(pGeom, distance.doubleValue(SI.METER));
                      Geometry retGeom = out;
                      // reproject the geometry to the original projection
                      if (!(origCRS instanceof ProjectedCRS)) {
                          try {
                          retGeom = JTS.transform(out, fromTransform);
                          } catch (MismatchedDimensionException | TransformException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                          }
                      }
                      // return a new feature containing the geom
                      SimpleFeatureType schema = feature.getFeatureType();
                      SimpleFeatureTypeBuilder ftBuilder = new SimpleFeatureTypeBuilder();
                      ftBuilder.setCRS(origCRS);
                      //ftBuilder.setDefaultGeometry("buffer");
                      ftBuilder.addAll(schema.getAttributeDescriptors());
                      ftBuilder.setName(schema.getName());
                  
                      SimpleFeatureType nSchema = ftBuilder.buildFeatureType();
                      SimpleFeatureBuilder builder = new SimpleFeatureBuilder(nSchema);
                       List<Object> atts = feature.getAttributes();
                       for(int i=0;i<atts.size();i++) {
                           if(atts.get(i) instanceof Geometry) {
                           atts.set(i, retGeom);
                           }
                       }
                      SimpleFeature nFeature = builder.buildFeature(null, atts.toArray() );
                      return nFeature;
                      }
                  

                  完整代碼在 https://gist.github.com/ianturton/9a7cfee378e7072ec3cd這顯示了如何處理整個事情.

                  The full code is at https://gist.github.com/ianturton/9a7cfee378e7072ec3cd which shows how to handle the whole thing.

                  這篇關于使用JAVA中的geotools從定義距離(km)內的線(GPS坐標)生成多邊形的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

                    • <small id='nrcyQ'></small><noframes id='nrcyQ'>

                      <tfoot id='nrcyQ'></tfoot>
                        <i id='nrcyQ'><tr id='nrcyQ'><dt id='nrcyQ'><q id='nrcyQ'><span id='nrcyQ'><b id='nrcyQ'><form id='nrcyQ'><ins id='nrcyQ'></ins><ul id='nrcyQ'></ul><sub id='nrcyQ'></sub></form><legend id='nrcyQ'></legend><bdo id='nrcyQ'><pre id='nrcyQ'><center id='nrcyQ'></center></pre></bdo></b><th id='nrcyQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nrcyQ'><tfoot id='nrcyQ'></tfoot><dl id='nrcyQ'><fieldset id='nrcyQ'></fieldset></dl></div>
                          <tbody id='nrcyQ'></tbody>

                        • <bdo id='nrcyQ'></bdo><ul id='nrcyQ'></ul>

                          <legend id='nrcyQ'><style id='nrcyQ'><dir id='nrcyQ'><q id='nrcyQ'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 久草免费在线视频 | 中文字幕在线观看日韩 | 羞羞网站免费 | 999久久久久久久久 国产欧美在线观看 | 中文字幕 欧美 日韩 | 国产乱精品一区二区三区 | 97国产成人 | 亚洲一区中文字幕在线观看 | 色天天综合 | 91国在线高清视频 | 久久久夜色精品亚洲 | 在线不卡视频 | 亚洲国产日本 | 一二区视频| 欧美日本韩国一区二区三区 | 特黄色一级毛片 | 亚洲国产成人精 | 一本一道久久a久久精品蜜桃 | 欧美久久一级 | 欧美白人做受xxxx视频 | 中文字幕人成乱码在线观看 | 先锋av资源网 | 九九热精品视频 | 精品国产欧美日韩不卡在线观看 | 三级成人在线观看 | 色婷婷av一区二区三区软件 | 色.com| 欧美一级在线 | 国产在线视频一区二区 | 欧美激情精品久久久久久 | 中文字幕亚洲视频 | 日韩黄色av | 北条麻妃av一区二区三区 | 国产精品福利在线 | 看特级黄色片 | 日韩中文字幕在线视频观看 | 日干夜操 | 91精品国产综合久久久久久丝袜 | 91视频官网 | 福利网址| 在线看亚洲 |