久久久久久久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>
                          • 主站蜘蛛池模板: 午夜电影一区 | 国产视频在线一区二区 | 欧美在线一级 | 在线免费视频一区 | 中文字幕一区二区三区四区 | 日本天堂一区二区 | 午夜久久 | 99精品久久| 久久久久国产一区二区三区 | 国产亚洲精品一区二区三区 | 欧美日韩一 | 色婷婷综合网站 | 一区二区电影网 | 男人天堂免费在线 | 福利视频一区二区三区 | 一级看片免费视频囗交动图 | 国产精品一区二区电影 | 日韩影院一区 | 人人艹人人 | 日韩中文字幕视频 | 久草免费在线视频 | 亚洲国产成人在线观看 | 国产精品久久久久久久久久免费看 | 日韩一区二区在线播放 | 国产成人免费在线 | 日韩成人精品视频 | 中文字幕国 | 亚洲毛片在线观看 | 99精品一区二区三区 | 免费观看黄 | 欧美精品久久久 | 国产激情综合五月久久 | 福利视频网站 | 夜夜爽99久久国产综合精品女不卡 | 国产免费一区二区三区 | 免费看国产a | 欧美一级免费看 | 国产精品国产精品国产专区不卡 | 一区二区三区在线 | 欧美国产一区二区三区 | 久久国产精品一区二区 |