Tabnine Logo
Geometry.setSRID
Code IndexAdd Tabnine to your IDE (free)

How to use
setSRID
method
in
com.vividsolutions.jts.geom.Geometry

Best Java code snippets using com.vividsolutions.jts.geom.Geometry.setSRID (Showing top 20 results out of 315)

origin: com.vividsolutions/jts

/**
 * Sets the SRID, if it was specified in the WKB
 *
 * @param g the geometry to update
 * @return the geometry with an updated SRID value, if required
 */
private Geometry setSRID(Geometry g, int SRID)
{
 if (SRID != 0)
  g.setSRID(SRID);
 return g;
}
origin: com.vividsolutions/jts-core

/**
 * Sets the SRID, if it was specified in the WKB
 *
 * @param g the geometry to update
 * @return the geometry with an updated SRID value, if required
 */
private Geometry setSRID(Geometry g, int SRID)
{
 if (SRID != 0)
  g.setSRID(SRID);
 return g;
}
origin: org.geotools.jdbc/gt-jdbc-db2

/**
 * Sets the SRID, if it was specified in the WKB
 *
 * @param g the geometry to update
 * @return the geometry with an updated SRID value, if required
 */
private Geometry setSRID(Geometry g)
{
 if (SRID != 0)
  g.setSRID(SRID);
 return g;
}
origin: org.geotools/gt-render

public void setSRID(int SRID) {
  geometry.setSRID(SRID);
}
origin: org.geomajas.plugin/geomajas-layer-hibernate

private Geometry asGeometry(Object geometry) {
  if (geometry instanceof Geometry) {
    Geometry geom = (Geometry) geometry;
    geom.setSRID(srid);
    return geom;
  } else {
    throw new IllegalStateException("Cannot handle " + geometry + " as geometry.");
  }
}
origin: org.orbisgis/h2spatial

/**
 * @param geometry Geometry instance
 * @return Geometry envelope
 */
