org.locationtech.jts.geom.GeometryFactory.getSRID()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.locationtech.jts.geom.GeometryFactory.getSRID()方法的一些代码示例,展示了GeometryFactory.getSRID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeometryFactory.getSRID()方法的具体详情如下:
包路径:org.locationtech.jts.geom.GeometryFactory
类名称:GeometryFactory
方法名:getSRID

GeometryFactory.getSRID介绍

[英]Gets the SRID value defined for this factory.
[中]获取为此工厂定义的SRID值。

代码示例

代码示例来源:origin: geotools/geotools

public int getSRID() {
  return delegate.getSRID();
}

代码示例来源:origin: geotools/geotools

if (polygon.getFactory().getSRID() != SRID_NULL) {

代码示例来源:origin: geotools/geotools

if (SRID != 0 && SRID != factory.getSRID()) {
  return false;

代码示例来源:origin: locationtech/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: org.n52.arctic-sea/svalbard-json

protected GeometryFactory getGeometryFactory(int srid, GeometryFactory factory) {
  if (srid == factory.getSRID()) {
    return factory;
  } else {
    return new GeometryFactory(DEFAULT_PRECISION_MODEL, srid);
  }
}

代码示例来源:origin: 52North/SOS

/**
 * Convert the supplied {@code GeometryFactory}.
 *
 * @param factory the factory
 *
 * @return the converted factory
 */
private com.vividsolutions.jts.geom.GeometryFactory convertFactory(
    org.locationtech.jts.geom.GeometryFactory factory) {
  return new com.vividsolutions.jts.geom.GeometryFactory(
      convertPrecisionModel(factory.getPrecisionModel()), factory.getSRID());
}

代码示例来源:origin: org.n52.series-api.db/dao

/**
 * Convert the supplied {@code GeometryFactory}.
 *
 * @param factory the factory
 *
 * @return the converted factory
 */
private com.vividsolutions.jts.geom.GeometryFactory convertFactory(
    org.locationtech.jts.geom.GeometryFactory factory) {
  return new com.vividsolutions.jts.geom.GeometryFactory(
      convertPrecisionModel(factory.getPrecisionModel()), factory.getSRID());
}

代码示例来源:origin: org.n52.series-api/spi

/**
 * Convert the supplied {@code GeometryFactory}.
 *
 * @param factory the factory
 *
 * @return the converted factory
 */
private com.vividsolutions.jts.geom.GeometryFactory convertFactory(
    org.locationtech.jts.geom.GeometryFactory factory) {
  return new com.vividsolutions.jts.geom.GeometryFactory(
      convertPrecisionModel(factory.getPrecisionModel()), factory.getSRID());
}

代码示例来源:origin: locationtech/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: org.n52.sensorweb.sos/binding-kvp

private GeometryFactory convertGeometryFactory(org.locationtech.jts.geom.GeometryFactory factory) {
  return new GeometryFactory(new PrecisionModel(), factory.getSRID());
}

代码示例来源:origin: locationtech/jts

private GeometryFactory createFactory(GeometryFactory inputFactory, PrecisionModel pm)
{
 GeometryFactory newFactory 
  = new GeometryFactory(pm, 
      inputFactory.getSRID(),
      inputFactory.getCoordinateSequenceFactory());
 return newFactory;
}

代码示例来源:origin: locationtech/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: locationtech/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: locationtech/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: locationtech/jts

throw new SAXException("Cannot create a linestring without atleast two coordinates or one coordinate sequence");
int srid = getSrid(arg.attrs,gf.getSRID());

代码示例来源:origin: locationtech/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: locationtech/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: org.n52.arctic-sea/shetland

public static GeometryFactory getGeometryFactory(Geometry geometry) {
  if (geometry.getFactory().getSRID() > 0 || geometry.getSRID() == 0) {
    return geometry.getFactory();
  } else {
    return getGeometryFactoryForSRID(geometry.getSRID());
  }
}

代码示例来源:origin: locationtech/jts

geometryFactory.getSRID(), csFactoryXYZM);

代码示例来源:origin: locationtech/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());
}

相关文章