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

x33g5p2x  于2022-01-26 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(150)

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

Point.getSRID介绍

暂无

代码示例

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

public int getSRID() {
  return point.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

/**
 * Get the extent of all {@link Point}s
 *
 * @return The extent as {@link Polygon}
 */
public Polygon getExtent() {
  if (isSetValue()) {
    int srid = -1;
    List<Coordinate> coordinates = Lists.newLinkedList();
    for (PointValuePair pointValuePair : getValue()) {
      Point point = pointValuePair.getPoint();
      coordinates.add(point.getCoordinate());
      if (point.getSRID() != srid) {
        srid = point.getSRID();
      }
    }
    GeometryFactory geometryFactory;
    if (srid > 0) {
      geometryFactory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING), srid);
    } else {
      geometryFactory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING));
    }
    return geometryFactory.createPolygon(coordinates.toArray(new Coordinate[coordinates.size()]));
  }
  return null;
}

代码示例来源:origin: Geomatys/geotoolkit

@Override
public MultiPoint apply(Point object) throws UnconvertibleObjectException {
  final MultiPoint geom = object.getFactory().createMultiPoint(new Point[]{object});
  geom.setSRID(object.getSRID());
  geom.setUserData(object.getUserData());
  return geom;
}

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

assertEquals(0, p2.getSRID());
assertEquals(1234, p2.getSRID());

代码示例来源:origin: org.n52.arctic-sea/shetland

factory = pointValuePair.getPoint().getFactory();
if (pointValuePair.getPoint().getSRID() > 0) {
  srid = pointValuePair.getPoint().getSRID();

相关文章