public static Geometry getBoundary(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getBoundary();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.orbisgis/h2gis

/**
 * @param geometry Geometry instance
 * @return Geometry envelope
 */
public static Geometry getBoundary(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getBoundary();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.orbisgis/h2gis-functions

/**
 * @param geometry Geometry instance
 * @return Geometry envelope
 */
public static Geometry getBoundary(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getBoundary();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.orbisgis/h2spatial

/**
 * @param geometry Geometry instance
 * @param srid input SRID
 * @return Geometry envelope
 */
public static Geometry getEnvelope(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getEnvelope();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.orbisgis/h2gis-functions

/**
 * @param geometry Geometry instance
 * @param srid input SRID
 * @return Geometry envelope
 */
public static Geometry getEnvelope(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getEnvelope();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.orbisgis/h2gis

/**
 * @param geometry Geometry instance
 * @param srid input SRID
 * @return Geometry envelope
 */
public static Geometry getEnvelope(Geometry geometry, int srid) {
  if(geometry==null) {
    return null;
  }
  Geometry geometryEnvelope = geometry.getEnvelope();
  geometryEnvelope.setSRID(srid);
  return geometryEnvelope;
}
origin: org.teiid/teiid-engine

public static GeometryType makeEnvelope(double xmin, double ymin,
    double xmax, double ymax, Integer srid) {
  Geometry geom = GEOMETRY_FACTORY.createPolygon(new Coordinate[] {new Coordinate(xmin, ymin), new Coordinate(xmin, ymax), new Coordinate(xmax, ymax), new Coordinate(xmax, ymin), new Coordinate(xmin, ymin)});
  if (srid != null) {
    geom.setSRID(srid);
  }
  return getGeometryType(geom);
}
origin: org.jboss.teiid/teiid-engine

public static GeometryType makeEnvelope(double xmin, double ymin,
    double xmax, double ymax, Integer srid) {
  Geometry geom = GEOMETRY_FACTORY.createPolygon(new Coordinate[] {new Coordinate(xmin, ymin), new Coordinate(xmin, ymax), new Coordinate(xmax, ymax), new Coordinate(xmax, ymin), new Coordinate(xmin, ymin)});
  if (srid != null) {
    geom.setSRID(srid);
  }
  return getGeometryType(geom);
}
origin: teiid/teiid

public static GeometryType makeEnvelope(double xmin, double ymin,
    double xmax, double ymax, Integer srid) {
  Geometry geom = GEOMETRY_FACTORY.createPolygon(new Coordinate[] {new Coordinate(xmin, ymin), new Coordinate(xmin, ymax), new Coordinate(xmax, ymax), new Coordinate(xmax, ymin), new Coordinate(xmin, ymin)});
  if (srid != null) {
    geom.setSRID(srid);
  }
  return getGeometryType(geom);
}
origin: matsim-org/matsim

/**
 * Allows to manually overwrite the coordinate reference system (e.g. if the
 * ZoneLayer is read from a shape file without crs information).
 * 
 * @param crs a coordinate reference system.
 */
public void overwriteCRS(CoordinateReferenceSystem crs) {
  this.crs = crs;
  this.srid = CRSUtils.getSRID(crs);
  for(Zone<?> zone : zones) {
    zone.getGeometry().setSRID(srid);
  }
}
origin: org.teiid/teiid-engine

public static GeometryType getGeometryType(Geometry jtsGeom, int srid) {
  jtsGeom.setSRID(srid);
  byte[] bytes = getBytes(jtsGeom, true);
  GeometryType result = new GeometryType(bytes, srid);
  result.setGeoCache(jtsGeom);
  return result;
}

origin: teiid/teiid

public static GeometryType getGeometryType(Geometry jtsGeom, int srid) {
  jtsGeom.setSRID(srid);
  byte[] bytes = getBytes(jtsGeom, true);
  GeometryType result = new GeometryType(bytes, srid);
  result.setGeoCache(jtsGeom);
  return result;
}

origin: org.hibernatespatial/hibernate-spatial-postgis

private Geometry convertGeometryCollection(GeometryCollection collection) {
  org.postgis.Geometry[] geometries = collection.getGeometries();
  com.vividsolutions.jts.geom.Geometry[] jtsGeometries = new com.vividsolutions.jts.geom.Geometry[geometries.length];
  for (int i = 0; i < geometries.length; i++) {
    jtsGeometries[i] = convert2JTS(geometries[i]);
    //TODO  - refactor this so the following line is not necessary
    jtsGeometries[i].setSRID(0); // convert2JTS sets SRIDs, but constituent geometries in a collection must have srid  == 0 
  }
  com.vividsolutions.jts.geom.GeometryCollection jtsGCollection = getGeometryFactory()
      .createGeometryCollection(jtsGeometries);
  return jtsGCollection;
}
origin: org.hibernatespatial/hibernate-spatial-postgis

private Geometry forceEmptyToGeometryCollection(Geometry jtsGeom) {
  Geometry forced = jtsGeom;
  if (forced.isEmpty()) {
    GeometryFactory factory = jtsGeom.getFactory();
    if (factory == null) {
      factory = HBSpatialExtension.getDefaultGeomFactory();
    }
    forced = factory.createGeometryCollection(null);
    forced.setSRID(jtsGeom.getSRID());
  }
  return forced;
}
origin: org.jboss.teiid/teiid-engine

public static GeometryType polygon(GeometryType geom, int srid) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  if (!(g instanceof LineString)) {
    throw new FunctionExecutionException(QueryPlugin.Event.TEIID31207, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31207));
  }
  LineString ls = (LineString)g;
  Geometry result = GEOMETRY_FACTORY.createPolygon(ls.getCoordinateSequence());
  result.setSRID(srid);
  return getGeometryType(result);
}
com.vividsolutions.jts.geomGeometrysetSRID

Javadoc

Sets the ID of the Spatial Reference System used by the Geometry.

NOTE: This method should only be used for exceptional circumstances or for backwards compatibility. Normally the SRID should be set on the GeometryFactory used to create the geometry. SRIDs set using this method will not be propagated to geometries returned by constructive methods.

Popular methods of Geometry

  • getEnvelopeInternal
    Gets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
  • getCoordinates
    Returns an array containing the values of all the vertices for this geometry. If the geometry is a c
  • isEmpty
    Tests whether the set of points covered by this Geometry is empty.
  • getCentroid
    Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
  • getGeometryN
    Returns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
  • toText
    Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
  • getNumGeometries
    Returns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
  • getFactory
    Gets the factory which contains the context in which this geometry was created.
  • getGeometryType
    Returns the name of this Geometry's actual class.
  • getSRID
    Returns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
  • getCoordinate
    Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
  • intersection
    Computes a Geometry representing the point-set which is common to both this Geometry and the other
  • getCoordinate,
  • intersection,
  • buffer,
  • contains,
  • getArea,
  • getEnvelope,
  • intersects,
  • union,
  • apply,
  • getLength

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now