本文整理了Java中com.vividsolutions.jts.geom.GeometryFactory.getSRID()
方法的一些代码示例,展示了GeometryFactory.getSRID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeometryFactory.getSRID()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.GeometryFactory
类名称:GeometryFactory
方法名:getSRID
[英]Gets the SRID value defined for this factory.
[中]获取为此工厂定义的SRID值。
代码示例来源:origin: com.vividsolutions/jts
/**
* Creates a new <code>Geometry</code> via the specified GeometryFactory.
*
* @param factory
*/
public Geometry(GeometryFactory factory) {
this.factory = factory;
this.SRID = factory.getSRID();
}
代码示例来源:origin: com.vividsolutions/jts
private GeometryFactory createFactory(GeometryFactory inputFactory, PrecisionModel pm)
{
GeometryFactory newFactory
= new GeometryFactory(pm,
inputFactory.getSRID(),
inputFactory.getCoordinateSequenceFactory());
return newFactory;
}
代码示例来源:origin: com.vividsolutions/jts
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()<1)
throw new SAXException("Cannot create a polygon without atleast one linear ring");
int srid = getSrid(arg.attrs,gf.getSRID());
LinearRing outer = (LinearRing) arg.children.get(0); // will be the first
List t = arg.children.size()>1?arg.children.subList(1,arg.children.size()):null;
LinearRing[] inner = t==null?null:(LinearRing[]) t.toArray(new LinearRing[t.size()]);
Polygon p = gf.createPolygon(outer,inner);
if(p.getSRID()!=srid)
p.setSRID(srid);
return p;
}
});
代码示例来源:origin: com.vividsolutions/jts
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()<1)
throw new SAXException("Cannot create a multi-polygon without atleast one polygon");
int srid = getSrid(arg.attrs,gf.getSRID());
Polygon[] plys = (Polygon[]) arg.children.toArray(new Polygon[arg.children.size()]);
MultiPolygon mp = gf.createMultiPolygon(plys);
if(mp.getSRID()!=srid)
mp.setSRID(srid);
return mp;
}
});
代码示例来源:origin: com.vividsolutions/jts
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()<1)
throw new SAXException("Cannot create a multi-point without atleast one point");
int srid = getSrid(arg.attrs,gf.getSRID());
Point[] pts = (Point[]) arg.children.toArray(new Point[arg.children.size()]);
MultiPoint mp = gf.createMultiPoint(pts);
if(mp.getSRID()!=srid)
mp.setSRID(srid);
return mp;
}
});
代码示例来源:origin: com.vividsolutions/jts
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()!=1)
throw new SAXException("Cannot create a point without exactly one coordinate");
int srid = getSrid(arg.attrs,gf.getSRID());
Object c = arg.children.get(0);
Point p = null;
if(c instanceof Coordinate){
p = gf.createPoint((Coordinate)c);
}else{
p = gf.createPoint((CoordinateSequence)c);
}
if(p.getSRID()!=srid)
p.setSRID(srid);
return p;
}
});
代码示例来源:origin: com.vividsolutions/jts
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()<1)
throw new SAXException("Cannot create a multi-linestring without atleast one linestring");
int srid = getSrid(arg.attrs,gf.getSRID());
LineString[] lns = (LineString[]) arg.children.toArray(new LineString[arg.children.size()]);
MultiLineString mp = gf.createMultiLineString(lns);
if(mp.getSRID()!=srid)
mp.setSRID(srid);
return mp;
}
});
代码示例来源:origin: com.vividsolutions/jts
throw new SAXException("Cannot create a linear ring without atleast four coordinates or one coordinate sequence");
int srid = getSrid(arg.attrs,gf.getSRID());
代码示例来源:origin: com.vividsolutions/jts
throw new SAXException("Cannot create a linestring without atleast two coordinates or one coordinate sequence");
int srid = getSrid(arg.attrs,gf.getSRID());
代码示例来源:origin: com.vividsolutions/jts
public Geometry reduce(Geometry geom)
{
GeometryEditor geomEdit;
if (changePrecisionModel) {
GeometryFactory newFactory = new GeometryFactory(newPrecisionModel, geom.getFactory().getSRID());
geomEdit = new GeometryEditor(newFactory);
}
else
// don't change geometry factory
geomEdit = new GeometryEditor();
return geomEdit.edit(geom, new PrecisionReducerCoordinateOperation());
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Creates a new <code>Geometry</code> via the specified GeometryFactory.
*
* @param factory
*/
public Geometry(GeometryFactory factory) {
this.factory = factory;
this.SRID = factory.getSRID();
}
代码示例来源:origin: org.n52.series-api/spi
protected GeometryFactory getGeometryFactory(int srid,
GeometryFactory factory) {
if (srid == factory.getSRID()) {
return factory;
} else {
return new GeometryFactory(DEFAULT_PRECISION_MODEL, srid);
}
}
代码示例来源:origin: org.n52.sensorweb/timeseries-io
protected GeometryFactory getGeometryFactory(int srid,
GeometryFactory factory) {
if (srid == factory.getSRID()) {
return factory;
} else {
return new GeometryFactory(DEFAULT_PRECISION_MODEL, srid);
}
}
代码示例来源:origin: org.n52.sensorweb.sos/coding-json
protected GeometryFactory getGeometryFactory(int srid, GeometryFactory factory) {
if (srid == factory.getSRID()) {
return factory;
} else {
return new GeometryFactory(DEFAULT_PRECISION_MODEL, srid);
}
}
代码示例来源:origin: com.vividsolutions/jts-core
private GeometryFactory createFactory(GeometryFactory inputFactory, PrecisionModel pm)
{
GeometryFactory newFactory
= new GeometryFactory(pm,
inputFactory.getSRID(),
inputFactory.getCoordinateSequenceFactory());
return newFactory;
}
代码示例来源:origin: com.vividsolutions/jts-io
public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
// one child, either a coord
// or a coordinate sequence
if(arg.children.size()<1)
throw new SAXException("Cannot create a multi-polygon without atleast one polygon");
int srid = getSrid(arg.attrs,gf.getSRID());
Polygon[] plys = (Polygon[]) arg.children.toArray(new Polygon[arg.children.size()]);
MultiPolygon mp = gf.createMultiPolygon(plys);
if(mp.getSRID()!=srid)
mp.setSRID(srid);
return mp;
}
});
代码示例来源:origin: org.n52.series-api.db/dao
/**
* Convert the supplied {@code GeometryFactory}.
*
* @param factory the factory
*
* @return the converted factory
*/
private org.locationtech.jts.geom.GeometryFactory convertFactory(
com.vividsolutions.jts.geom.GeometryFactory factory) {
return new org.locationtech.jts.geom.GeometryFactory(
convertPrecisionModel(factory.getPrecisionModel()),
factory.getSRID());
}
代码示例来源:origin: 52North/SOS
/**
* Convert the supplied {@code GeometryFactory}.
*
* @param factory the factory
*
* @return the converted factory
*/
private org.locationtech.jts.geom.GeometryFactory convertFactory(
com.vividsolutions.jts.geom.GeometryFactory factory) {
return new org.locationtech.jts.geom.GeometryFactory(
convertPrecisionModel(factory.getPrecisionModel()),
factory.getSRID());
}
代码示例来源:origin: com.vividsolutions/jts-core
public Geometry reduce(Geometry geom)
{
GeometryEditor geomEdit;
if (changePrecisionModel) {
GeometryFactory newFactory = new GeometryFactory(newPrecisionModel, geom.getFactory().getSRID());
geomEdit = new GeometryEditor(newFactory);
}
else
// don't change geometry factory
geomEdit = new GeometryEditor();
return geomEdit.edit(geom, new PrecisionReducerCoordinateOperation());
}
代码示例来源:origin: org.n52.shetland/shetland
public static GeometryFactory getGeometryFactory(Geometry geometry) {
if (geometry.getFactory().getSRID() > 0 || geometry.getSRID() == 0) {
return geometry.getFactory();
} else {
return getGeometryFactoryForSRID(geometry.getSRID());
}
}
内容来源于网络,如有侵权,请联系作者删除!