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

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

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

Point.setSRID介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Return a testsuite-suite point (filter, ...)
 *
 * @return a testsuite-suite point
 */
public Point getTestPoint() {
  WKTReader reader = new WKTReader();
  try {
    Point point = (Point) reader.read( TEST_POINT_WKT );
    point.setSRID( getTestSrid() );
    return point;
  }
  catch (ParseException e) {
    throw new RuntimeException( e );
  }
}

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

public void setSRID(int SRID) {
  point.setSRID(SRID);
}

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

/**
   * Generates the point.
   *
   * @param geometryFactory Geometry factory to be used to create the point.
   * @return Created Point.
   */
  public Geometry create(GeometryFactory geometryFactory) {
    Point point = geometryFactory.createPoint(coordinate);
    point.setUserData(getSRS());
    point.setSRID(getSRID());
    return point;
  }
}

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

point.setSRID(SRID);

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

if (attbType.equals(geomAttbType)) {
  Point point = geometryFactory.createPoint(geocodePoint);
  point.setSRID(4326);
  attributes[i] = point;
} else {

代码示例来源:origin: org.n52.sensorweb.sos/api-netcdf

public static Set<Point> getPoints(Geometry geom){
  Set<Point> points = new HashSet<Point>();
  if( geom != null ){
    if( geom instanceof Point ){
      points.add((Point) geom);
    } else if (geom instanceof LineString) {
      LineString lineString = (LineString) geom;
      for (int i = 0; i < lineString.getNumPoints(); i++) {
        Point point = lineString.getPointN(i);
        point.setSRID(lineString.getSRID());
        points.add(point);
      }
    }
  }
  return points;
}

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

public static Set<Point> getPoints(Geometry geom){
  Set<Point> points = new HashSet<Point>();
  if( geom != null ){
    if( geom instanceof Point ){
      points.add((Point) geom);
    } else if (geom instanceof LineString) {
      LineString lineString = (LineString) geom;
      for (int i = 0; i < lineString.getNumPoints(); i++) {
        Point point = lineString.getPointN(i);
        point.setSRID(lineString.getSRID());
        points.add(point);
      }
    }
  }
  return points;
}

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

/**
 * Computes the JTS equivalent of this geometry.
 */
@Override
protected org.locationtech.jts.geom.Geometry computeJTSPeer() {
  org.locationtech.jts.geom.Point result =  JTSUtils.directPositionToPoint(position);
  CoordinateReferenceSystem crs = getCoordinateReferenceSystem();
  if (crs != null) {
    final int srid = SRIDGenerator.toSRID(crs, Version.V1);
    result.setSRID(srid);
  }
  return result;
}

代码示例来源: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: orbisgis/h2gis

Coordinate coordinate = GPXCoordinate.createCoordinate(attributes);
Point geom = getGeometryFactory().createPoint(coordinate);
geom.setSRID(4326);
routePoint.setValue(GpxMetadata.THE_GEOM, geom);
routePoint.setValue(GpxMetadata.PTLAT, coordinate.y);

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

@Test
public void testCRSAccessSRID() throws FactoryException{
  final Point geom = GF.createPoint(new Coordinate(50, 27));
  //should not raise a log
  geom.setSRID(-1);
  CoordinateReferenceSystem crs = JTS.findCoordinateReferenceSystem(geom);
  assertNull(crs);
  //should not raise a log
  geom.setSRID(0);
  crs = JTS.findCoordinateReferenceSystem(geom);
  assertNull(crs);
  geom.setSRID(4326);
  crs = JTS.findCoordinateReferenceSystem(geom);
  assertNotNull(crs);
  assertEquals(CommonCRS.WGS84.geographic(), crs);
}

代码示例来源:origin: orbisgis/h2gis

Coordinate coordinate = GPXCoordinate.createCoordinate(attributes);
Point geom = getGeometryFactory().createPoint(coordinate);
geom.setSRID(4326);
currentPoint.setValue(GpxMetadata.THE_GEOM, geom);
currentPoint.setValue(GpxMetadata.PTLAT, coordinate.y);

代码示例来源:origin: orbisgis/h2gis

Coordinate coordinate = GPXCoordinate.createCoordinate(attributes);
Point geom = getGeometryFactory().createPoint(coordinate);
geom.setSRID(4326);
trackPoint.setValue(GpxMetadata.THE_GEOM, geom);
trackPoint.setValue(GpxMetadata.PTLAT, coordinate.y);

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

/**
 * Get the point from samplingGeometry or featureOfInterest
 *
 * @return The {@link Point}
 */
private Point getPoint() {
  Point point = null;
  if (isSetSpatialFilteringProfileParameter()) {
    Geometry geometry = getSpatialFilteringProfileParameter().getValue().getValue();
    point = geometry.getInteriorPoint();
    point.setSRID(geometry.getSRID());
  } else {
    if (getObservationConstellation().getFeatureOfInterest() instanceof AbstractSamplingFeature
        && ((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest())
            .isSetGeometry()) {
      Geometry geometry =
          ((AbstractSamplingFeature) getObservationConstellation().getFeatureOfInterest()).getGeometry();
      point = geometry.getInteriorPoint();
      point.setSRID(geometry.getSRID());
    }
  }
  return point;
}

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

if (coords.length == 1) {
  Point point = new GeometryFactory().createPoint(coords[0]);
  point.setSRID(srid);
  sf.setGeometry(point);
} else if (coords.length > 1) {

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

public void testSRID() throws Exception {
  GeometryFactory gf = new GeometryFactory();
  Point p1 = gf.createPoint(new Coordinate(1,2));
  p1.setSRID(1234);

相关文章