id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
107,700 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java | ST_3DLength.length3D | public static double length3D(CoordinateSequence points) {
// optimized for processing CoordinateSequences
int numberOfCoords = points.size();
// Points have no length.
if (numberOfCoords < 2) {
return 0.0;
}
Coordinate currentCoord = new Coordinate();
... | java | public static double length3D(CoordinateSequence points) {
// optimized for processing CoordinateSequences
int numberOfCoords = points.size();
// Points have no length.
if (numberOfCoords < 2) {
return 0.0;
}
Coordinate currentCoord = new Coordinate();
... | [
"public",
"static",
"double",
"length3D",
"(",
"CoordinateSequence",
"points",
")",
"{",
"// optimized for processing CoordinateSequences",
"int",
"numberOfCoords",
"=",
"points",
".",
"size",
"(",
")",
";",
"// Points have no length.",
"if",
"(",
"numberOfCoords",
"<",... | Computes the length of a LineString specified by a sequence of
coordinates.
@param points The coordinate sequence
@return The length of the corresponding LineString | [
"Computes",
"the",
"length",
"of",
"a",
"LineString",
"specified",
"by",
"a",
"sequence",
"of",
"coordinates",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java#L108-L148 |
107,701 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java | ST_SunPosition.sunPosition | public static Geometry sunPosition(Geometry point, Date date) throws IllegalArgumentException{
if(point == null){
return null;
}
if (point instanceof Point) {
Coordinate coord = point.getCoordinate();
return point.getFactory().createPoint( SunCalc.getPosition(... | java | public static Geometry sunPosition(Geometry point, Date date) throws IllegalArgumentException{
if(point == null){
return null;
}
if (point instanceof Point) {
Coordinate coord = point.getCoordinate();
return point.getFactory().createPoint( SunCalc.getPosition(... | [
"public",
"static",
"Geometry",
"sunPosition",
"(",
"Geometry",
"point",
",",
"Date",
"date",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"point",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"point",
"instanceof",
"Point",
... | Return the sun position for a given date
@param point
@param date
@return
@throws IllegalArgumentException | [
"Return",
"the",
"sun",
"position",
"for",
"a",
"given",
"date"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java#L68-L78 |
107,702 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.offsetCurve | public static Geometry offsetCurve(Geometry geometry, double offset, String parameters) {
if(geometry == null){
return null;
}
String[] buffParemeters = parameters.split("\\s+");
BufferParameters bufferParameters = new BufferParameters();
for (String params : buffPare... | java | public static Geometry offsetCurve(Geometry geometry, double offset, String parameters) {
if(geometry == null){
return null;
}
String[] buffParemeters = parameters.split("\\s+");
BufferParameters bufferParameters = new BufferParameters();
for (String params : buffPare... | [
"public",
"static",
"Geometry",
"offsetCurve",
"(",
"Geometry",
"geometry",
",",
"double",
"offset",
",",
"String",
"parameters",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"buffParemeters",
"="... | Return an offset line at a given distance and side from an input geometry
@param geometry the geometry
@param offset the distance
@param parameters the buffer parameters
@return | [
"Return",
"an",
"offset",
"line",
"at",
"a",
"given",
"distance",
"and",
"side",
"from",
"an",
"input",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L62-L101 |
107,703 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.computeOffsetCurve | public static Geometry computeOffsetCurve(Geometry geometry, double offset, BufferParameters bufferParameters) {
ArrayList<LineString> lineStrings = new ArrayList<LineString>();
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
i... | java | public static Geometry computeOffsetCurve(Geometry geometry, double offset, BufferParameters bufferParameters) {
ArrayList<LineString> lineStrings = new ArrayList<LineString>();
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
i... | [
"public",
"static",
"Geometry",
"computeOffsetCurve",
"(",
"Geometry",
"geometry",
",",
"double",
"offset",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"ArrayList",
"<",
"LineString",
">",
"lineStrings",
"=",
"new",
"ArrayList",
"<",
"LineString",
">",
... | Method to compute the offset line
@param geometry
@param offset
@param bufferParameters
@return | [
"Method",
"to",
"compute",
"the",
"offset",
"line"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L121-L139 |
107,704 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.lineStringOffSetCurve | public static void lineStringOffSetCurve(ArrayList<LineString> list, LineString lineString, double offset, BufferParameters bufferParameters) {
list.add(lineString.getFactory().createLineString(new OffsetCurveBuilder(lineString.getPrecisionModel(), bufferParameters).getOffsetCurve(lineString.getCoordinates(), o... | java | public static void lineStringOffSetCurve(ArrayList<LineString> list, LineString lineString, double offset, BufferParameters bufferParameters) {
list.add(lineString.getFactory().createLineString(new OffsetCurveBuilder(lineString.getPrecisionModel(), bufferParameters).getOffsetCurve(lineString.getCoordinates(), o... | [
"public",
"static",
"void",
"lineStringOffSetCurve",
"(",
"ArrayList",
"<",
"LineString",
">",
"list",
",",
"LineString",
"lineString",
",",
"double",
"offset",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"list",
".",
"add",
"(",
"lineString",
".",
"g... | Compute the offset curve for a linestring
@param list
@param lineString
@param offset
@param bufferParameters | [
"Compute",
"the",
"offset",
"curve",
"for",
"a",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L149-L151 |
107,705 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.geometryOffSetCurve | public static void geometryOffSetCurve(ArrayList<LineString> list, Geometry geometry, double offset, BufferParameters bufferParameters) {
final List curves = new OffsetCurveSetBuilder(geometry, offset, new OffsetCurveBuilder(geometry.getFactory().getPrecisionModel(), bufferParameters)).getCurves();
fina... | java | public static void geometryOffSetCurve(ArrayList<LineString> list, Geometry geometry, double offset, BufferParameters bufferParameters) {
final List curves = new OffsetCurveSetBuilder(geometry, offset, new OffsetCurveBuilder(geometry.getFactory().getPrecisionModel(), bufferParameters)).getCurves();
fina... | [
"public",
"static",
"void",
"geometryOffSetCurve",
"(",
"ArrayList",
"<",
"LineString",
">",
"list",
",",
"Geometry",
"geometry",
",",
"double",
"offset",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"final",
"List",
"curves",
"=",
"new",
"OffsetCurveSet... | Compute the offset curve for a polygon, a point or a collection of geometries
@param list
@param geometry
@param offset
@param bufferParameters | [
"Compute",
"the",
"offset",
"curve",
"for",
"a",
"polygon",
"a",
"point",
"or",
"a",
"collection",
"of",
"geometries"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L160-L166 |
107,706 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java | ST_LongestLine.longestLine | public static Geometry longestLine(Geometry geomA, Geometry geomB) {
Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance();
if(coords!=null){
return geomA.getFactory().createLineString(coords);
}
return null;
} | java | public static Geometry longestLine(Geometry geomA, Geometry geomB) {
Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance();
if(coords!=null){
return geomA.getFactory().createLineString(coords);
}
return null;
} | [
"public",
"static",
"Geometry",
"longestLine",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
")",
"{",
"Coordinate",
"[",
"]",
"coords",
"=",
"new",
"MaxDistanceOp",
"(",
"geomA",
",",
"geomB",
")",
".",
"getCoordinatesDistance",
"(",
")",
";",
"if",
... | Return the longest line between the points of two geometries.
@param geomA
@param geomB
@return | [
"Return",
"the",
"longest",
"line",
"between",
"the",
"points",
"of",
"two",
"geometries",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java#L50-L56 |
107,707 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java | ST_Force2D.force2D | public static Geometry force2D(Geometry geom) {
if (geom == null) {
return null;
}
return GeometryCoordinateDimension.force(geom, 2);
} | java | public static Geometry force2D(Geometry geom) {
if (geom == null) {
return null;
}
return GeometryCoordinateDimension.force(geom, 2);
} | [
"public",
"static",
"Geometry",
"force2D",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"GeometryCoordinateDimension",
".",
"force",
"(",
"geom",
",",
"2",
")",
";",
"}"
] | Converts a XYZ geometry to XY.
@param geom
@return | [
"Converts",
"a",
"XYZ",
"geometry",
"to",
"XY",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java#L50-L55 |
107,708 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryMetaData.java | GeometryMetaData.getMetaDataFromWKB | public static GeometryMetaData getMetaDataFromWKB(byte[] bytes) throws IOException {
ByteOrderDataInStream dis = new ByteOrderDataInStream();
dis.setInStream(new ByteArrayInStream(bytes));
// determine byte order
byte byteOrderWKB = dis.readByte();
// always set byte order, since... | java | public static GeometryMetaData getMetaDataFromWKB(byte[] bytes) throws IOException {
ByteOrderDataInStream dis = new ByteOrderDataInStream();
dis.setInStream(new ByteArrayInStream(bytes));
// determine byte order
byte byteOrderWKB = dis.readByte();
// always set byte order, since... | [
"public",
"static",
"GeometryMetaData",
"getMetaDataFromWKB",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"ByteOrderDataInStream",
"dis",
"=",
"new",
"ByteOrderDataInStream",
"(",
")",
";",
"dis",
".",
"setInStream",
"(",
"new",
"ByteArrayIn... | Read the first bytes of Geometry WKB.
@param bytes WKB Bytes
@return Geometry MetaData
@throws IOException If WKB meta is invalid (do not check the Geometry) | [
"Read",
"the",
"first",
"bytes",
"of",
"Geometry",
"WKB",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryMetaData.java#L60-L82 |
107,709 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java | ShapefileWriter.writeHeaders | public void writeHeaders(ShapeType type) throws IOException {
try {
handler = type.getShapeHandler();
} catch (ShapefileException se) {
throw new IOException("Error with type " + type, se);
}
if(indexBuffer != null) {
indexBuffer.flush();
}
if(shapeBuffer != null) {
... | java | public void writeHeaders(ShapeType type) throws IOException {
try {
handler = type.getShapeHandler();
} catch (ShapefileException se) {
throw new IOException("Error with type " + type, se);
}
if(indexBuffer != null) {
indexBuffer.flush();
}
if(shapeBuffer != null) {
... | [
"public",
"void",
"writeHeaders",
"(",
"ShapeType",
"type",
")",
"throws",
"IOException",
"{",
"try",
"{",
"handler",
"=",
"type",
".",
"getShapeHandler",
"(",
")",
";",
"}",
"catch",
"(",
"ShapefileException",
"se",
")",
"{",
"throw",
"new",
"IOException",
... | Write the headers for this shapefile.Use this function before inserting the first geometry, then when all geometries are inserted.
@param type Shape type
@throws java.io.IOException | [
"Write",
"the",
"headers",
"for",
"this",
"shapefile",
".",
"Use",
"this",
"function",
"before",
"inserting",
"the",
"first",
"geometry",
"then",
"when",
"all",
"geometries",
"are",
"inserted",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java#L99-L129 |
107,710 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java | ShapefileWriter.writeGeometry | public void writeGeometry(Geometry g) throws IOException {
if(type == null) {
throw new IllegalStateException("Header must be written before writeGeometry");
}
if(bounds != null) {
if(g != null) {
bounds.expandToInclude(g.getEnvelopeInternal());
... | java | public void writeGeometry(Geometry g) throws IOException {
if(type == null) {
throw new IllegalStateException("Header must be written before writeGeometry");
}
if(bounds != null) {
if(g != null) {
bounds.expandToInclude(g.getEnvelopeInternal());
... | [
"public",
"void",
"writeGeometry",
"(",
"Geometry",
"g",
")",
"throws",
"IOException",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Header must be written before writeGeometry\"",
")",
";",
"}",
"if",
"(",
"bou... | Write a single Geometry to this shapefile. The Geometry must be
compatable with the ShapeType assigned during the writing of the headers.
@param g
@throws java.io.IOException | [
"Write",
"a",
"single",
"Geometry",
"to",
"this",
"shapefile",
".",
"The",
"Geometry",
"must",
"be",
"compatable",
"with",
"the",
"ShapeType",
"assigned",
"during",
"the",
"writing",
"of",
"the",
"headers",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java#L138-L173 |
107,711 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java | ShapefileWriter.close | public void close() throws IOException {
indexBuffer.flush();
shapeBuffer.flush();
if (shpChannel != null && shpChannel.isOpen()) {
shpChannel.close();
}
if (shxChannel != null && shxChannel.isOpen()) {
shxChannel.close();
}
shpChannel = null;
shxChannel = null;
handler = null;
indexBuffer = n... | java | public void close() throws IOException {
indexBuffer.flush();
shapeBuffer.flush();
if (shpChannel != null && shpChannel.isOpen()) {
shpChannel.close();
}
if (shxChannel != null && shxChannel.isOpen()) {
shxChannel.close();
}
shpChannel = null;
shxChannel = null;
handler = null;
indexBuffer = n... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"indexBuffer",
".",
"flush",
"(",
")",
";",
"shapeBuffer",
".",
"flush",
"(",
")",
";",
"if",
"(",
"shpChannel",
"!=",
"null",
"&&",
"shpChannel",
".",
"isOpen",
"(",
")",
")",
"{",
"... | Close the underlying Channels.
@throws java.io.IOException | [
"Close",
"the",
"underlying",
"Channels",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java#L180-L194 |
107,712 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.prepareGraph | protected KeyedGraph<V, E> prepareGraph() throws SQLException {
LOGGER.info("Loading graph into memory...");
final long start = System.currentTimeMillis();
// Initialize the graph.
KeyedGraph<V, E> graph;
if (!globalOrientation.equals(GraphFunctionParser.Orientation.UNDIRECTED)) ... | java | protected KeyedGraph<V, E> prepareGraph() throws SQLException {
LOGGER.info("Loading graph into memory...");
final long start = System.currentTimeMillis();
// Initialize the graph.
KeyedGraph<V, E> graph;
if (!globalOrientation.equals(GraphFunctionParser.Orientation.UNDIRECTED)) ... | [
"protected",
"KeyedGraph",
"<",
"V",
",",
"E",
">",
"prepareGraph",
"(",
")",
"throws",
"SQLException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Loading graph into memory...\"",
")",
";",
"final",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
... | Prepares a graph.
@return The newly prepared graph, or null if the graph could not
be created
@throws java.sql.SQLException | [
"Prepares",
"a",
"graph",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L103-L140 |
107,713 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.initIndices | private void initIndices(ResultSet edges) {
try {
ResultSetMetaData metaData = edges.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
final String columnName = metaData.getColumnName(i);
if (columnName.equalsIgnoreCase(START_NODE)) sta... | java | private void initIndices(ResultSet edges) {
try {
ResultSetMetaData metaData = edges.getMetaData();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
final String columnName = metaData.getColumnName(i);
if (columnName.equalsIgnoreCase(START_NODE)) sta... | [
"private",
"void",
"initIndices",
"(",
"ResultSet",
"edges",
")",
"{",
"try",
"{",
"ResultSetMetaData",
"metaData",
"=",
"edges",
".",
"getMetaData",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"metaData",
".",
"getColumnCount",
"(",... | Recovers the indices from the metadata. | [
"Recovers",
"the",
"indices",
"from",
"the",
"metadata",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L145-L168 |
107,714 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.loadEdge | private E loadEdge(KeyedGraph<V, E> graph, ResultSet edges) throws SQLException {
final int startNode = edges.getInt(startNodeIndex);
final int endNode = edges.getInt(endNodeIndex);
final int edgeID = edges.getInt(edgeIDIndex);
double weight = WeightedGraph.DEFAULT_EDGE_WEIGHT;
i... | java | private E loadEdge(KeyedGraph<V, E> graph, ResultSet edges) throws SQLException {
final int startNode = edges.getInt(startNodeIndex);
final int endNode = edges.getInt(endNodeIndex);
final int edgeID = edges.getInt(edgeIDIndex);
double weight = WeightedGraph.DEFAULT_EDGE_WEIGHT;
i... | [
"private",
"E",
"loadEdge",
"(",
"KeyedGraph",
"<",
"V",
",",
"E",
">",
"graph",
",",
"ResultSet",
"edges",
")",
"throws",
"SQLException",
"{",
"final",
"int",
"startNode",
"=",
"edges",
".",
"getInt",
"(",
"startNodeIndex",
")",
";",
"final",
"int",
"en... | Loads an edge into the graph from the current row.
@param graph The graph to which the edges will be added.
@return The newly loaded edge. | [
"Loads",
"an",
"edge",
"into",
"the",
"graph",
"from",
"the",
"current",
"row",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L190-L244 |
107,715 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.loadDoubleEdge | private E loadDoubleEdge(KeyedGraph<V, E> graph,
final int startNode,
final int endNode,
final int edgeID,
final double weight) throws SQLException {
// Note: row is ignored since we only need it... | java | private E loadDoubleEdge(KeyedGraph<V, E> graph,
final int startNode,
final int endNode,
final int edgeID,
final double weight) throws SQLException {
// Note: row is ignored since we only need it... | [
"private",
"E",
"loadDoubleEdge",
"(",
"KeyedGraph",
"<",
"V",
",",
"E",
">",
"graph",
",",
"final",
"int",
"startNode",
",",
"final",
"int",
"endNode",
",",
"final",
"int",
"edgeID",
",",
"final",
"double",
"weight",
")",
"throws",
"SQLException",
"{",
... | In directed graphs, undirected edges are represented by directed edges
in both directions. The edges are assigned ids with opposite signs.
@param graph The graph to which the edges will be added.
@param startNode Start node id
@param endNode End Node id
@param edgeID Edge id
@return One of the two directed e... | [
"In",
"directed",
"graphs",
"undirected",
"edges",
"are",
"represented",
"by",
"directed",
"edges",
"in",
"both",
"directions",
".",
"The",
"edges",
"are",
"assigned",
"ids",
"with",
"opposite",
"signs",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L258-L270 |
107,716 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.setEdgeWeight | private void setEdgeWeight(E edge, final double weight) throws SQLException {
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(weight);
}
} | java | private void setEdgeWeight(E edge, final double weight) throws SQLException {
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(weight);
}
} | [
"private",
"void",
"setEdgeWeight",
"(",
"E",
"edge",
",",
"final",
"double",
"weight",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"edge",
"!=",
"null",
"&&",
"weightColumnIndex",
"!=",
"-",
"1",
")",
"{",
"edge",
".",
"setWeight",
"(",
"weight",
")"... | Set this edge's weight to the weight contained in the current row.
@param edge Edge
@throws SQLException If the weight cannot be retrieved | [
"Set",
"this",
"edge",
"s",
"weight",
"to",
"the",
"weight",
"contained",
"in",
"the",
"current",
"row",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L278-L282 |
107,717 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_GeometryN.java | ST_GeometryN.getGeometryN | public static Geometry getGeometryN(Geometry geometry, Integer n) throws SQLException {
if (geometry == null) {
return null;
}
if (n >= 1 && n <= geometry.getNumGeometries()) {
return geometry.getGeometryN(n - 1);
} else {
throw new SQLException(OUT_OF... | java | public static Geometry getGeometryN(Geometry geometry, Integer n) throws SQLException {
if (geometry == null) {
return null;
}
if (n >= 1 && n <= geometry.getNumGeometries()) {
return geometry.getGeometryN(n - 1);
} else {
throw new SQLException(OUT_OF... | [
"public",
"static",
"Geometry",
"getGeometryN",
"(",
"Geometry",
"geometry",
",",
"Integer",
"n",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"n",
">=",
"1",
"&&",
"n",
"<=",... | Return Geometry number n from the given GeometryCollection.
@param geometry GeometryCollection
@param n Index of Geometry number n in [1-N]
@return Geometry number n or Null if parameter is null.
@throws SQLException | [
"Return",
"Geometry",
"number",
"n",
"from",
"the",
"given",
"GeometryCollection",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_GeometryN.java#L61-L70 |
107,718 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java | ST_Holes.getHoles | public static GeometryCollection getHoles(Geometry geom) throws SQLException {
if (geom != null) {
if (geom.getDimension() >= 2) {
ArrayList<Geometry> holes = new ArrayList<Geometry>();
for (int i = 0; i < geom.getNumGeometries(); i++) {
Geometry s... | java | public static GeometryCollection getHoles(Geometry geom) throws SQLException {
if (geom != null) {
if (geom.getDimension() >= 2) {
ArrayList<Geometry> holes = new ArrayList<Geometry>();
for (int i = 0; i < geom.getNumGeometries(); i++) {
Geometry s... | [
"public",
"static",
"GeometryCollection",
"getHoles",
"(",
"Geometry",
"geom",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"if",
"(",
"geom",
".",
"getDimension",
"(",
")",
">=",
"2",
")",
"{",
"ArrayList",
"<",
"Geomet... | Returns the given geometry's holes as a GeometryCollection.
@param geom Geometry
@return The geometry's holes
@throws SQLException | [
"Returns",
"the",
"given",
"geometry",
"s",
"holes",
"as",
"a",
"GeometryCollection",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java#L61-L83 |
107,719 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/MultiPointHandler.java | MultiPointHandler.getLength | @Override
public int getLength(Object geometry) {
MultiPoint mp = (MultiPoint) geometry;
int length;
if (shapeType == ShapeType.MULTIPOINT) {
// two doubles per coord (16 * numgeoms) + 40 for header
length = (mp.ge... | java | @Override
public int getLength(Object geometry) {
MultiPoint mp = (MultiPoint) geometry;
int length;
if (shapeType == ShapeType.MULTIPOINT) {
// two doubles per coord (16 * numgeoms) + 40 for header
length = (mp.ge... | [
"@",
"Override",
"public",
"int",
"getLength",
"(",
"Object",
"geometry",
")",
"{",
"MultiPoint",
"mp",
"=",
"(",
"MultiPoint",
")",
"geometry",
";",
"int",
"length",
";",
"if",
"(",
"shapeType",
"==",
"ShapeType",
".",
"MULTIPOINT",
")",
"{",
"// two doub... | Calcuates the record length of this object.
@return int The length of the record that this shapepoint will take up in a shapefile | [
"Calcuates",
"the",
"record",
"length",
"of",
"this",
"object",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/MultiPointHandler.java#L69-L90 |
107,720 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java | SpatialRefRegistry.formatKey | private static String formatKey(String prjKey) {
String formatKey = prjKey;
if (prjKey.startsWith("+")) {
formatKey = prjKey.substring(1);
}
return formatKey;
} | java | private static String formatKey(String prjKey) {
String formatKey = prjKey;
if (prjKey.startsWith("+")) {
formatKey = prjKey.substring(1);
}
return formatKey;
} | [
"private",
"static",
"String",
"formatKey",
"(",
"String",
"prjKey",
")",
"{",
"String",
"formatKey",
"=",
"prjKey",
";",
"if",
"(",
"prjKey",
".",
"startsWith",
"(",
"\"+\"",
")",
")",
"{",
"formatKey",
"=",
"prjKey",
".",
"substring",
"(",
"1",
")",
... | Remove + char if exists
@param prjKey represents a proj key parameter
@return a new string without + char | [
"Remove",
"+",
"char",
"if",
"exists"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java#L97-L103 |
107,721 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.getSRID | public static int getSRID(File prjFile) throws IOException {
int srid = 0;
if (prjFile == null) {
log.debug("This prj file is null. \n A default srid equals to 0 will be added.");
} else {
PrjParser parser = new PrjParser();
String prjString = readPRJFile(prjF... | java | public static int getSRID(File prjFile) throws IOException {
int srid = 0;
if (prjFile == null) {
log.debug("This prj file is null. \n A default srid equals to 0 will be added.");
} else {
PrjParser parser = new PrjParser();
String prjString = readPRJFile(prjF... | [
"public",
"static",
"int",
"getSRID",
"(",
"File",
"prjFile",
")",
"throws",
"IOException",
"{",
"int",
"srid",
"=",
"0",
";",
"if",
"(",
"prjFile",
"==",
"null",
")",
"{",
"log",
".",
"debug",
"(",
"\"This prj file is null. \\n A default srid equals to 0 will b... | Return the SRID value stored in a prj file
If the the prj file
- is null,
- is empty
then a default srid equals to 0 is added.
@param prjFile
@return
@throws IOException | [
"Return",
"the",
"SRID",
"value",
"stored",
"in",
"a",
"prj",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L59-L79 |
107,722 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.readPRJFile | private static String readPRJFile(File prjFile) throws FileNotFoundException, IOException {
try (FileInputStream fis = new FileInputStream(prjFile)) {
BufferedReader r = new BufferedReader(new InputStreamReader(fis, Charset.defaultCharset()));
StringBuilder b = new StringBuilder();
... | java | private static String readPRJFile(File prjFile) throws FileNotFoundException, IOException {
try (FileInputStream fis = new FileInputStream(prjFile)) {
BufferedReader r = new BufferedReader(new InputStreamReader(fis, Charset.defaultCharset()));
StringBuilder b = new StringBuilder();
... | [
"private",
"static",
"String",
"readPRJFile",
"(",
"File",
"prjFile",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"prjFile",
")",
")",
"{",
"BufferedReader",
"r",
"=",... | Return the content of the PRJ file as a single string
@param prjFile
@return
@throws FileNotFoundException
@throws IOException | [
"Return",
"the",
"content",
"of",
"the",
"PRJ",
"file",
"as",
"a",
"single",
"string"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L111-L120 |
107,723 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.writePRJ | public static void writePRJ(Connection connection, TableLocation location, String geomField, File fileName) throws SQLException, FileNotFoundException {
int srid = SFSUtilities.getSRID(connection, location, geomField);
writePRJ(connection, srid, fileName);
} | java | public static void writePRJ(Connection connection, TableLocation location, String geomField, File fileName) throws SQLException, FileNotFoundException {
int srid = SFSUtilities.getSRID(connection, location, geomField);
writePRJ(connection, srid, fileName);
} | [
"public",
"static",
"void",
"writePRJ",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
",",
"String",
"geomField",
",",
"File",
"fileName",
")",
"throws",
"SQLException",
",",
"FileNotFoundException",
"{",
"int",
"srid",
"=",
"SFSUtilities",
".... | Write a prj file according the SRID code of an input table
@param connection database connection
@param location input table name
@param geomField geometry field name
@param fileName path of the prj file
@throws SQLException
@throws FileNotFoundException | [
"Write",
"a",
"prj",
"file",
"according",
"the",
"SRID",
"code",
"of",
"an",
"input",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L132-L135 |
107,724 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.writePRJ | public static void writePRJ(Connection connection, int srid, File fileName) throws SQLException, FileNotFoundException {
if (srid != 0) {
StringBuilder sb = new StringBuilder("SELECT SRTEXT FROM ");
sb.append("PUBLIC.SPATIAL_REF_SYS ").append(" WHERE SRID = ?");
PreparedState... | java | public static void writePRJ(Connection connection, int srid, File fileName) throws SQLException, FileNotFoundException {
if (srid != 0) {
StringBuilder sb = new StringBuilder("SELECT SRTEXT FROM ");
sb.append("PUBLIC.SPATIAL_REF_SYS ").append(" WHERE SRID = ?");
PreparedState... | [
"public",
"static",
"void",
"writePRJ",
"(",
"Connection",
"connection",
",",
"int",
"srid",
",",
"File",
"fileName",
")",
"throws",
"SQLException",
",",
"FileNotFoundException",
"{",
"if",
"(",
"srid",
"!=",
"0",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",... | Write a prj file according a given SRID code.
@param connection database connection
@param srid srid code
@param fileName path of the prj file
@throws SQLException
@throws FileNotFoundException | [
"Write",
"a",
"prj",
"file",
"according",
"a",
"given",
"SRID",
"code",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L146-L172 |
107,725 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.isSRIDValid | public static boolean isSRIDValid(int srid, Connection connection) throws SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
String queryCheck = "SELECT count(SRID) from PUBLIC.SPATIAL_REF_SYS WHERE SRID = ?";
try {
ps = connection.prepareStatement(queryCheck);
... | java | public static boolean isSRIDValid(int srid, Connection connection) throws SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
String queryCheck = "SELECT count(SRID) from PUBLIC.SPATIAL_REF_SYS WHERE SRID = ?";
try {
ps = connection.prepareStatement(queryCheck);
... | [
"public",
"static",
"boolean",
"isSRIDValid",
"(",
"int",
"srid",
",",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"String",
"queryCheck",
"=",
"\"SELECT count(... | This method checks if a SRID value is valid according a list of SRID's
avalaible on spatial_ref table of the datababase.
@param srid
@param connection
@return
@throws java.sql.SQLException | [
"This",
"method",
"checks",
"if",
"a",
"SRID",
"value",
"is",
"valid",
"according",
"a",
"list",
"of",
"SRID",
"s",
"avalaible",
"on",
"spatial_ref",
"table",
"of",
"the",
"datababase",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L184-L204 |
107,726 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java | FileUtil.isFileImportable | public static boolean isFileImportable(File file, String prefix) throws SQLException, FileNotFoundException{
if (isExtensionWellFormated(file, prefix)) {
if (file.exists()) {
return true;
} else {
throw new FileNotFoundException("The following file does no... | java | public static boolean isFileImportable(File file, String prefix) throws SQLException, FileNotFoundException{
if (isExtensionWellFormated(file, prefix)) {
if (file.exists()) {
return true;
} else {
throw new FileNotFoundException("The following file does no... | [
"public",
"static",
"boolean",
"isFileImportable",
"(",
"File",
"file",
",",
"String",
"prefix",
")",
"throws",
"SQLException",
",",
"FileNotFoundException",
"{",
"if",
"(",
"isExtensionWellFormated",
"(",
"file",
",",
"prefix",
")",
")",
"{",
"if",
"(",
"file... | Check if the file is well formatted regarding an extension prefix.
Check also if the file doesn't exist.
@param file
@param prefix
@return
@throws SQLException
@throws java.io.FileNotFoundException | [
"Check",
"if",
"the",
"file",
"is",
"well",
"formatted",
"regarding",
"an",
"extension",
"prefix",
".",
"Check",
"also",
"if",
"the",
"file",
"doesn",
"t",
"exist",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java#L44-L54 |
107,727 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java | FileUtil.isExtensionWellFormated | public static boolean isExtensionWellFormated(File file, String prefix) {
String path = file.getAbsolutePath();
String extension = "";
int i = path.lastIndexOf('.');
if (i >= 0) {
extension = path.substring(i + 1);
}
return extension.equalsIgnoreCase(prefix);
... | java | public static boolean isExtensionWellFormated(File file, String prefix) {
String path = file.getAbsolutePath();
String extension = "";
int i = path.lastIndexOf('.');
if (i >= 0) {
extension = path.substring(i + 1);
}
return extension.equalsIgnoreCase(prefix);
... | [
"public",
"static",
"boolean",
"isExtensionWellFormated",
"(",
"File",
"file",
",",
"String",
"prefix",
")",
"{",
"String",
"path",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"extension",
"=",
"\"\"",
";",
"int",
"i",
"=",
"path",
".",
... | Check if the file has the good extension
@param file
@param prefix
@return | [
"Check",
"if",
"the",
"file",
"has",
"the",
"good",
"extension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java#L62-L70 |
107,728 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java | FileEngine.getUniqueColumnName | public static String getUniqueColumnName(String base, List<Column> columns) {
String cursor = base;
int cpt = 2;
boolean findDuplicate= true;
while(findDuplicate) {
findDuplicate = false;
for (Column column : columns) {
if (column.getName().equalsI... | java | public static String getUniqueColumnName(String base, List<Column> columns) {
String cursor = base;
int cpt = 2;
boolean findDuplicate= true;
while(findDuplicate) {
findDuplicate = false;
for (Column column : columns) {
if (column.getName().equalsI... | [
"public",
"static",
"String",
"getUniqueColumnName",
"(",
"String",
"base",
",",
"List",
"<",
"Column",
">",
"columns",
")",
"{",
"String",
"cursor",
"=",
"base",
";",
"int",
"cpt",
"=",
"2",
";",
"boolean",
"findDuplicate",
"=",
"true",
";",
"while",
"(... | Compute unique column name among the other columns
@param base Returned name if there is no duplicate
@param columns Other existing columns
@return Unique column name | [
"Compute",
"unique",
"column",
"name",
"among",
"the",
"other",
"columns"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java#L84-L101 |
107,729 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java | ST_Snap.snap | public static Geometry snap(Geometry geometryA, Geometry geometryB, double distance) {
if(geometryA == null||geometryB == null){
return null;
}
Geometry[] snapped = GeometrySnapper.snap(geometryA, geometryB, distance);
return snapped[0];
} | java | public static Geometry snap(Geometry geometryA, Geometry geometryB, double distance) {
if(geometryA == null||geometryB == null){
return null;
}
Geometry[] snapped = GeometrySnapper.snap(geometryA, geometryB, distance);
return snapped[0];
} | [
"public",
"static",
"Geometry",
"snap",
"(",
"Geometry",
"geometryA",
",",
"Geometry",
"geometryB",
",",
"double",
"distance",
")",
"{",
"if",
"(",
"geometryA",
"==",
"null",
"||",
"geometryB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Geometry"... | Snaps two geometries together with a given tolerance
@param geometryA a geometry to snap
@param geometryB a geometry to snap
@param distance the tolerance to use
@return the snapped geometries | [
"Snaps",
"two",
"geometries",
"together",
"with",
"a",
"given",
"tolerance"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java#L51-L57 |
107,730 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java | ST_UpdateZ.updateZ | public static Geometry updateZ(Geometry geometry, double z, int updateCondition) throws SQLException {
if(geometry == null){
return null;
}
if (updateCondition == 1 || updateCondition == 2 || updateCondition == 3) {
Geometry outPut = geometry.copy();
outPut.ap... | java | public static Geometry updateZ(Geometry geometry, double z, int updateCondition) throws SQLException {
if(geometry == null){
return null;
}
if (updateCondition == 1 || updateCondition == 2 || updateCondition == 3) {
Geometry outPut = geometry.copy();
outPut.ap... | [
"public",
"static",
"Geometry",
"updateZ",
"(",
"Geometry",
"geometry",
",",
"double",
"z",
",",
"int",
"updateCondition",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"updateCond... | Replace the z value depending on the condition.
@param geometry
@param z
@param updateCondition set if the NaN value must be updated or not
@return
@throws java.sql.SQLException | [
"Replace",
"the",
"z",
"value",
"depending",
"on",
"the",
"condition",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java#L74-L86 |
107,731 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java | GpxPreparser.read | public boolean read(File inputFile) throws SAXException, IOException {
boolean success = false;
try (FileInputStream fs = new FileInputStream(inputFile)) {
XMLReader parser = XMLReaderFactory.createXMLReader();
parser.setErrorHandler(this);
parser.setContentHandler(th... | java | public boolean read(File inputFile) throws SAXException, IOException {
boolean success = false;
try (FileInputStream fs = new FileInputStream(inputFile)) {
XMLReader parser = XMLReaderFactory.createXMLReader();
parser.setErrorHandler(this);
parser.setContentHandler(th... | [
"public",
"boolean",
"read",
"(",
"File",
"inputFile",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"boolean",
"success",
"=",
"false",
";",
"try",
"(",
"FileInputStream",
"fs",
"=",
"new",
"FileInputStream",
"(",
"inputFile",
")",
")",
"{",
"XMLR... | Reads the document and pre-parses it. The other method is called
automatically when a start markup is found.
@param inputFile the file to read
@return a boolean if the parser ends successfully or not
@throws SAXException
@throws IOException | [
"Reads",
"the",
"document",
"and",
"pre",
"-",
"parses",
"it",
".",
"The",
"other",
"method",
"is",
"called",
"automatically",
"when",
"a",
"start",
"markup",
"is",
"found",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java#L75-L85 |
107,732 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java | GpxPreparser.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.compareToIgnoreCase(GPXTags.GPX) == 0) {
version = attributes.getValue(GPXTags.VERSION);
} else if (localName.compareToIgnoreCase(GPXTags.RTE) == 0) {... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.compareToIgnoreCase(GPXTags.GPX) == 0) {
version = attributes.getValue(GPXTags.VERSION);
} else if (localName.compareToIgnoreCase(GPXTags.RTE) == 0) {... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"localName",
".",
"compareToIgnoreCase",
"(",
"GPXTags",
... | Fires whenever an XML start markup is encountered. It indicates which
version of gpx file is to be parsed. It counts the waypoints, routes,
routepoints, tracks, track segments and trackpoints.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the loca... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
".",
"It",
"indicates",
"which",
"version",
"of",
"gpx",
"file",
"is",
"to",
"be",
"parsed",
".",
"It",
"counts",
"the",
"waypoints",
"routes",
"routepoints",
"tracks",
"track",
"segme... | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java#L100-L117 |
107,733 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.contains3D | public static boolean contains3D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals3D(coord)) {
return true;
}
}
return false;
} | java | public static boolean contains3D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals3D(coord)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains3D",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"Coordinate",
"coord",
")",
"{",
"for",
"(",
"Coordinate",
"coordinate",
":",
"coords",
")",
"{",
"if",
"(",
"coordinate",
".",
"equals3D",
"(",
"coord",
")",
")",
"... | Check if a coordinate array contains a specific coordinate.
The equality is done in 3D (z values ARE checked).
@param coords
@param coord
@return | [
"Check",
"if",
"a",
"coordinate",
"array",
"contains",
"a",
"specific",
"coordinate",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L89-L96 |
107,734 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.getFurthestCoordinate | public static Coordinate[] getFurthestCoordinate(Coordinate base, Coordinate[] coords) {
double distanceMax = Double.MIN_VALUE;
Coordinate farCoordinate = null;
for (Coordinate coord : coords) {
double distance = coord.distance(base);
... | java | public static Coordinate[] getFurthestCoordinate(Coordinate base, Coordinate[] coords) {
double distanceMax = Double.MIN_VALUE;
Coordinate farCoordinate = null;
for (Coordinate coord : coords) {
double distance = coord.distance(base);
... | [
"public",
"static",
"Coordinate",
"[",
"]",
"getFurthestCoordinate",
"(",
"Coordinate",
"base",
",",
"Coordinate",
"[",
"]",
"coords",
")",
"{",
"double",
"distanceMax",
"=",
"Double",
".",
"MIN_VALUE",
";",
"Coordinate",
"farCoordinate",
"=",
"null",
";",
"fo... | Find the furthest coordinate in a geometry from a base coordinate
@param base
@param coords
@return the base coordinate and the target coordinate | [
"Find",
"the",
"furthest",
"coordinate",
"in",
"a",
"geometry",
"from",
"a",
"base",
"coordinate"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L147-L163 |
107,735 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.length3D | public static double length3D(CoordinateSequence pts) {
// optimized for processing CoordinateSequences
int n = pts.size();
if (n <= 1) {
return 0.0;
}
double len = 0.0;
Coordinate p = new Coordinat... | java | public static double length3D(CoordinateSequence pts) {
// optimized for processing CoordinateSequences
int n = pts.size();
if (n <= 1) {
return 0.0;
}
double len = 0.0;
Coordinate p = new Coordinat... | [
"public",
"static",
"double",
"length3D",
"(",
"CoordinateSequence",
"pts",
")",
"{",
"// optimized for processing CoordinateSequences",
"int",
"n",
"=",
"pts",
".",
"size",
"(",
")",
";",
"if",
"(",
"n",
"<=",
"1",
")",
"{",
"return",
"0.0",
";",
"}",
"do... | Computes the length of a linestring specified by a sequence of points.
if a coordinate has a NaN z return 0.
@param pts
the points specifying the linestring
@return the length of the linestring | [
"Computes",
"the",
"length",
"of",
"a",
"linestring",
"specified",
"by",
"a",
"sequence",
"of",
"points",
".",
"if",
"a",
"coordinate",
"has",
"a",
"NaN",
"z",
"return",
"0",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L173-L211 |
107,736 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.length3D | public static double length3D(Geometry geom) {
double sum = 0;
for (int i = 0; i < geom.getNumGeometries(); i++) {
Geometry subGeom = geom.getGeometryN(i);
if (subGeom instanceof Polygon) {
sum += length3D((P... | java | public static double length3D(Geometry geom) {
double sum = 0;
for (int i = 0; i < geom.getNumGeometries(); i++) {
Geometry subGeom = geom.getGeometryN(i);
if (subGeom instanceof Polygon) {
sum += length3D((P... | [
"public",
"static",
"double",
"length3D",
"(",
"Geometry",
"geom",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"geom",
".",
"getNumGeometries",
"(",
")",
";",
"i",
"++",
")",
"{",
"Geometry",
"subGeom"... | Returns the 3D length of the geometry
@param geom
@return | [
"Returns",
"the",
"3D",
"length",
"of",
"the",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L220-L231 |
107,737 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.length3D | public static double length3D(Polygon polygon) {
double len = 0.0;
len += length3D(polygon.getExteriorRing().getCoordinateSequence());
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
len += length3D(polygon.getInteriorRingN(i));
... | java | public static double length3D(Polygon polygon) {
double len = 0.0;
len += length3D(polygon.getExteriorRing().getCoordinateSequence());
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
len += length3D(polygon.getInteriorRingN(i));
... | [
"public",
"static",
"double",
"length3D",
"(",
"Polygon",
"polygon",
")",
"{",
"double",
"len",
"=",
"0.0",
";",
"len",
"+=",
"length3D",
"(",
"polygon",
".",
"getExteriorRing",
"(",
")",
".",
"getCoordinateSequence",
"(",
")",
")",
";",
"for",
"(",
"int... | Returns the 3D perimeter of a polygon
@param polygon
@return | [
"Returns",
"the",
"3D",
"perimeter",
"of",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L249-L256 |
107,738 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java | IntegerRange.createArray | public static ValueArray createArray(int begin, int end, int step) {
if (end < begin) {
throw new IllegalArgumentException("End must be greater or equal to begin");
}
int nbClasses = (int) ((end - begin) / step);
ValueInt[] getArray = new ValueInt[nbClasses];
for (int... | java | public static ValueArray createArray(int begin, int end, int step) {
if (end < begin) {
throw new IllegalArgumentException("End must be greater or equal to begin");
}
int nbClasses = (int) ((end - begin) / step);
ValueInt[] getArray = new ValueInt[nbClasses];
for (int... | [
"public",
"static",
"ValueArray",
"createArray",
"(",
"int",
"begin",
",",
"int",
"end",
",",
"int",
"step",
")",
"{",
"if",
"(",
"end",
"<",
"begin",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"End must be greater or equal to begin\"",
")",
... | Return an array of integers
@param begin from start
@param end to end
@param step increment
@return | [
"Return",
"an",
"array",
"of",
"integers"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java#L62-L73 |
107,739 | orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/Driver.java | Driver.mangleURL | public static String mangleURL(String url) throws SQLException {
if (url.startsWith(POSTGIS_H2PROTOCOL)) {
return POSTGIS_PROTOCOL + url.substring(POSTGIS_H2PROTOCOL.length());
} else {
throw new SQLException("Unknown protocol or subprotocol in url " + url);
}
} | java | public static String mangleURL(String url) throws SQLException {
if (url.startsWith(POSTGIS_H2PROTOCOL)) {
return POSTGIS_PROTOCOL + url.substring(POSTGIS_H2PROTOCOL.length());
} else {
throw new SQLException("Unknown protocol or subprotocol in url " + url);
}
} | [
"public",
"static",
"String",
"mangleURL",
"(",
"String",
"url",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"url",
".",
"startsWith",
"(",
"POSTGIS_H2PROTOCOL",
")",
")",
"{",
"return",
"POSTGIS_PROTOCOL",
"+",
"url",
".",
"substring",
"(",
"POSTGIS_H2PROT... | Mangles the PostGIS URL to return the original PostGreSQL URL.
@return Mangled PostGIS URL | [
"Mangles",
"the",
"PostGIS",
"URL",
"to",
"return",
"the",
"original",
"PostGreSQL",
"URL",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/Driver.java#L62-L68 |
107,740 | orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/Driver.java | Driver.acceptsURL | public boolean acceptsURL(String url) {
try {
url = mangleURL(url);
} catch (SQLException e) {
return false;
}
return super.acceptsURL(url);
} | java | public boolean acceptsURL(String url) {
try {
url = mangleURL(url);
} catch (SQLException e) {
return false;
}
return super.acceptsURL(url);
} | [
"public",
"boolean",
"acceptsURL",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"url",
"=",
"mangleURL",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"super",
".",
"acceptsURL",
"(",
"u... | Check whether the driver thinks he can handle the given URL.
@see java.sql.Driver#acceptsURL
@param url the URL of the driver.
@return true if this driver accepts the given URL. | [
"Check",
"whether",
"the",
"driver",
"thinks",
"he",
"can",
"handle",
"the",
"given",
"URL",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/Driver.java#L79-L86 |
107,741 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.hasField | public static boolean hasField(Connection connection, String tableName, String fieldName) throws SQLException {
final Statement statement = connection.createStatement();
try {
final ResultSet resultSet = statement.executeQuery(
"SELECT * FROM " + TableLocation.parse(table... | java | public static boolean hasField(Connection connection, String tableName, String fieldName) throws SQLException {
final Statement statement = connection.createStatement();
try {
final ResultSet resultSet = statement.executeQuery(
"SELECT * FROM " + TableLocation.parse(table... | [
"public",
"static",
"boolean",
"hasField",
"(",
"Connection",
"connection",
",",
"String",
"tableName",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"final",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"... | Return true if table tableName contains field fieldName.
@param connection Connection
@param tableName Table name
@param fieldName Field name
@return True if the table contains the field
@throws SQLException | [
"Return",
"true",
"if",
"table",
"tableName",
"contains",
"field",
"fieldName",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L89-L104 |
107,742 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getFieldIndex | public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fieldName) throws SQLException {
for(int columnId = 1; columnId <= resultSetMetaData.getColumnCount(); columnId++) {
if(fieldName.equalsIgnoreCase(resultSetMetaData.getColumnName(columnId))) {
return columnId... | java | public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fieldName) throws SQLException {
for(int columnId = 1; columnId <= resultSetMetaData.getColumnCount(); columnId++) {
if(fieldName.equalsIgnoreCase(resultSetMetaData.getColumnName(columnId))) {
return columnId... | [
"public",
"static",
"int",
"getFieldIndex",
"(",
"ResultSetMetaData",
"resultSetMetaData",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"int",
"columnId",
"=",
"1",
";",
"columnId",
"<=",
"resultSetMetaData",
".",
"getColumnCount",
"... | Fetch the metadata, and check field name
@param resultSetMetaData Active result set meta data.
@param fieldName Field name, ignore case
@return The field index [1-n]; -1 if the field is not found
@throws SQLException | [
"Fetch",
"the",
"metadata",
"and",
"check",
"field",
"name"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L117-L124 |
107,743 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getFieldNames | public static List<String> getFieldNames(DatabaseMetaData meta, String table) throws SQLException {
List<String> fieldNameList = new ArrayList<String>();
TableLocation location = TableLocation.parse(table);
ResultSet rs = meta.getColumns(location.getCatalog(null), location.getSchema(null), locat... | java | public static List<String> getFieldNames(DatabaseMetaData meta, String table) throws SQLException {
List<String> fieldNameList = new ArrayList<String>();
TableLocation location = TableLocation.parse(table);
ResultSet rs = meta.getColumns(location.getCatalog(null), location.getSchema(null), locat... | [
"public",
"static",
"List",
"<",
"String",
">",
"getFieldNames",
"(",
"DatabaseMetaData",
"meta",
",",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"fieldNameList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
... | Returns the list of all the field name of a table.
@param meta DataBase meta data
@param table Table identifier [[catalog.]schema.]table
@return The list of field name.
@throws SQLException If jdbc throws an error | [
"Returns",
"the",
"list",
"of",
"all",
"the",
"field",
"name",
"of",
"a",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L156-L168 |
107,744 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getRowCount | public static int getRowCount(Connection connection, String tableReference) throws SQLException {
Statement st = connection.createStatement();
int rowCount = 0;
try {
ResultSet rs = st.executeQuery(String.format("select count(*) rowcount from %s", TableLocation.parse(tableReference))... | java | public static int getRowCount(Connection connection, String tableReference) throws SQLException {
Statement st = connection.createStatement();
int rowCount = 0;
try {
ResultSet rs = st.executeQuery(String.format("select count(*) rowcount from %s", TableLocation.parse(tableReference))... | [
"public",
"static",
"int",
"getRowCount",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"int",
"rowCount",
"=",
"0",
";",
"try"... | Fetch the row count of a table.
@param connection Active connection.
@param tableReference Table reference
@return Row count
@throws SQLException If the table does not exists, or sql request fail. | [
"Fetch",
"the",
"row",
"count",
"of",
"a",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L177-L193 |
107,745 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.isTemporaryTable | public static boolean isTemporaryTable(Connection connection, String tableReference) throws SQLException {
TableLocation location = TableLocation.parse(tableReference);
ResultSet rs = getTablesView(connection, location.getCatalog(), location.getSchema(), location.getTable());
boolean isTemporary... | java | public static boolean isTemporaryTable(Connection connection, String tableReference) throws SQLException {
TableLocation location = TableLocation.parse(tableReference);
ResultSet rs = getTablesView(connection, location.getCatalog(), location.getSchema(), location.getTable());
boolean isTemporary... | [
"public",
"static",
"boolean",
"isTemporaryTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"location",
"=",
"TableLocation",
".",
"parse",
"(",
"tableReference",
")",
";",
"ResultSet",
"r... | Read INFORMATION_SCHEMA.TABLES in order to see if the provided table reference is a temporary table.
@param connection Active connection not closed by this method
@param tableReference Table reference
@return True if the provided table is temporary.
@throws SQLException If the table does not exists. | [
"Read",
"INFORMATION_SCHEMA",
".",
"TABLES",
"in",
"order",
"to",
"see",
"if",
"the",
"provided",
"table",
"reference",
"is",
"a",
"temporary",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L202-L224 |
107,746 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.isLinkedTable | public static boolean isLinkedTable(Connection connection, String tableReference) throws SQLException {
TableLocation location = TableLocation.parse(tableReference);
ResultSet rs = getTablesView(connection, location.getCatalog(), location.getSchema(), location.getTable());
boolean isLinked;
... | java | public static boolean isLinkedTable(Connection connection, String tableReference) throws SQLException {
TableLocation location = TableLocation.parse(tableReference);
ResultSet rs = getTablesView(connection, location.getCatalog(), location.getSchema(), location.getTable());
boolean isLinked;
... | [
"public",
"static",
"boolean",
"isLinkedTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"location",
"=",
"TableLocation",
".",
"parse",
"(",
"tableReference",
")",
";",
"ResultSet",
"rs",... | Read INFORMATION_SCHEMA.TABLES in order to see if the provided table reference is a linked table.
@param connection Active connection not closed by this method
@param tableReference Table reference
@return True if the provided table is linked.
@throws SQLException If the table does not exists. | [
"Read",
"INFORMATION_SCHEMA",
".",
"TABLES",
"in",
"order",
"to",
"see",
"if",
"the",
"provided",
"table",
"reference",
"is",
"a",
"linked",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L233-L248 |
107,747 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.tableExists | public static boolean tableExists(Connection connection, String tableName) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("SELECT * FROM " + TableLocation.parse(tableName) + " LIMIT 0;");
return true;
} catch (SQLException ex) {... | java | public static boolean tableExists(Connection connection, String tableName) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("SELECT * FROM " + TableLocation.parse(tableName) + " LIMIT 0;");
return true;
} catch (SQLException ex) {... | [
"public",
"static",
"boolean",
"tableExists",
"(",
"Connection",
"connection",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"statement",
".",
... | Return true if the table exists.
@param connection Connection
@param tableName Table name
@return true if the table exists
@throws java.sql.SQLException | [
"Return",
"true",
"if",
"the",
"table",
"exists",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L319-L326 |
107,748 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getTableNames | public static List<String> getTableNames(DatabaseMetaData metaData, String catalog, String schemaPattern,
String tableNamePattern, String [] types) throws SQLException {
List<String> tableList = new ArrayList<String>();
ResultSet rs = metaData.getTables(c... | java | public static List<String> getTableNames(DatabaseMetaData metaData, String catalog, String schemaPattern,
String tableNamePattern, String [] types) throws SQLException {
List<String> tableList = new ArrayList<String>();
ResultSet rs = metaData.getTables(c... | [
"public",
"static",
"List",
"<",
"String",
">",
"getTableNames",
"(",
"DatabaseMetaData",
"metaData",
",",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"tableNamePattern",
",",
"String",
"[",
"]",
"types",
")",
"throws",
"SQLException",
"{... | Returns the list of table names.
@param metaData Database meta data
@param catalog A catalog name. Must match the catalog name as it is stored in the database.
"" retrieves those without a catalog; null means that the catalog name should not be used to
narrow the search
@param schemaPattern A schema name pattern. Must... | [
"Returns",
"the",
"list",
"of",
"table",
"names",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L344-L357 |
107,749 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getUniqueFieldValues | public static List<String> getUniqueFieldValues(Connection connection, String tableName, String fieldName) throws SQLException {
final Statement statement = connection.createStatement();
List<String> fieldValues = new ArrayList<String>();
try {
ResultSet result = statement.executeQue... | java | public static List<String> getUniqueFieldValues(Connection connection, String tableName, String fieldName) throws SQLException {
final Statement statement = connection.createStatement();
List<String> fieldValues = new ArrayList<String>();
try {
ResultSet result = statement.executeQue... | [
"public",
"static",
"List",
"<",
"String",
">",
"getUniqueFieldValues",
"(",
"Connection",
"connection",
",",
"String",
"tableName",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"final",
"Statement",
"statement",
"=",
"connection",
".",
"createS... | Returns the list of distinct values contained by a field from a table from the database
@param connection Connection
@param tableName Name of the table containing the field.
@param fieldName Name of the field containing the values.
@return The list of distinct values of the field. | [
"Returns",
"the",
"list",
"of",
"distinct",
"values",
"contained",
"by",
"a",
"field",
"from",
"a",
"table",
"from",
"the",
"database"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L367-L379 |
107,750 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getFieldNames | public static List<String> getFieldNames(ResultSetMetaData resultSetMetaData) throws SQLException {
List<String> columnNames = new ArrayList<>();
int cols = resultSetMetaData.getColumnCount();
for (int i = 1; i <= cols; i++) {
columnNames.add(resultSetMetaData.getColumnName(i));
... | java | public static List<String> getFieldNames(ResultSetMetaData resultSetMetaData) throws SQLException {
List<String> columnNames = new ArrayList<>();
int cols = resultSetMetaData.getColumnCount();
for (int i = 1; i <= cols; i++) {
columnNames.add(resultSetMetaData.getColumnName(i));
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getFieldNames",
"(",
"ResultSetMetaData",
"resultSetMetaData",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"columnNames",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"cols",
"=",
"... | Fetch the name of columns
@param resultSetMetaData Active result set meta data.
@return An array with all column names
@throws SQLException | [
"Fetch",
"the",
"name",
"of",
"columns"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L399-L406 |
107,751 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java | DBFEngine.feedTableDataFromHeader | public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException {
for (int i = 0; i < header.getNumFields(); i++) {
String fieldsName = header.getFieldName(i);
final int type = dbfTypeToH2Type(header,i);
Column column = new Column(f... | java | public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException {
for (int i = 0; i < header.getNumFields(); i++) {
String fieldsName = header.getFieldName(i);
final int type = dbfTypeToH2Type(header,i);
Column column = new Column(f... | [
"public",
"static",
"void",
"feedTableDataFromHeader",
"(",
"DbaseFileHeader",
"header",
",",
"CreateTableData",
"data",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"header",
".",
"getNumFields",
"(",
")",
";",
"i",
... | Parse the DBF file then init the provided data structure
@param header dbf header
@param data Data to initialise
@throws java.io.IOException | [
"Parse",
"the",
"DBF",
"file",
"then",
"init",
"the",
"provided",
"data",
"structure"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java#L59-L67 |
107,752 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java | WriteBufferManager.prepareToAddBytes | private void prepareToAddBytes(int numBytes) throws IOException {
if (buffer.remaining() < numBytes) {
buffer.flip();
channel.write(buffer);
int bufferCapacity = Math.max(BUFFER_SIZE, numBytes);
if (bufferCapacity != buffer.capacity()) {
ByteOrder order = buffer.order();
buffer = ByteBuffer.alloc... | java | private void prepareToAddBytes(int numBytes) throws IOException {
if (buffer.remaining() < numBytes) {
buffer.flip();
channel.write(buffer);
int bufferCapacity = Math.max(BUFFER_SIZE, numBytes);
if (bufferCapacity != buffer.capacity()) {
ByteOrder order = buffer.order();
buffer = ByteBuffer.alloc... | [
"private",
"void",
"prepareToAddBytes",
"(",
"int",
"numBytes",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
".",
"remaining",
"(",
")",
"<",
"numBytes",
")",
"{",
"buffer",
".",
"flip",
"(",
")",
";",
"channel",
".",
"write",
"(",
"buffer",
... | Moves the window
@param numBytes
@throws java.io.IOException | [
"Moves",
"the",
"window"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java#L70-L84 |
107,753 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiPoint.java | ST_ToMultiPoint.createMultiPoint | public static MultiPoint createMultiPoint(Geometry geom) {
if (geom != null) {
return GEOMETRY_FACTORY.createMultiPoint(geom.getCoordinates());
} else {
return null;
}
} | java | public static MultiPoint createMultiPoint(Geometry geom) {
if (geom != null) {
return GEOMETRY_FACTORY.createMultiPoint(geom.getCoordinates());
} else {
return null;
}
} | [
"public",
"static",
"MultiPoint",
"createMultiPoint",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"return",
"GEOMETRY_FACTORY",
".",
"createMultiPoint",
"(",
"geom",
".",
"getCoordinates",
"(",
")",
")",
";",
"}",
"else",
... | Constructs a MultiPoint from the given geometry's coordinates.
@param geom Geometry
@return A MultiPoint constructed from the given geometry's coordinates | [
"Constructs",
"a",
"MultiPoint",
"from",
"the",
"given",
"geometry",
"s",
"coordinates",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiPoint.java#L53-L59 |
107,754 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java | TSVWrite.writeTSV | public static void writeTSV(Connection connection, String fileName, String tableReference, String encoding) throws SQLException, IOException {
TSVDriverFunction tSVDriverFunction = new TSVDriverFunction();
tSVDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileN... | java | public static void writeTSV(Connection connection, String fileName, String tableReference, String encoding) throws SQLException, IOException {
TSVDriverFunction tSVDriverFunction = new TSVDriverFunction();
tSVDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileN... | [
"public",
"static",
"void",
"writeTSV",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"TSVDriverFunction",
"tSVDriverFunction",
"=",
"ne... | Export a table into a Tab-separated values file
@param connection
@param fileName
@param tableReference
@param encoding
@throws SQLException
@throws IOException | [
"Export",
"a",
"table",
"into",
"a",
"Tab",
"-",
"separated",
"values",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java#L71-L74 |
107,755 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEllipse.java | ST_MakeEllipse.makeEllipse | public static Polygon makeEllipse(Point p, double width, double height) throws SQLException {
if(p == null){
return null;
}
if (height < 0 || width < 0) {
throw new SQLException("Both width and height must be positive.");
} else {
GSF.setCentre(new Coo... | java | public static Polygon makeEllipse(Point p, double width, double height) throws SQLException {
if(p == null){
return null;
}
if (height < 0 || width < 0) {
throw new SQLException("Both width and height must be positive.");
} else {
GSF.setCentre(new Coo... | [
"public",
"static",
"Polygon",
"makeEllipse",
"(",
"Point",
"p",
",",
"double",
"width",
",",
"double",
"height",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"height",
"<",
"0",
"... | Make an ellipse centered at the given point with the given width and
height.
@param p Point
@param width Width
@param height Height
@return An ellipse centered at the given point with the given width and height
@throws SQLException if the width or height is non-positive | [
"Make",
"an",
"ellipse",
"centered",
"at",
"the",
"given",
"point",
"with",
"the",
"given",
"width",
"and",
"height",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEllipse.java#L64-L76 |
107,756 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java | ST_MakeGridPoints.createGridPoints | public static ResultSet createGridPoints(Connection connection, Value value, double deltaX, double deltaY) throws SQLException {
if(value == null){
return null;
}
if (value instanceof ValueString) {
GridRowSet gridRowSet = new GridRowSet(connection, deltaX, deltaY, value.... | java | public static ResultSet createGridPoints(Connection connection, Value value, double deltaX, double deltaY) throws SQLException {
if(value == null){
return null;
}
if (value instanceof ValueString) {
GridRowSet gridRowSet = new GridRowSet(connection, deltaX, deltaY, value.... | [
"public",
"static",
"ResultSet",
"createGridPoints",
"(",
"Connection",
"connection",
",",
"Value",
"value",
",",
"double",
"deltaX",
",",
"double",
"deltaY",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
"... | Create a regular grid of points using the first input value to compute
the full extent.
@param connection
@param value could be the name of a table or a geometry.
@param deltaX the X cell size
@param deltaY the Y cell size
@return a resultset that contains all cells as a set of polygons
@throws SQLException | [
"Create",
"a",
"regular",
"grid",
"of",
"points",
"using",
"the",
"first",
"input",
"value",
"to",
"compute",
"the",
"full",
"extent",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java#L66-L82 |
107,757 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonDriverFunction.java | JsonDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
JsonWriteDriver jsonDriver = new JsonWriteDriver(connection);
jsonDriver.write(progress,tableReference, fileName, encoding);
... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
JsonWriteDriver jsonDriver = new JsonWriteDriver(connection);
jsonDriver.write(progress,tableReference, fileName, encoding);
... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Jso... | Save a table or a query to JSON file
@param connection
@param tableReference
@param fileName
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Save",
"a",
"table",
"or",
"a",
"query",
"to",
"JSON",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonDriverFunction.java#L81-L85 |
107,758 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/Voronoi.java | Voronoi.getOrAppendVertex | private int getOrAppendVertex(Coordinate newCoord, Quadtree ptQuad) {
Envelope queryEnv = new Envelope(newCoord);
queryEnv.expandBy(epsilon);
QuadTreeVisitor visitor = new QuadTreeVisitor(epsilon, newCoord);
try {
ptQuad.query(queryEnv, visitor);
} catch (RuntimeExcep... | java | private int getOrAppendVertex(Coordinate newCoord, Quadtree ptQuad) {
Envelope queryEnv = new Envelope(newCoord);
queryEnv.expandBy(epsilon);
QuadTreeVisitor visitor = new QuadTreeVisitor(epsilon, newCoord);
try {
ptQuad.query(queryEnv, visitor);
} catch (RuntimeExcep... | [
"private",
"int",
"getOrAppendVertex",
"(",
"Coordinate",
"newCoord",
",",
"Quadtree",
"ptQuad",
")",
"{",
"Envelope",
"queryEnv",
"=",
"new",
"Envelope",
"(",
"newCoord",
")",
";",
"queryEnv",
".",
"expandBy",
"(",
"epsilon",
")",
";",
"QuadTreeVisitor",
"vis... | Compute unique index for the coordinate
Index count from 0 to n
If the new vertex is closer than distMerge with an another vertex then it will return its index.
@return The index of the vertex | [
"Compute",
"unique",
"index",
"for",
"the",
"coordinate",
"Index",
"count",
"from",
"0",
"to",
"n",
"If",
"the",
"new",
"vertex",
"is",
"closer",
"than",
"distMerge",
"with",
"an",
"another",
"vertex",
"then",
"it",
"will",
"return",
"its",
"index",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/Voronoi.java#L89-L107 |
107,759 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/Voronoi.java | Voronoi.generateTriangleNeighbors | public Triple[] generateTriangleNeighbors(Geometry geometry) throws TopologyException {
inputTriangles = geometry;
CoordinateSequenceDimensionFilter sequenceDimensionFilter = new CoordinateSequenceDimensionFilter();
geometry.apply(sequenceDimensionFilter);
hasZ = sequenceDimensionFilter.... | java | public Triple[] generateTriangleNeighbors(Geometry geometry) throws TopologyException {
inputTriangles = geometry;
CoordinateSequenceDimensionFilter sequenceDimensionFilter = new CoordinateSequenceDimensionFilter();
geometry.apply(sequenceDimensionFilter);
hasZ = sequenceDimensionFilter.... | [
"public",
"Triple",
"[",
"]",
"generateTriangleNeighbors",
"(",
"Geometry",
"geometry",
")",
"throws",
"TopologyException",
"{",
"inputTriangles",
"=",
"geometry",
";",
"CoordinateSequenceDimensionFilter",
"sequenceDimensionFilter",
"=",
"new",
"CoordinateSequenceDimensionFil... | Given the input TIN, construct a graph of triangle.
@param geometry Collection of Polygon with 3 vertex.
@return Array of triangle neighbors. Order and count is the same of the input array.
@throws TopologyException If incompatible type geometry is given | [
"Given",
"the",
"input",
"TIN",
"construct",
"a",
"graph",
"of",
"triangle",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/Voronoi.java#L115-L153 |
107,760 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.registerGeometryType | public static void registerGeometryType(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for(DomainInfo domainInfo : getBuiltInsType()) {
// Check for byte array first, to not throw an enigmatic error CastException
st.execute("CREATE DOMAI... | java | public static void registerGeometryType(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for(DomainInfo domainInfo : getBuiltInsType()) {
// Check for byte array first, to not throw an enigmatic error CastException
st.execute("CREATE DOMAI... | [
"public",
"static",
"void",
"registerGeometryType",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"for",
"(",
"DomainInfo",
"domainInfo",
":",
"getBuiltInsType",
"(... | Register geometry type in an OSGi environment
@param connection Active H2 connection
@throws SQLException | [
"Register",
"geometry",
"type",
"in",
"an",
"OSGi",
"environment"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L362-L368 |
107,761 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.registerSpatialTables | public static void registerSpatialTables(Connection connection) throws SQLException {
Statement st = connection.createStatement();
st.execute("drop view if exists geometry_columns");
st.execute("create view geometry_columns as select TABLE_CATALOG f_table_catalog,TABLE_SCHEMA f_table_schema,TABL... | java | public static void registerSpatialTables(Connection connection) throws SQLException {
Statement st = connection.createStatement();
st.execute("drop view if exists geometry_columns");
st.execute("create view geometry_columns as select TABLE_CATALOG f_table_catalog,TABLE_SCHEMA f_table_schema,TABL... | [
"public",
"static",
"void",
"registerSpatialTables",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"st",
".",
"execute",
"(",
"\"drop view if exists geometry_columns\""... | Register view in order to create GEOMETRY_COLUMNS standard table.
@param connection Open connection
@throws java.sql.SQLException | [
"Register",
"view",
"in",
"order",
"to",
"create",
"GEOMETRY_COLUMNS",
"standard",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L375-L396 |
107,762 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.unRegisterGeometryType | public static void unRegisterGeometryType(Connection connection) throws SQLException {
Statement st = connection.createStatement();
DomainInfo[] domainInfos = getBuiltInsType();
for(DomainInfo domainInfo : domainInfos) {
st.execute("DROP DOMAIN IF EXISTS " + domainInfo.getDomainName(... | java | public static void unRegisterGeometryType(Connection connection) throws SQLException {
Statement st = connection.createStatement();
DomainInfo[] domainInfos = getBuiltInsType();
for(DomainInfo domainInfo : domainInfos) {
st.execute("DROP DOMAIN IF EXISTS " + domainInfo.getDomainName(... | [
"public",
"static",
"void",
"unRegisterGeometryType",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"DomainInfo",
"[",
"]",
"domainInfos",
"=",
"getBuiltInsType",
"... | Release geometry type
@param connection Active h2 connection with DROP DOMAIN and DROP ALIAS rights
@throws java.sql.SQLException | [
"Release",
"geometry",
"type"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L403-L409 |
107,763 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.getStringProperty | private static String getStringProperty(Function function, String propertyKey) {
Object value = function.getProperty(propertyKey);
return value instanceof String ? (String)value : "";
} | java | private static String getStringProperty(Function function, String propertyKey) {
Object value = function.getProperty(propertyKey);
return value instanceof String ? (String)value : "";
} | [
"private",
"static",
"String",
"getStringProperty",
"(",
"Function",
"function",
",",
"String",
"propertyKey",
")",
"{",
"Object",
"value",
"=",
"function",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"return",
"value",
"instanceof",
"String",
"?",
"(",
... | Return a string property of the function
@param function
@param propertyKey
@return | [
"Return",
"a",
"string",
"property",
"of",
"the",
"function"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L417-L420 |
107,764 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.getBooleanProperty | private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) {
Object value = function.getProperty(propertyKey);
return value instanceof Boolean ? (Boolean)value : defaultValue;
} | java | private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) {
Object value = function.getProperty(propertyKey);
return value instanceof Boolean ? (Boolean)value : defaultValue;
} | [
"private",
"static",
"boolean",
"getBooleanProperty",
"(",
"Function",
"function",
",",
"String",
"propertyKey",
",",
"boolean",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"function",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"return",
"value",
"i... | Return a boolean property of the function
@param function
@param propertyKey
@param defaultValue
@return | [
"Return",
"a",
"boolean",
"property",
"of",
"the",
"function"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L430-L433 |
107,765 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.getAlias | public static String getAlias(Function function) {
String functionAlias = getStringProperty(function,Function.PROP_NAME);
if(!functionAlias.isEmpty()) {
return functionAlias;
}
return function.getClass().getSimpleName();
} | java | public static String getAlias(Function function) {
String functionAlias = getStringProperty(function,Function.PROP_NAME);
if(!functionAlias.isEmpty()) {
return functionAlias;
}
return function.getClass().getSimpleName();
} | [
"public",
"static",
"String",
"getAlias",
"(",
"Function",
"function",
")",
"{",
"String",
"functionAlias",
"=",
"getStringProperty",
"(",
"function",
",",
"Function",
".",
"PROP_NAME",
")",
";",
"if",
"(",
"!",
"functionAlias",
".",
"isEmpty",
"(",
")",
")"... | Return the alias name of the function
@param function Function instance
@return the function ALIAS, name of the function in SQL engine | [
"Return",
"the",
"alias",
"name",
"of",
"the",
"function"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L505-L511 |
107,766 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.unRegisterFunction | public static void unRegisterFunction(Statement st, Function function) throws SQLException {
String functionAlias = getStringProperty(function, Function.PROP_NAME);
if(functionAlias.isEmpty()) {
functionAlias = function.getClass().getSimpleName();
}
st.execute("DROP ALIAS IF ... | java | public static void unRegisterFunction(Statement st, Function function) throws SQLException {
String functionAlias = getStringProperty(function, Function.PROP_NAME);
if(functionAlias.isEmpty()) {
functionAlias = function.getClass().getSimpleName();
}
st.execute("DROP ALIAS IF ... | [
"public",
"static",
"void",
"unRegisterFunction",
"(",
"Statement",
"st",
",",
"Function",
"function",
")",
"throws",
"SQLException",
"{",
"String",
"functionAlias",
"=",
"getStringProperty",
"(",
"function",
",",
"Function",
".",
"PROP_NAME",
")",
";",
"if",
"(... | Remove the specified function from the provided DataBase connection
@param st Active statement
@param function function to remove
@throws SQLException | [
"Remove",
"the",
"specified",
"function",
"from",
"the",
"provided",
"DataBase",
"connection"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L518-L524 |
107,767 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.registerH2GISFunctions | private static void registerH2GISFunctions(Connection connection, String packagePrepend) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
try {
registerFunction(st, function, packagePrepend);
} c... | java | private static void registerH2GISFunctions(Connection connection, String packagePrepend) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
try {
registerFunction(st, function, packagePrepend);
} c... | [
"private",
"static",
"void",
"registerH2GISFunctions",
"(",
"Connection",
"connection",
",",
"String",
"packagePrepend",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"for",
"(",
"Function",
"funct... | Register all H2GIS functions
@param connection JDBC Connection
@param packagePrepend For OSGi environment only, use
Bundle-SymbolicName:Bundle-Version:
@throws SQLException | [
"Register",
"all",
"H2GIS",
"functions"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L535-L545 |
107,768 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.unRegisterH2GISFunctions | public static void unRegisterH2GISFunctions(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
unRegisterFunction(st, function);
}
unRegisterGeometryType(connection);
} | java | public static void unRegisterH2GISFunctions(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
unRegisterFunction(st, function);
}
unRegisterGeometryType(connection);
} | [
"public",
"static",
"void",
"unRegisterH2GISFunctions",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"for",
"(",
"Function",
"function",
":",
"getBuiltInsFunctions",... | Unregister spatial type and H2GIS functions from the current connection.
@param connection Active H2 connection with DROP ALIAS rights
@throws java.sql.SQLException | [
"Unregister",
"spatial",
"type",
"and",
"H2GIS",
"functions",
"from",
"the",
"current",
"connection",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L553-L559 |
107,769 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java | ST_IsValidReason.isValidReason | public static String isValidReason(Geometry geometry, int flag) {
if (geometry != null) {
if (flag == 0) {
return validReason(geometry, false);
} else if (flag == 1) {
return validReason(geometry, true);
} else {
throw new Illeg... | java | public static String isValidReason(Geometry geometry, int flag) {
if (geometry != null) {
if (flag == 0) {
return validReason(geometry, false);
} else if (flag == 1) {
return validReason(geometry, true);
} else {
throw new Illeg... | [
"public",
"static",
"String",
"isValidReason",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"if",
"(",
"flag",
"==",
"0",
")",
"{",
"return",
"validReason",
"(",
"geometry",
",",
"false",
")"... | Returns text stating whether a geometry is valid.
If not, returns a reason why.
@param geometry
@param flag
@return | [
"Returns",
"text",
"stating",
"whether",
"a",
"geometry",
"is",
"valid",
".",
"If",
"not",
"returns",
"a",
"reason",
"why",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java#L67-L78 |
107,770 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java | ST_Polygonize.polygonize | public static Geometry polygonize(Geometry geometry) {
if(geometry == null){
return null;
}
Polygonizer polygonizer = new Polygonizer();
polygonizer.add(geometry);
Collection pols = polygonizer.getPolygons();
if(pols.isEmpty()){
return null;
... | java | public static Geometry polygonize(Geometry geometry) {
if(geometry == null){
return null;
}
Polygonizer polygonizer = new Polygonizer();
polygonizer.add(geometry);
Collection pols = polygonizer.getPolygons();
if(pols.isEmpty()){
return null;
... | [
"public",
"static",
"Geometry",
"polygonize",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Polygonizer",
"polygonizer",
"=",
"new",
"Polygonizer",
"(",
")",
";",
"polygonizer",
".",
"add... | Creates a GeometryCollection containing possible polygons formed
from the constituent linework of a set of geometries.
@param geometry
@return | [
"Creates",
"a",
"GeometryCollection",
"containing",
"possible",
"polygons",
"formed",
"from",
"the",
"constituent",
"linework",
"of",
"a",
"set",
"of",
"geometries",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java#L55-L66 |
107,771 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java | MaxDistanceOp.computeMaxDistance | private void computeMaxDistance() {
HashSet<Coordinate> coordinatesA = new HashSet<Coordinate>(Arrays.asList(geomA.convexHull().getCoordinates()));
Geometry fullHull = geomA.getFactory().createGeometryCollection(new Geometry[]{geomA, geomB}).convexHull();
maxDistanceFilter = new MaxDistanceFilte... | java | private void computeMaxDistance() {
HashSet<Coordinate> coordinatesA = new HashSet<Coordinate>(Arrays.asList(geomA.convexHull().getCoordinates()));
Geometry fullHull = geomA.getFactory().createGeometryCollection(new Geometry[]{geomA, geomB}).convexHull();
maxDistanceFilter = new MaxDistanceFilte... | [
"private",
"void",
"computeMaxDistance",
"(",
")",
"{",
"HashSet",
"<",
"Coordinate",
">",
"coordinatesA",
"=",
"new",
"HashSet",
"<",
"Coordinate",
">",
"(",
"Arrays",
".",
"asList",
"(",
"geomA",
".",
"convexHull",
"(",
")",
".",
"getCoordinates",
"(",
"... | Compute the max distance | [
"Compute",
"the",
"max",
"distance"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java#L52-L57 |
107,772 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java | MaxDistanceOp.getDistance | public Double getDistance() {
if (geomA == null || geomB == null) {
return null;
}
if (geomA.isEmpty() || geomB.isEmpty()) {
return 0.0;
}
if (geomA.equals(geomB)) {
sameGeom = true;
}
if (maxDistanceFilter == null) {
... | java | public Double getDistance() {
if (geomA == null || geomB == null) {
return null;
}
if (geomA.isEmpty() || geomB.isEmpty()) {
return 0.0;
}
if (geomA.equals(geomB)) {
sameGeom = true;
}
if (maxDistanceFilter == null) {
... | [
"public",
"Double",
"getDistance",
"(",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geomA",
".",
"isEmpty",
"(",
")",
"||",
"geomB",
".",
"isEmpty",
"(",
")",
")",
"{"... | Return the max distance
@return | [
"Return",
"the",
"max",
"distance"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java#L64-L79 |
107,773 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java | MaxDistanceOp.getCoordinatesDistance | public Coordinate[] getCoordinatesDistance() {
if (geomA == null || geomB == null) {
return null;
}
if (geomA.isEmpty() || geomB.isEmpty()) {
return null;
}
if (geomA.equals(geomB)) {
sameGeom = true;
}
if (maxDistan... | java | public Coordinate[] getCoordinatesDistance() {
if (geomA == null || geomB == null) {
return null;
}
if (geomA.isEmpty() || geomB.isEmpty()) {
return null;
}
if (geomA.equals(geomB)) {
sameGeom = true;
}
if (maxDistan... | [
"public",
"Coordinate",
"[",
"]",
"getCoordinatesDistance",
"(",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geomA",
".",
"isEmpty",
"(",
")",
"||",
"geomB",
".",
"isEmpty... | Return the two coordinates to build the max distance line
@return | [
"Return",
"the",
"two",
"coordinates",
"to",
"build",
"the",
"max",
"distance",
"line"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java#L86-L102 |
107,774 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java | ST_GeomFromGML.toGeometry | public static Geometry toGeometry(String gmlFile, int srid) throws SAXException, IOException, ParserConfigurationException {
if (gmlFile == null) {
return null;
}
if (gf == null) {
gf = new GeometryFactory(new PrecisionModel(), srid);
}
GMLReader gMLReader... | java | public static Geometry toGeometry(String gmlFile, int srid) throws SAXException, IOException, ParserConfigurationException {
if (gmlFile == null) {
return null;
}
if (gf == null) {
gf = new GeometryFactory(new PrecisionModel(), srid);
}
GMLReader gMLReader... | [
"public",
"static",
"Geometry",
"toGeometry",
"(",
"String",
"gmlFile",
",",
"int",
"srid",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"if",
"(",
"gmlFile",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Read the GML representation with a specified SRID
@param gmlFile
@param srid
@return
@throws org.xml.sax.SAXException
@throws java.io.IOException
@throws javax.xml.parsers.ParserConfigurationException | [
"Read",
"the",
"GML",
"representation",
"with",
"a",
"specified",
"SRID"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java#L74-L83 |
107,775 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.write | public void write(ProgressVisitor progress, ResultSet rs, File fileName, String encoding) throws SQLException, IOException {
if (FileUtil.isExtensionWellFormated(fileName, "geojson")) {
FileOutputStream fos = null;
JsonEncoding jsonEncoding = JsonEncoding.UTF8;
if (encoding !... | java | public void write(ProgressVisitor progress, ResultSet rs, File fileName, String encoding) throws SQLException, IOException {
if (FileUtil.isExtensionWellFormated(fileName, "geojson")) {
FileOutputStream fos = null;
JsonEncoding jsonEncoding = JsonEncoding.UTF8;
if (encoding !... | [
"public",
"void",
"write",
"(",
"ProgressVisitor",
"progress",
",",
"ResultSet",
"rs",
",",
"File",
"fileName",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"if",
"(",
"FileUtil",
".",
"isExtensionWellFormated",
"(",
"fileNa... | Write a resulset to a geojson file
@param progress
@param rs input resulset
@param fileName the output file
@param encoding
@throws SQLException
@throws java.io.IOException | [
"Write",
"a",
"resulset",
"to",
"a",
"geojson",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L99-L166 |
107,776 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeFeature | private void writeFeature(JsonGenerator jsonGenerator, ResultSet rs, int geoFieldIndex) throws IOException, SQLException {
// feature header
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("type", "Feature");
//Write the first geometry
writeGeometry((Geometry) rs... | java | private void writeFeature(JsonGenerator jsonGenerator, ResultSet rs, int geoFieldIndex) throws IOException, SQLException {
// feature header
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("type", "Feature");
//Write the first geometry
writeGeometry((Geometry) rs... | [
"private",
"void",
"writeFeature",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"ResultSet",
"rs",
",",
"int",
"geoFieldIndex",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"// feature header",
"jsonGenerator",
".",
"writeStartObject",
"(",
")",
";",
"json... | Write a GeoJSON feature.
Features in GeoJSON contain a geometry object and additional properties,
and a feature collection represents a list of features.
A complete GeoJSON data structure is always an object (in JSON terms). In
GeoJSON, an object consists of a collection of name/value pairs -- also
called members. Fo... | [
"Write",
"a",
"GeoJSON",
"feature",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L288-L298 |
107,777 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.cacheMetadata | private void cacheMetadata(ResultSetMetaData resultSetMetaData) throws SQLException {
cachedColumnNames = new LinkedHashMap<String, Integer>();
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
final String fieldTypeName = resultSetMetaData.getColumnTypeName(i);
if ... | java | private void cacheMetadata(ResultSetMetaData resultSetMetaData) throws SQLException {
cachedColumnNames = new LinkedHashMap<String, Integer>();
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
final String fieldTypeName = resultSetMetaData.getColumnTypeName(i);
if ... | [
"private",
"void",
"cacheMetadata",
"(",
"ResultSetMetaData",
"resultSetMetaData",
")",
"throws",
"SQLException",
"{",
"cachedColumnNames",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Integer",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
... | Cache the column name and its index.
@param resultSetMetaData
@throws SQLException | [
"Cache",
"the",
"column",
"name",
"and",
"its",
"index",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L306-L316 |
107,778 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeGeometry | private void writeGeometry(Geometry geom, JsonGenerator gen) throws IOException {
if (geom != null) {
gen.writeObjectFieldStart("geometry");
if (geom instanceof Point) {
write((Point) geom, gen);
} else if (geom instanceof MultiPoint) {
... | java | private void writeGeometry(Geometry geom, JsonGenerator gen) throws IOException {
if (geom != null) {
gen.writeObjectFieldStart("geometry");
if (geom instanceof Point) {
write((Point) geom, gen);
} else if (geom instanceof MultiPoint) {
... | [
"private",
"void",
"writeGeometry",
"(",
"Geometry",
"geom",
",",
"JsonGenerator",
"gen",
")",
"throws",
"IOException",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"gen",
".",
"writeObjectFieldStart",
"(",
"\"geometry\"",
")",
";",
"if",
"(",
"geom",
"... | Write a JTS geometry to its GeoJSON geometry representation.
Syntax:
"geometry":{"type": "Point", "coordinates": [102.0, 0.5]}
@param jsonGenerator
@param geometry | [
"Write",
"a",
"JTS",
"geometry",
"to",
"its",
"GeoJSON",
"geometry",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L328-L353 |
107,779 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeProperties | private void writeProperties(JsonGenerator jsonGenerator, ResultSet rs) throws IOException, SQLException {
if (columnCountProperties != -1) {
jsonGenerator.writeObjectFieldStart("properties");
for (Map.Entry<String, Integer> entry : cachedColumnNames.entrySet()) {
String ... | java | private void writeProperties(JsonGenerator jsonGenerator, ResultSet rs) throws IOException, SQLException {
if (columnCountProperties != -1) {
jsonGenerator.writeObjectFieldStart("properties");
for (Map.Entry<String, Integer> entry : cachedColumnNames.entrySet()) {
String ... | [
"private",
"void",
"writeProperties",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"ResultSet",
"rs",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"if",
"(",
"columnCountProperties",
"!=",
"-",
"1",
")",
"{",
"jsonGenerator",
".",
"writeObjectFieldStart",
... | Write the GeoJSON properties.
@param jsonGenerator
@param rs
@throws IOException | [
"Write",
"the",
"GeoJSON",
"properties",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L564-L588 |
107,780 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.isSupportedPropertyType | public boolean isSupportedPropertyType(int sqlTypeId, String sqlTypeName) throws SQLException {
switch (sqlTypeId) {
case Types.BOOLEAN:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
... | java | public boolean isSupportedPropertyType(int sqlTypeId, String sqlTypeName) throws SQLException {
switch (sqlTypeId) {
case Types.BOOLEAN:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
... | [
"public",
"boolean",
"isSupportedPropertyType",
"(",
"int",
"sqlTypeId",
",",
"String",
"sqlTypeName",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"sqlTypeId",
")",
"{",
"case",
"Types",
".",
"BOOLEAN",
":",
"case",
"Types",
".",
"DOUBLE",
":",
"case",
... | Return true is the SQL type is supported by the GeoJSON driver.
@param sqlTypeId
@param sqlTypeName
@return
@throws SQLException | [
"Return",
"true",
"is",
"the",
"SQL",
"type",
"is",
"supported",
"by",
"the",
"GeoJSON",
"driver",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L598-L621 |
107,781 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeCRS | private void writeCRS(JsonGenerator jsonGenerator, String[] authorityAndSRID) throws IOException {
if (authorityAndSRID[1] != null) {
jsonGenerator.writeObjectFieldStart("crs");
jsonGenerator.writeStringField("type", "name");
jsonGenerator.writeObjectFieldStart("properties");... | java | private void writeCRS(JsonGenerator jsonGenerator, String[] authorityAndSRID) throws IOException {
if (authorityAndSRID[1] != null) {
jsonGenerator.writeObjectFieldStart("crs");
jsonGenerator.writeStringField("type", "name");
jsonGenerator.writeObjectFieldStart("properties");... | [
"private",
"void",
"writeCRS",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"String",
"[",
"]",
"authorityAndSRID",
")",
"throws",
"IOException",
"{",
"if",
"(",
"authorityAndSRID",
"[",
"1",
"]",
"!=",
"null",
")",
"{",
"jsonGenerator",
".",
"writeObjectFieldSta... | Write the CRS in the geojson
@param jsonGenerator
@param authorityAndSRID
@throws IOException | [
"Write",
"the",
"CRS",
"in",
"the",
"geojson"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L630-L641 |
107,782 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeArray | private void writeArray(JsonGenerator jsonGenerator, Object[] array, boolean firstInHierarchy) throws IOException, SQLException {
if(!firstInHierarchy) {
jsonGenerator.writeStartArray();
}
for(int i = 0; i < array.length; i++) {
if (array[i] instanceof Integer) {
... | java | private void writeArray(JsonGenerator jsonGenerator, Object[] array, boolean firstInHierarchy) throws IOException, SQLException {
if(!firstInHierarchy) {
jsonGenerator.writeStartArray();
}
for(int i = 0; i < array.length; i++) {
if (array[i] instanceof Integer) {
... | [
"private",
"void",
"writeArray",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"Object",
"[",
"]",
"array",
",",
"boolean",
"firstInHierarchy",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"if",
"(",
"!",
"firstInHierarchy",
")",
"{",
"jsonGenerator",
"... | Write the array in the geojson
@param jsonGenerator
@param array
@throw IOException | [
"Write",
"the",
"array",
"in",
"the",
"geojson"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L650-L675 |
107,783 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java | ST_SideBuffer.singleSideBuffer | public static Geometry singleSideBuffer(Geometry geometry, double distance){
if(geometry==null){
return null;
}
return computeSingleSideBuffer(geometry, distance, new BufferParameters());
} | java | public static Geometry singleSideBuffer(Geometry geometry, double distance){
if(geometry==null){
return null;
}
return computeSingleSideBuffer(geometry, distance, new BufferParameters());
} | [
"public",
"static",
"Geometry",
"singleSideBuffer",
"(",
"Geometry",
"geometry",
",",
"double",
"distance",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"computeSingleSideBuffer",
"(",
"geometry",
",",
"distanc... | Compute a single side buffer with default parameters
@param geometry
@param distance
@return | [
"Compute",
"a",
"single",
"side",
"buffer",
"with",
"default",
"parameters"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java#L58-L63 |
107,784 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java | ST_SideBuffer.computeSingleSideBuffer | private static Geometry computeSingleSideBuffer(Geometry geometry, double distance, BufferParameters bufferParameters){
bufferParameters.setSingleSided(true);
return BufferOp.bufferOp(geometry, distance, bufferParameters);
} | java | private static Geometry computeSingleSideBuffer(Geometry geometry, double distance, BufferParameters bufferParameters){
bufferParameters.setSingleSided(true);
return BufferOp.bufferOp(geometry, distance, bufferParameters);
} | [
"private",
"static",
"Geometry",
"computeSingleSideBuffer",
"(",
"Geometry",
"geometry",
",",
"double",
"distance",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"bufferParameters",
".",
"setSingleSided",
"(",
"true",
")",
";",
"return",
"BufferOp",
".",
"b... | Compute the buffer
@param geometry
@param distance
@param bufferParameters
@return | [
"Compute",
"the",
"buffer"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java#L111-L114 |
107,785 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java | ST_Equals.geomEquals | public static Boolean geomEquals(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.equals(b);
} | java | public static Boolean geomEquals(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.equals(b);
} | [
"public",
"static",
"Boolean",
"geomEquals",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"equals",
"(",
"b",
")",
";",
"}"
... | Return true if Geometry A is equal to Geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if Geometry A is equal to Geometry B | [
"Return",
"true",
"if",
"Geometry",
"A",
"is",
"equal",
"to",
"Geometry",
"B"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java#L51-L56 |
107,786 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/aggregate/ST_Accum.java | ST_Accum.addGeometry | private void addGeometry(Geometry geom) {
if (geom != null) {
if (geom instanceof GeometryCollection) {
List<Geometry> toUnitTmp = new ArrayList<Geometry>(geom.getNumGeometries());
for (int i = 0; i < geom.getNumGeometries(); i++) {
toUnitTmp.add(g... | java | private void addGeometry(Geometry geom) {
if (geom != null) {
if (geom instanceof GeometryCollection) {
List<Geometry> toUnitTmp = new ArrayList<Geometry>(geom.getNumGeometries());
for (int i = 0; i < geom.getNumGeometries(); i++) {
toUnitTmp.add(g... | [
"private",
"void",
"addGeometry",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"if",
"(",
"geom",
"instanceof",
"GeometryCollection",
")",
"{",
"List",
"<",
"Geometry",
">",
"toUnitTmp",
"=",
"new",
"ArrayList",
"<",
"Geo... | Add geometry into an array to accumulate
@param geom | [
"Add",
"geometry",
"into",
"an",
"array",
"to",
"accumulate"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/aggregate/ST_Accum.java#L76-L90 |
107,787 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonDriverFunction.java | GeoJsonDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException{
GeoJsonWriteDriver geoJsonDriver = new GeoJsonWriteDriver(connection);
geoJsonDriver.write(progress,tableReference, fileName, en... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException{
GeoJsonWriteDriver geoJsonDriver = new GeoJsonWriteDriver(connection);
geoJsonDriver.write(progress,tableReference, fileName, en... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Geo... | Export a table or a query to a geojson file
@param connection
@param tableReference
@param fileName
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Export",
"a",
"table",
"or",
"a",
"query",
"to",
"a",
"geojson",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonDriverFunction.java#L88-L92 |
107,788 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java | OSMPreParser.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.compareToIgnoreCase("osm") == 0) {
version = attributes.getValue(GPXTags.VERSION);
} else if (localName.compareToIgnoreCase("node") == 0) {
... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (localName.compareToIgnoreCase("osm") == 0) {
version = attributes.getValue(GPXTags.VERSION);
} else if (localName.compareToIgnoreCase("node") == 0) {
... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"localName",
".",
"compareToIgnoreCase",
"(",
"\"osm\"",
... | Fires whenever an XML start markup is encountered. It indicates which
version of osm file is to be parsed.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the local element (with prefix)
@param attributes Attributes of the local element (contained i... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
".",
"It",
"indicates",
"which",
"version",
"of",
"osm",
"file",
"is",
"to",
"be",
"parsed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java#L92-L103 |
107,789 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.addPoint | public static Geometry addPoint(Geometry geometry, Point point) throws SQLException {
return addPoint(geometry, point, PRECISION);
} | java | public static Geometry addPoint(Geometry geometry, Point point) throws SQLException {
return addPoint(geometry, point, PRECISION);
} | [
"public",
"static",
"Geometry",
"addPoint",
"(",
"Geometry",
"geometry",
",",
"Point",
"point",
")",
"throws",
"SQLException",
"{",
"return",
"addPoint",
"(",
"geometry",
",",
"point",
",",
"PRECISION",
")",
";",
"}"
] | Returns a new geometry based on an existing one, with a specific point as
a new vertex. A default distance 10E-6 is used to snap the input point.
@param geometry
@param point
@return
@throws SQLException | [
"Returns",
"a",
"new",
"geometry",
"based",
"on",
"an",
"existing",
"one",
"with",
"a",
"specific",
"point",
"as",
"a",
"new",
"vertex",
".",
"A",
"default",
"distance",
"10E",
"-",
"6",
"is",
"used",
"to",
"snap",
"the",
"input",
"point",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L60-L62 |
107,790 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.addPoint | public static Geometry addPoint(Geometry geometry, Point point, double tolerance) throws SQLException {
if(geometry == null || point == null){
return null;
}
if (geometry instanceof MultiPoint) {
return insertVertexInMultipoint(geometry, point);
} else if (geometr... | java | public static Geometry addPoint(Geometry geometry, Point point, double tolerance) throws SQLException {
if(geometry == null || point == null){
return null;
}
if (geometry instanceof MultiPoint) {
return insertVertexInMultipoint(geometry, point);
} else if (geometr... | [
"public",
"static",
"Geometry",
"addPoint",
"(",
"Geometry",
"geometry",
",",
"Point",
"point",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
"||",
"point",
"==",
"null",
")",
"{",
"return",
"null",
";... | Returns a new geometry based on an existing one, with a specific point as
a new vertex.
@param geometry
@param point
@param tolerance
@return Null if the vertex cannot be inserted
@throws SQLException If the vertex can be inserted but it makes the
geometry to be in an invalid shape | [
"Returns",
"a",
"new",
"geometry",
"based",
"on",
"an",
"existing",
"one",
"with",
"a",
"specific",
"point",
"as",
"a",
"new",
"vertex",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L75-L126 |
107,791 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.insertVertexInMultipoint | private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint) {
ArrayList<Point> geoms = new ArrayList<Point>();
for (int i = 0; i < g.getNumGeometries(); i++) {
Point geom = (Point) g.getGeometryN(i);
geoms.add(geom);
}
geoms.add(FACTORY.createP... | java | private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint) {
ArrayList<Point> geoms = new ArrayList<Point>();
for (int i = 0; i < g.getNumGeometries(); i++) {
Point geom = (Point) g.getGeometryN(i);
geoms.add(geom);
}
geoms.add(FACTORY.createP... | [
"private",
"static",
"Geometry",
"insertVertexInMultipoint",
"(",
"Geometry",
"g",
",",
"Point",
"vertexPoint",
")",
"{",
"ArrayList",
"<",
"Point",
">",
"geoms",
"=",
"new",
"ArrayList",
"<",
"Point",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | Adds a Point into a MultiPoint geometry.
@param g
@param vertexPoint
@return | [
"Adds",
"a",
"Point",
"into",
"a",
"MultiPoint",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L135-L143 |
107,792 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.insertVertexInPolygon | private static Polygon insertVertexInPolygon(Polygon polygon,
Point vertexPoint, double tolerance) throws SQLException {
Polygon geom =polygon;
LineString linearRing = polygon.getExteriorRing();
int index = -1;
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
... | java | private static Polygon insertVertexInPolygon(Polygon polygon,
Point vertexPoint, double tolerance) throws SQLException {
Polygon geom =polygon;
LineString linearRing = polygon.getExteriorRing();
int index = -1;
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
... | [
"private",
"static",
"Polygon",
"insertVertexInPolygon",
"(",
"Polygon",
"polygon",
",",
"Point",
"vertexPoint",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"Polygon",
"geom",
"=",
"polygon",
";",
"LineString",
"linearRing",
"=",
"polygon",
"."... | Adds a vertex into a Polygon with a given tolerance.
@param polygon
@param vertexPoint
@param tolerance
@return
@throws SQLException | [
"Adds",
"a",
"vertex",
"into",
"a",
"Polygon",
"with",
"a",
"given",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L184-L224 |
107,793 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.computeDistance | private static double computeDistance(Geometry geometry, Point vertexPoint, double tolerance) {
DistanceOp distanceOp = new DistanceOp(geometry, vertexPoint, tolerance);
return distanceOp.distance();
} | java | private static double computeDistance(Geometry geometry, Point vertexPoint, double tolerance) {
DistanceOp distanceOp = new DistanceOp(geometry, vertexPoint, tolerance);
return distanceOp.distance();
} | [
"private",
"static",
"double",
"computeDistance",
"(",
"Geometry",
"geometry",
",",
"Point",
"vertexPoint",
",",
"double",
"tolerance",
")",
"{",
"DistanceOp",
"distanceOp",
"=",
"new",
"DistanceOp",
"(",
"geometry",
",",
"vertexPoint",
",",
"tolerance",
")",
";... | Return minimum distance between a geometry and a point.
@param geometry
@param vertexPoint
@param tolerance
@return | [
"Return",
"minimum",
"distance",
"between",
"a",
"geometry",
"and",
"a",
"point",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L234-L237 |
107,794 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.insertVertexInLinearRing | private static LinearRing insertVertexInLinearRing(LineString lineString,
Point vertexPoint, double tolerance) {
GeometryLocation geomLocation = EditUtilities.getVertexToSnap(lineString, vertexPoint, tolerance);
if (geomLocation != null) {
Coordinate[] coords = lineString.getCoor... | java | private static LinearRing insertVertexInLinearRing(LineString lineString,
Point vertexPoint, double tolerance) {
GeometryLocation geomLocation = EditUtilities.getVertexToSnap(lineString, vertexPoint, tolerance);
if (geomLocation != null) {
Coordinate[] coords = lineString.getCoor... | [
"private",
"static",
"LinearRing",
"insertVertexInLinearRing",
"(",
"LineString",
"lineString",
",",
"Point",
"vertexPoint",
",",
"double",
"tolerance",
")",
"{",
"GeometryLocation",
"geomLocation",
"=",
"EditUtilities",
".",
"getVertexToSnap",
"(",
"lineString",
",",
... | Adds a vertex into a LinearRing with a given tolerance.
@param lineString
@param vertexPoint
@param tolerance
@return | [
"Adds",
"a",
"vertex",
"into",
"a",
"LinearRing",
"with",
"a",
"given",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L247-L266 |
107,795 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java | DriverManager.openFile | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
String ext = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length());
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
for(DriverDef driverDef : DRIVE... | java | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
String ext = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length());
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
for(DriverDef driverDef : DRIVE... | [
"public",
"static",
"void",
"openFile",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"String",
"ext",
"=",
"fileName",
".",
"substring",
"(",
"fileName",
".",
"lastIndexOf",
"(",
"'... | Create a new table
@param connection Active connection, do not close this connection.
@param fileName File path to write, if exists it may be replaced
@param tableName [[catalog.]schema.]table reference | [
"Create",
"a",
"new",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java#L89-L103 |
107,796 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java | SHPWrite.exportTable | public static void exportTable(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
SHPDriverFunction shpDriverFunction = new SHPDriverFunction();
shpDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName)... | java | public static void exportTable(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
SHPDriverFunction shpDriverFunction = new SHPDriverFunction();
shpDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName)... | [
"public",
"static",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
",",
"String",
"encoding",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"SHPDriverFunction",
"shpDriverFunction",
"=",
... | Read a table and write it into a shape file.
@param connection Active connection
@param fileName Shape file name or URI
@param tableReference Table name or select query
Note : The select query must be enclosed in parenthesis
@param encoding File encoding
@throws IOException
@throws SQLException | [
"Read",
"a",
"table",
"and",
"write",
"it",
"into",
"a",
"shape",
"file",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java#L69-L72 |
107,797 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.force | public static Geometry force(Geometry geom, int dimension) {
if (geom instanceof Point) {
return gf.createPoint(convertSequence(geom.getCoordinates(),dimension));
} else if (geom instanceof LineString) {
return gf.createLineString(convertSequence(geom.getCoordinates(),dimension))... | java | public static Geometry force(Geometry geom, int dimension) {
if (geom instanceof Point) {
return gf.createPoint(convertSequence(geom.getCoordinates(),dimension));
} else if (geom instanceof LineString) {
return gf.createLineString(convertSequence(geom.getCoordinates(),dimension))... | [
"public",
"static",
"Geometry",
"force",
"(",
"Geometry",
"geom",
",",
"int",
"dimension",
")",
"{",
"if",
"(",
"geom",
"instanceof",
"Point",
")",
"{",
"return",
"gf",
".",
"createPoint",
"(",
"convertSequence",
"(",
"geom",
".",
"getCoordinates",
"(",
")... | Force the dimension of the geometry and update correctly the coordinate
dimension
@param geom the input geometry
@param dimension supported dimension is 2, 3
if the dimension is set to 3 the z measure are set to 0
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"geometry",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L52-L69 |
107,798 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static GeometryCollection convert(GeometryCollection gc, int dimension) {
int nb = gc.getNumGeometries();
final Geometry[] geometries = new Geometry[nb];
for (int i = 0; i < nb; i++) {
geometries[i]=force(gc.getGeometryN(i),dimension);
}
ret... | java | public static GeometryCollection convert(GeometryCollection gc, int dimension) {
int nb = gc.getNumGeometries();
final Geometry[] geometries = new Geometry[nb];
for (int i = 0; i < nb; i++) {
geometries[i]=force(gc.getGeometryN(i),dimension);
}
ret... | [
"public",
"static",
"GeometryCollection",
"convert",
"(",
"GeometryCollection",
"gc",
",",
"int",
"dimension",
")",
"{",
"int",
"nb",
"=",
"gc",
".",
"getNumGeometries",
"(",
")",
";",
"final",
"Geometry",
"[",
"]",
"geometries",
"=",
"new",
"Geometry",
"[",... | Force the dimension of the GeometryCollection and update correctly the coordinate
dimension
@param gc
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"GeometryCollection",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L78-L85 |
107,799 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) {
int nb = multiPolygon.getNumGeometries();
final Polygon[] pl = new Polygon[nb];
for (int i = 0; i < nb; i++) {
pl[i] = GeometryCoordinateDimension.convert((Polygon) multiPolygon.getGeometryN(i),dimension);
... | java | public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) {
int nb = multiPolygon.getNumGeometries();
final Polygon[] pl = new Polygon[nb];
for (int i = 0; i < nb; i++) {
pl[i] = GeometryCoordinateDimension.convert((Polygon) multiPolygon.getGeometryN(i),dimension);
... | [
"public",
"static",
"MultiPolygon",
"convert",
"(",
"MultiPolygon",
"multiPolygon",
",",
"int",
"dimension",
")",
"{",
"int",
"nb",
"=",
"multiPolygon",
".",
"getNumGeometries",
"(",
")",
";",
"final",
"Polygon",
"[",
"]",
"pl",
"=",
"new",
"Polygon",
"[",
... | Force the dimension of the MultiPolygon and update correctly the coordinate
dimension
@param multiPolygon
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"MultiPolygon",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L94-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.