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

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

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

Point.setSRID介绍

暂无

代码示例

代码示例来源: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: org.geotools/gt-render

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

代码示例来源: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 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.geotools/gt-main

/**
   * 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: org.geotools/gt2-main

/**
   * 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: org.jboss.teiid/teiid-engine

public static GeometryType pointOnSurface(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  Point point = g.getInteriorPoint();
  if (point == null) {
    return null;
  }
  point.setSRID(geom.getSrid());
  return getGeometryType(point);
}

代码示例来源:origin: mstahv/spring-boot-spatial-example

@Bean
    CommandLineRunner init(SpatialEventRepository repo) {
      return (String... strings) -> {
    GeometryFactory factory = new GeometryFactory();
        
        SpatialEvent theEvent = new SpatialEvent();
    theEvent.setTitle("Example event");
    theEvent.setDate(new Date());
    theEvent.setLocation(factory.createPoint(new Coordinate(26, 62)));
        theEvent.getLocation().setSRID(4326);
    repo.save(theEvent);

    SpatialEvent eventWithPath = new SpatialEvent();
    Coordinate[] coords = new Coordinate[]{new Coordinate(22, 60),
      new Coordinate(23, 61), new Coordinate(22, 63)};
    eventWithPath.setRoute(factory.createLineString(coords));
        eventWithPath.getRoute().setSRID(4326);
    eventWithPath.setLocation(factory.createPoint(new Coordinate(22, 60)));
        eventWithPath.getLocation().setSRID(4326);
    eventWithPath.setDate(new Date());
    eventWithPath.setTitle("MTB cup 1/10");
    repo.save(eventWithPath);
        
      };
    }
}

代码示例来源:origin: org.geotools/gt-oracle-spatial

point.setSRID(SRID);

代码示例来源:origin: org.geotools/gt-process-feature

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

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

@Test(expected=ExpressionEvaluationException.class) public void testEwkb() throws Exception {
  WKBWriter writer = new WKBWriter(3, true);
  GeometryFactory gf = new GeometryFactory();
  Point point = gf.createPoint(new Coordinate(0, 0, 0));
  point.setSRID(100);
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  writer.write(point, new OutputStreamOutStream(baos));
  
  Expression ex1 = TestFunctionResolving.getExpression("ST_GeomFromBinary(X'"+new BinaryType(baos.toByteArray())+"', 8307)");
  Evaluator.evaluate(ex1);
}

代码示例来源:origin: org.orbisgis/h2gis-functions

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: org.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: org.orbisgis/h2drivers

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: org.n52.sensorweb.sos/inspire-api

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

代码示例来源:origin: org.orbisgis/h2gis-functions

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.shetland/shetland

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

代码示例来源:origin: org.orbisgis/h2drivers

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.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.sensorweb.sos/inspire-api

/**
 * 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.shetland/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;
}

相关文章