當前位置: 首頁>>代碼示例>>Java>>正文


Java GeometryFactory.buildGeometry方法代碼示例

本文整理匯總了Java中com.vividsolutions.jts.geom.GeometryFactory.buildGeometry方法的典型用法代碼示例。如果您正苦於以下問題:Java GeometryFactory.buildGeometry方法的具體用法?Java GeometryFactory.buildGeometry怎麽用?Java GeometryFactory.buildGeometry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vividsolutions.jts.geom.GeometryFactory的用法示例。


在下文中一共展示了GeometryFactory.buildGeometry方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertSegStrings

import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
private static Geometry convertSegStrings(Iterator it) {
    GeometryFactory fact = new GeometryFactory();
    List lines = new ArrayList();
    while (it.hasNext()) {
        SegmentString ss = (SegmentString) it.next();
        LineString line = fact.createLineString(ss.getCoordinates());
        lines.add(line);
    }
    return fact.buildGeometry(lines);
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:11,代碼來源:BufferBuilder.java

示例2: read

import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
/**
 * Converts text rendered in the given {@link Font} to a {@link Geometry}
 *
 * @param text the text to render
 * @param font the font to render with
 * @param flatness the flatness to use
 * @param geomFact the geometryFactory to use to create the result
 * @return a polygonal geometry representing the rendered text
 */
public static Geometry read(String text, Font font, double flatness, GeometryFactory geomFact) {
    char[] chs = text.toCharArray();
    FontRenderContext fontContext = new FontRenderContext(null, false, true);
    GlyphVector gv = font.createGlyphVector(fontContext, chs);
    List polys = new ArrayList();
    for (int i = 0; i < gv.getNumGlyphs(); i++) {
        Geometry geom = ShapeReader.read(gv.getGlyphOutline(i), flatness, geomFact);
        for (int j = 0; j < geom.getNumGeometries(); j++) {
            polys.add(geom.getGeometryN(j));
        }
    }
    return geomFact.buildGeometry(polys);
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:23,代碼來源:FontGlyphReader.java

示例3: bufferUnion

import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
private Geometry bufferUnion(List geoms) {
    GeometryFactory factory = ((Geometry) geoms.get(0)).getFactory();
    Geometry gColl = factory.buildGeometry(geoms);
    Geometry unionAll = gColl.buffer(0.0);
    return unionAll;
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:7,代碼來源:CascadedPolygonUnion.java


注:本文中的com.vividsolutions.jts.geom.GeometryFactory.buildGeometry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。