本文整理汇总了Java中com.vividsolutions.jts.geom.MultiPolygon.setSRID方法的典型用法代码示例。如果您正苦于以下问题:Java MultiPolygon.setSRID方法的具体用法?Java MultiPolygon.setSRID怎么用?Java MultiPolygon.setSRID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.geom.MultiPolygon
的用法示例。
在下文中一共展示了MultiPolygon.setSRID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildMultiPolygon
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
protected MultiPolygon buildMultiPolygon(String multip) {
try {
WKTReader reader = new WKTReader();
MultiPolygon mp = (MultiPolygon) reader.read(multip);
mp.setSRID(4326);
return mp;
} catch (ParseException ex) {
throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
}
}
示例2: parseMultiPolygon
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
protected MultiPolygon parseMultiPolygon(String wkt) {
try {
WKTReader wktReader = new WKTReader();
MultiPolygon the_geom = (MultiPolygon) wktReader.read(wkt);
the_geom.setSRID(4326);
return the_geom;
} catch (ParseException e) {
throw new IllegalArgumentException("Unparsabe WKT", e);
}
}
示例3: buildMultiPolygon
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
protected MultiPolygon buildMultiPolygon() {
try {
WKTReader reader = new WKTReader();
MultiPolygon mp = (MultiPolygon) reader.read(MULTIPOLYGONWKT);
mp.setSRID(4326);
return mp;
} catch (ParseException ex) {
throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
}
}
示例4: marshal
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
@Override
public String marshal(MultiPolygon the_geom) throws ParseException {
if (the_geom != null) {
WKTWriter wktWriter = new WKTWriter();
if (the_geom.getSRID() == 0)
the_geom.setSRID(4326);
return wktWriter.write(the_geom);
} else {
throw new ParseException("Geometry obj is null.");
}
}
示例5: createMultiPolygon
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
/**
* Creates the multi polygon.
*
* @param pol
* the pol
* @return the multi polygon
*/
public MultiPolygon createMultiPolygon(Polygon[] pol)
{
MultiPolygon multiPoly = this.factory.createMultiPolygon(pol);
if (multiPoly.getSRID() == 0)
{
multiPoly.setSRID(4326);
}
return multiPoly;
}
示例6: createWKTFromMultiPolygon
import com.vividsolutions.jts.geom.MultiPolygon; //导入方法依赖的package包/类
/**
* Creates the wkt from multi polygon.
*
* @param multiPoly
* the multi poly
* @return the string
* @throws ParseException
* the parse exception
*/
public String createWKTFromMultiPolygon(MultiPolygon multiPoly) throws ParseException
{
if (multiPoly.getSRID() == 0)
{
multiPoly.setSRID(4326);
}
return this.multiPolAdapter.marshal(multiPoly);
}