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,600 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseFeatureMetadata | private void parseFeatureMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken();
String field = jp.getText();
//Avoid all token which are not 'properties', 'geometry', 'type'
while (!field.equalsIgnoreCase(GeoJsonField.GEOMETRY) &&
!field.equalsIgnoreCa... | java | private void parseFeatureMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken();
String field = jp.getText();
//Avoid all token which are not 'properties', 'geometry', 'type'
while (!field.equalsIgnoreCase(GeoJsonField.GEOMETRY) &&
!field.equalsIgnoreCa... | [
"private",
"void",
"parseFeatureMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"String",
"field",
"=",
"jp",
".",
"getText",
"(",
")",
";",
"//Avoid all token which are not 'prop... | Features in GeoJSON contain a geometry object and additional properties
This method is used to collect metadata
Syntax:
{ "type": "Feature", "geometry":{"type": "Point", "coordinates": [102.0,
0.5]}, "properties": {"prop0": "value0"} }
@param jp | [
"Features",
"in",
"GeoJSON",
"contain",
"a",
"geometry",
"object",
"and",
"additional",
"properties",
"This",
"method",
"is",
"used",
"to",
"collect",
"metadata"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L313-L362 |
107,601 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseParentGeometryMetadata | private void parseParentGeometryMetadata(JsonParser jp) throws IOException, SQLException {
if(jp.nextToken()!=JsonToken.VALUE_NULL){//START_OBJECT { in case of null geometry
jp.nextToken(); // FIELD_NAME type
jp.nextToken(); //VALUE_STRING Point
String geometryType = jp.getText(); ... | java | private void parseParentGeometryMetadata(JsonParser jp) throws IOException, SQLException {
if(jp.nextToken()!=JsonToken.VALUE_NULL){//START_OBJECT { in case of null geometry
jp.nextToken(); // FIELD_NAME type
jp.nextToken(); //VALUE_STRING Point
String geometryType = jp.getText(); ... | [
"private",
"void",
"parseParentGeometryMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"if",
"(",
"jp",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"VALUE_NULL",
")",
"{",
"//START_OBJECT { in case of null geometry... | Parses the geometries to return its properties
@param jp
@throws IOException
@throws SQLException | [
"Parses",
"the",
"geometries",
"to",
"return",
"its",
"properties"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L372-L380 |
107,602 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseGeometryMetadata | private void parseGeometryMetadata(JsonParser jp, String geometryType) throws IOException, SQLException {
if (geometryType.equalsIgnoreCase(GeoJsonField.POINT)) {
parsePointMetadata(jp);
finalGeometryTypes.add(GeoJsonField.POINT);
} else if (geometryType.equalsIgnoreCas... | java | private void parseGeometryMetadata(JsonParser jp, String geometryType) throws IOException, SQLException {
if (geometryType.equalsIgnoreCase(GeoJsonField.POINT)) {
parsePointMetadata(jp);
finalGeometryTypes.add(GeoJsonField.POINT);
} else if (geometryType.equalsIgnoreCas... | [
"private",
"void",
"parseGeometryMetadata",
"(",
"JsonParser",
"jp",
",",
"String",
"geometryType",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"if",
"(",
"geometryType",
".",
"equalsIgnoreCase",
"(",
"GeoJsonField",
".",
"POINT",
")",
")",
"{",
"par... | Parses a all type of geometries and check if the geojson is wellformed.
Syntax:
"geometry":{"type": "Point", "coordinates": [102.0,0.5]}
@param jp
@throws IOException | [
"Parses",
"a",
"all",
"type",
"of",
"geometries",
"and",
"check",
"if",
"the",
"geojson",
"is",
"wellformed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L392-L417 |
107,603 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parsePointMetadata | private void parsePointMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME coordinates
String coordinatesField = jp.getText();
if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
jp.nextToken(); // START_ARRAY [ to parse the... | java | private void parsePointMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME coordinates
String coordinatesField = jp.getText();
if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
jp.nextToken(); // START_ARRAY [ to parse the... | [
"private",
"void",
"parsePointMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME coordinates ",
"String",
"coordinatesField",
"=",
"jp",
".",
"getText",
"(",
")",... | Parses a point and check if it's wellformated
Syntax:
{ "type": "Point", "coordinates": [100.0, 0.0] }
@param jp
@throws IOException | [
"Parses",
"a",
"point",
"and",
"check",
"if",
"it",
"s",
"wellformated"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L429-L438 |
107,604 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseCoordinateMetadata | private void parseCoordinateMetadata(JsonParser jp) throws IOException {
jp.nextToken();
jp.nextToken(); // second value
//We look for a z value
jp.nextToken();
if (jp.getCurrentToken() != JsonToken.END_ARRAY) {
jp.nextToken(); // exit array
}
jp.nextT... | java | private void parseCoordinateMetadata(JsonParser jp) throws IOException {
jp.nextToken();
jp.nextToken(); // second value
//We look for a z value
jp.nextToken();
if (jp.getCurrentToken() != JsonToken.END_ARRAY) {
jp.nextToken(); // exit array
}
jp.nextT... | [
"private",
"void",
"parseCoordinateMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"jp",
".",
"nextToken",
"(",
")",
";",
"// second value",
"//We look for a z value",
"jp",
".",
"nextToken",
"(",
"... | Parses a GeoJSON coordinate array and check if it's wellformed. The first
token corresponds to the first X value. The last token correponds to the
end of the coordinate array "]".
Parsed syntax:
100.0, 0.0]
@param jp
@throws IOException
@return Coordinate | [
"Parses",
"a",
"GeoJSON",
"coordinate",
"array",
"and",
"check",
"if",
"it",
"s",
"wellformed",
".",
"The",
"first",
"token",
"corresponds",
"to",
"the",
"first",
"X",
"value",
".",
"The",
"last",
"token",
"correponds",
"to",
"the",
"end",
"of",
"the",
"... | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L640-L649 |
107,605 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.init | private void init() {
jsFactory = new JsonFactory();
jsFactory.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
jsFactory.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
jsFactory.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
} | java | private void init() {
jsFactory = new JsonFactory();
jsFactory.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
jsFactory.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
jsFactory.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
} | [
"private",
"void",
"init",
"(",
")",
"{",
"jsFactory",
"=",
"new",
"JsonFactory",
"(",
")",
";",
"jsFactory",
".",
"configure",
"(",
"JsonParser",
".",
"Feature",
".",
"ALLOW_COMMENTS",
",",
"true",
")",
";",
"jsFactory",
".",
"configure",
"(",
"JsonParser... | Creates the JsonFactory. | [
"Creates",
"the",
"JsonFactory",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L719-L724 |
107,606 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseFeature | private Object[] parseFeature(JsonParser jp) throws IOException, SQLException {
jp.nextToken();
String field = jp.getText();
//Avoid all token which are not 'properties', 'geometry', 'type'
while (!field.equalsIgnoreCase(GeoJsonField.GEOMETRY) &&
!field.equalsIgnoreCase(G... | java | private Object[] parseFeature(JsonParser jp) throws IOException, SQLException {
jp.nextToken();
String field = jp.getText();
//Avoid all token which are not 'properties', 'geometry', 'type'
while (!field.equalsIgnoreCase(GeoJsonField.GEOMETRY) &&
!field.equalsIgnoreCase(G... | [
"private",
"Object",
"[",
"]",
"parseFeature",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"String",
"field",
"=",
"jp",
".",
"getText",
"(",
")",
";",
"//Avoid all token which are n... | Features in GeoJSON contain a geometry object and additional properties
This method returns all values stored in a feature.
Syntax:
{ "type": "Feature", "geometry":{"type": "Point", "coordinates": [102.0,
0.5]}, "properties": {"prop0": "value0"} }
@param jp | [
"Features",
"in",
"GeoJSON",
"contain",
"a",
"geometry",
"object",
"and",
"additional",
"properties",
"This",
"method",
"returns",
"all",
"values",
"stored",
"in",
"a",
"feature",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L739-L787 |
107,607 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseFeatures | private void parseFeatures(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME features
// Passes all the properties until "Feature" object is found
while(!jp.getText().equalsIgnoreCase(GeoJsonField.FEATURES) &&
!jp.getText().equalsIgnoreCase(GeoJsonFi... | java | private void parseFeatures(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME features
// Passes all the properties until "Feature" object is found
while(!jp.getText().equalsIgnoreCase(GeoJsonField.FEATURES) &&
!jp.getText().equalsIgnoreCase(GeoJsonFi... | [
"private",
"void",
"parseFeatures",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME features",
"// Passes all the properties until \"Feature\" object is found",
"while",
"(",
"!",
"jp... | Parses the featureCollection
@param jp
@throws IOException
@throws SQLException | [
"Parses",
"the",
"featureCollection"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L883-L946 |
107,608 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseData | private void parseData() throws IOException, SQLException {
FileInputStream fis = null;
try {
fis = new FileInputStream(fileName);
try (JsonParser jp = jsFactory.createParser(fis)) {
jp.nextToken();//START_OBJECT
jp.nextToken(); // field_name (type... | java | private void parseData() throws IOException, SQLException {
FileInputStream fis = null;
try {
fis = new FileInputStream(fileName);
try (JsonParser jp = jsFactory.createParser(fis)) {
jp.nextToken();//START_OBJECT
jp.nextToken(); // field_name (type... | [
"private",
"void",
"parseData",
"(",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"fileName",
")",
";",
"try",
"(",
"JsonParser",
"jp",
"=",
"jsFa... | Parses the GeoJSON data and set the values to the table.
@throws IOException
@throws SQLException | [
"Parses",
"the",
"GeoJSON",
"data",
"and",
"set",
"the",
"values",
"to",
"the",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L1243-L1270 |
107,609 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.readCRS | private int readCRS(JsonParser jp) throws IOException, SQLException {
int srid = 0;
jp.nextToken(); //START_OBJECT {
jp.nextToken();// crs type
jp.nextToken(); // crs name
String firstField = jp.getText();
if(firstField.equalsIgnoreCase(GeoJsonField.NAME)){
jp... | java | private int readCRS(JsonParser jp) throws IOException, SQLException {
int srid = 0;
jp.nextToken(); //START_OBJECT {
jp.nextToken();// crs type
jp.nextToken(); // crs name
String firstField = jp.getText();
if(firstField.equalsIgnoreCase(GeoJsonField.NAME)){
jp... | [
"private",
"int",
"readCRS",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"int",
"srid",
"=",
"0",
";",
"jp",
".",
"nextToken",
"(",
")",
";",
"//START_OBJECT {",
"jp",
".",
"nextToken",
"(",
")",
";",
"// crs type",
"... | Reads the CRS element and return the database SRID.
Parsed syntax:
"crs":{
"type":"name",
"properties":
{"name":"urn:ogc:def:crs:EPSG::4326"
}
}
@param jp
@return | [
"Reads",
"the",
"CRS",
"element",
"and",
"return",
"the",
"database",
"SRID",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L1287-L1322 |
107,610 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.skipCRS | private String skipCRS(JsonParser jp) throws IOException {
jp.nextToken(); //START_OBJECT {
jp.skipChildren();
jp.nextToken(); //Go to features
return jp.getText();
} | java | private String skipCRS(JsonParser jp) throws IOException {
jp.nextToken(); //START_OBJECT {
jp.skipChildren();
jp.nextToken(); //Go to features
return jp.getText();
} | [
"private",
"String",
"skipCRS",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"//START_OBJECT {",
"jp",
".",
"skipChildren",
"(",
")",
";",
"jp",
".",
"nextToken",
"(",
")",
";",
"//Go to features",
"ret... | We skip the CRS because it has been already parsed.
@param jp | [
"We",
"skip",
"the",
"CRS",
"because",
"it",
"has",
"been",
"already",
"parsed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L1330-L1335 |
107,611 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.setGeometryTypeConstraints | private void setGeometryTypeConstraints() throws SQLException {
String finalGeometryType = GeoJsonField.GEOMETRY;
if (finalGeometryTypes.size() == 1) {
finalGeometryType = (String) finalGeometryTypes.iterator().next();
}
if(isH2){
finalGeometryType = GeoJ... | java | private void setGeometryTypeConstraints() throws SQLException {
String finalGeometryType = GeoJsonField.GEOMETRY;
if (finalGeometryTypes.size() == 1) {
finalGeometryType = (String) finalGeometryTypes.iterator().next();
}
if(isH2){
finalGeometryType = GeoJ... | [
"private",
"void",
"setGeometryTypeConstraints",
"(",
")",
"throws",
"SQLException",
"{",
"String",
"finalGeometryType",
"=",
"GeoJsonField",
".",
"GEOMETRY",
";",
"if",
"(",
"finalGeometryTypes",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"finalGeometryType",
... | Adds the geometry type constraint and the SRID | [
"Adds",
"the",
"geometry",
"type",
"constraint",
"and",
"the",
"SRID"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L1340-L1352 |
107,612 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.split | public static Geometry split(Geometry geomA, Geometry geomB, double tolerance) throws SQLException {
if (geomA instanceof Polygon) {
throw new SQLException("Split a Polygon by a line is not supported using a tolerance. \n"
+ "Please used ST_Split(geom1, geom2)");
} else i... | java | public static Geometry split(Geometry geomA, Geometry geomB, double tolerance) throws SQLException {
if (geomA instanceof Polygon) {
throw new SQLException("Split a Polygon by a line is not supported using a tolerance. \n"
+ "Please used ST_Split(geom1, geom2)");
} else i... | [
"public",
"static",
"Geometry",
"split",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geomA",
"instanceof",
"Polygon",
")",
"{",
"throw",
"new",
"SQLException",
"(",
"\"Split a ... | Split a geometry a according a geometry b using a snapping tolerance.
This function support only the operations :
- split a line or a multiline with a point.
@param geomA the geometry to be splited
@param geomB the geometry used to split
@param tolerance a distance tolerance to snap the split geometry
@return
@throw... | [
"Split",
"a",
"geometry",
"a",
"according",
"a",
"geometry",
"b",
"using",
"a",
"snapping",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L109-L129 |
107,613 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitLineWithPoint | private static MultiLineString splitLineWithPoint(LineString line, Point pointToSplit, double tolerance) {
return FACTORY.createMultiLineString(splitLineStringWithPoint(line, pointToSplit, tolerance));
} | java | private static MultiLineString splitLineWithPoint(LineString line, Point pointToSplit, double tolerance) {
return FACTORY.createMultiLineString(splitLineStringWithPoint(line, pointToSplit, tolerance));
} | [
"private",
"static",
"MultiLineString",
"splitLineWithPoint",
"(",
"LineString",
"line",
",",
"Point",
"pointToSplit",
",",
"double",
"tolerance",
")",
"{",
"return",
"FACTORY",
".",
"createMultiLineString",
"(",
"splitLineStringWithPoint",
"(",
"line",
",",
"pointToS... | Split a linestring with a point The point must be on the linestring
@param line
@param pointToSplit
@return | [
"Split",
"a",
"linestring",
"with",
"a",
"point",
"The",
"point",
"must",
"be",
"on",
"the",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L138-L140 |
107,614 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitLineStringWithPoint | private static LineString[] splitLineStringWithPoint(LineString line, Point pointToSplit, double tolerance) {
Coordinate[] coords = line.getCoordinates();
Coordinate firstCoord = coords[0];
Coordinate lastCoord = coords[coords.length - 1];
Coordinate coordToSplit = pointToSplit.getCoordi... | java | private static LineString[] splitLineStringWithPoint(LineString line, Point pointToSplit, double tolerance) {
Coordinate[] coords = line.getCoordinates();
Coordinate firstCoord = coords[0];
Coordinate lastCoord = coords[coords.length - 1];
Coordinate coordToSplit = pointToSplit.getCoordi... | [
"private",
"static",
"LineString",
"[",
"]",
"splitLineStringWithPoint",
"(",
"LineString",
"line",
",",
"Point",
"pointToSplit",
",",
"double",
"tolerance",
")",
"{",
"Coordinate",
"[",
"]",
"coords",
"=",
"line",
".",
"getCoordinates",
"(",
")",
";",
"Coordi... | Splits a LineString using a Point, with a distance tolerance.
@param line
@param pointToSplit
@param tolerance
@return | [
"Splits",
"a",
"LineString",
"using",
"a",
"Point",
"with",
"a",
"distance",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L150-L187 |
107,615 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitMultiLineStringWithPoint | private static MultiLineString splitMultiLineStringWithPoint(MultiLineString multiLineString, Point pointToSplit, double tolerance) {
ArrayList<LineString> linestrings = new ArrayList<LineString>();
boolean notChanged = true;
int nb = multiLineString.getNumGeometries();
for (int i = 0; i... | java | private static MultiLineString splitMultiLineStringWithPoint(MultiLineString multiLineString, Point pointToSplit, double tolerance) {
ArrayList<LineString> linestrings = new ArrayList<LineString>();
boolean notChanged = true;
int nb = multiLineString.getNumGeometries();
for (int i = 0; i... | [
"private",
"static",
"MultiLineString",
"splitMultiLineStringWithPoint",
"(",
"MultiLineString",
"multiLineString",
",",
"Point",
"pointToSplit",
",",
"double",
"tolerance",
")",
"{",
"ArrayList",
"<",
"LineString",
">",
"linestrings",
"=",
"new",
"ArrayList",
"<",
"L... | Splits a MultilineString using a point.
@param multiLineString
@param pointToSplit
@param tolerance
@return | [
"Splits",
"a",
"MultilineString",
"using",
"a",
"point",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L197-L215 |
107,616 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitPolygonizer | private static Collection<Polygon> splitPolygonizer(Polygon polygon, LineString lineString) throws SQLException {
LinkedList<LineString> result = new LinkedList<LineString>();
ST_ToMultiSegments.createSegments(polygon.getExteriorRing(), result);
result.add(lineString);
int holes = polygo... | java | private static Collection<Polygon> splitPolygonizer(Polygon polygon, LineString lineString) throws SQLException {
LinkedList<LineString> result = new LinkedList<LineString>();
ST_ToMultiSegments.createSegments(polygon.getExteriorRing(), result);
result.add(lineString);
int holes = polygo... | [
"private",
"static",
"Collection",
"<",
"Polygon",
">",
"splitPolygonizer",
"(",
"Polygon",
"polygon",
",",
"LineString",
"lineString",
")",
"throws",
"SQLException",
"{",
"LinkedList",
"<",
"LineString",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"LineString",... | Splits a Polygon with a LineString.
@param polygon
@param lineString
@return | [
"Splits",
"a",
"Polygon",
"with",
"a",
"LineString",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L224-L245 |
107,617 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitMultiPolygonWithLine | private static Geometry splitMultiPolygonWithLine(MultiPolygon multiPolygon, LineString lineString) throws SQLException {
ArrayList<Polygon> allPolygons = new ArrayList<Polygon>();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Collection<Polygon> polygons = splitPolygonizer((Po... | java | private static Geometry splitMultiPolygonWithLine(MultiPolygon multiPolygon, LineString lineString) throws SQLException {
ArrayList<Polygon> allPolygons = new ArrayList<Polygon>();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Collection<Polygon> polygons = splitPolygonizer((Po... | [
"private",
"static",
"Geometry",
"splitMultiPolygonWithLine",
"(",
"MultiPolygon",
"multiPolygon",
",",
"LineString",
"lineString",
")",
"throws",
"SQLException",
"{",
"ArrayList",
"<",
"Polygon",
">",
"allPolygons",
"=",
"new",
"ArrayList",
"<",
"Polygon",
">",
"("... | Splits a MultiPolygon using a LineString.
@param multiPolygon
@param lineString
@return | [
"Splits",
"a",
"MultiPolygon",
"using",
"a",
"LineString",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L290-L302 |
107,618 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java | ST_Split.splitMultiLineStringWithLine | private static Geometry splitMultiLineStringWithLine(MultiLineString input, LineString cut) {
Geometry lines = input.difference(cut);
//Only to preserve SQL constrains
if (lines instanceof LineString) {
return FACTORY.createMultiLineString(new LineString[]{(LineString) lines.getGeome... | java | private static Geometry splitMultiLineStringWithLine(MultiLineString input, LineString cut) {
Geometry lines = input.difference(cut);
//Only to preserve SQL constrains
if (lines instanceof LineString) {
return FACTORY.createMultiLineString(new LineString[]{(LineString) lines.getGeome... | [
"private",
"static",
"Geometry",
"splitMultiLineStringWithLine",
"(",
"MultiLineString",
"input",
",",
"LineString",
"cut",
")",
"{",
"Geometry",
"lines",
"=",
"input",
".",
"difference",
"(",
"cut",
")",
";",
"//Only to preserve SQL constrains",
"if",
"(",
"lines",... | Splits the specified MultiLineString with another lineString.
@param MultiLineString
@param lineString | [
"Splits",
"the",
"specified",
"MultiLineString",
"with",
"another",
"lineString",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java#L322-L329 |
107,619 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_NumInteriorRings.java | ST_NumInteriorRings.getHoles | public static Integer getHoles(Geometry g) {
if(g == null) {
return null;
}
if (g instanceof MultiPolygon) {
Polygon p = (Polygon) g.getGeometryN(0);
if(p!=null){
return p.getNumInteriorRing();
}
} el... | java | public static Integer getHoles(Geometry g) {
if(g == null) {
return null;
}
if (g instanceof MultiPolygon) {
Polygon p = (Polygon) g.getGeometryN(0);
if(p!=null){
return p.getNumInteriorRing();
}
} el... | [
"public",
"static",
"Integer",
"getHoles",
"(",
"Geometry",
"g",
")",
"{",
"if",
"(",
"g",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"g",
"instanceof",
"MultiPolygon",
")",
"{",
"Polygon",
"p",
"=",
"(",
"Polygon",
")",
"g",
".... | Return the number of holes in a Polygon or MultiPolygon
@param g Geometry instance
@return Number of holes or null if geometry is null | [
"Return",
"the",
"number",
"of",
"holes",
"in",
"a",
"Polygon",
"or",
"MultiPolygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_NumInteriorRings.java#L51-L64 |
107,620 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java | OSMParser.checkOSMTables | private void checkOSMTables(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
String[] omsTables = new String[]{OSMTablesFactory.TAG, OSMTablesFactory.NODE, OSMTablesFactory.NODE_TAG, OSMTablesFactory.WAY, OSMTablesFactory.WAY_NODE,
OSMTab... | java | private void checkOSMTables(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
String[] omsTables = new String[]{OSMTablesFactory.TAG, OSMTablesFactory.NODE, OSMTablesFactory.NODE_TAG, OSMTablesFactory.WAY, OSMTablesFactory.WAY_NODE,
OSMTab... | [
"private",
"void",
"checkOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"TableLocation",
"requestedTable",
",",
"String",
"osmTableName",
")",
"throws",
"SQLException",
"{",
"String",
"[",
"]",
"omsTables",
"=",
"new",
"String",
"[",
"... | Check if one table already exists
@param connection
@param isH2
@param requestedTable
@param osmTableName
@throws SQLException | [
"Check",
"if",
"one",
"table",
"already",
"exists"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java#L212-L221 |
107,621 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java | OSMParser.createOSMDatabaseModel | private void createOSMDatabaseModel(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
String tagTableName = TableUtilities.caseIdentifier(requestedTable, osmTableName + OSMTablesFactory.TAG, isH2);
tagPreparedStmt = OSMTablesFactory.createTagT... | java | private void createOSMDatabaseModel(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
String tagTableName = TableUtilities.caseIdentifier(requestedTable, osmTableName + OSMTablesFactory.TAG, isH2);
tagPreparedStmt = OSMTablesFactory.createTagT... | [
"private",
"void",
"createOSMDatabaseModel",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"TableLocation",
"requestedTable",
",",
"String",
"osmTableName",
")",
"throws",
"SQLException",
"{",
"String",
"tagTableName",
"=",
"TableUtilities",
".",
"case... | Create the OMS data model to store the content of the file
@param connection
@param isH2
@param requestedTable
@param osmTableName
@throws SQLException | [
"Create",
"the",
"OMS",
"data",
"model",
"to",
"store",
"the",
"content",
"of",
"the",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java#L235-L258 |
107,622 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java | VisibilityAlgorithm.fixSegments | private static List<SegmentString> fixSegments(List<SegmentString> segments) {
MCIndexNoder mCIndexNoder = new MCIndexNoder();
RobustLineIntersector robustLineIntersector = new RobustLineIntersector();
mCIndexNoder.setSegmentIntersector(new IntersectionAdder(robustLineIntersector));
mCIndexNoder.compute... | java | private static List<SegmentString> fixSegments(List<SegmentString> segments) {
MCIndexNoder mCIndexNoder = new MCIndexNoder();
RobustLineIntersector robustLineIntersector = new RobustLineIntersector();
mCIndexNoder.setSegmentIntersector(new IntersectionAdder(robustLineIntersector));
mCIndexNoder.compute... | [
"private",
"static",
"List",
"<",
"SegmentString",
">",
"fixSegments",
"(",
"List",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"MCIndexNoder",
"mCIndexNoder",
"=",
"new",
"MCIndexNoder",
"(",
")",
";",
"RobustLineIntersector",
"robustLineIntersector",
"=",
"... | Split originalSegments that intersects. Run this method after calling the last addSegment before calling getIsoVist | [
"Split",
"originalSegments",
"that",
"intersects",
".",
"Run",
"this",
"method",
"after",
"calling",
"the",
"last",
"addSegment",
"before",
"calling",
"getIsoVist"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java#L82-L93 |
107,623 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java | VisibilityAlgorithm.addSegment | public void addSegment(Coordinate p0, Coordinate p1) {
if (p0.distance(p1) < epsilon) {
return;
}
addSegment(originalSegments, p0, p1);
} | java | public void addSegment(Coordinate p0, Coordinate p1) {
if (p0.distance(p1) < epsilon) {
return;
}
addSegment(originalSegments, p0, p1);
} | [
"public",
"void",
"addSegment",
"(",
"Coordinate",
"p0",
",",
"Coordinate",
"p1",
")",
"{",
"if",
"(",
"p0",
".",
"distance",
"(",
"p1",
")",
"<",
"epsilon",
")",
"{",
"return",
";",
"}",
"addSegment",
"(",
"originalSegments",
",",
"p0",
",",
"p1",
"... | Add occlusion segment in isovist
@param p0 segment origin
@param p1 segment destination | [
"Add",
"occlusion",
"segment",
"in",
"isovist"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java#L116-L121 |
107,624 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java | VisibilityAlgorithm.addGeometry | public void addGeometry(Geometry geometry) {
if (geometry instanceof LineString) {
addLineString(originalSegments, (LineString) geometry);
} else if (geometry instanceof Polygon) {
addPolygon(originalSegments, (Polygon) geometry);
} else if (geometry instanceof GeometryCollection) {
addGeo... | java | public void addGeometry(Geometry geometry) {
if (geometry instanceof LineString) {
addLineString(originalSegments, (LineString) geometry);
} else if (geometry instanceof Polygon) {
addPolygon(originalSegments, (Polygon) geometry);
} else if (geometry instanceof GeometryCollection) {
addGeo... | [
"public",
"void",
"addGeometry",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"instanceof",
"LineString",
")",
"{",
"addLineString",
"(",
"originalSegments",
",",
"(",
"LineString",
")",
"geometry",
")",
";",
"}",
"else",
"if",
"(",
"geometr... | Explode geometry and add occlusion segments in isovist
@param geometry Geometry collection, LineString or Polygon instance | [
"Explode",
"geometry",
"and",
"add",
"occlusion",
"segments",
"in",
"isovist"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithm.java#L435-L443 |
107,625 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java | H2GISversion.geth2gisVersion | public static String geth2gisVersion() {
try (InputStream fs = H2GISFunctions.class.getResourceAsStream("/org/h2gis/functions/system/version.txt")) {
BufferedReader bufRead = new BufferedReader(new InputStreamReader(fs));
StringBuilder builder = new StringBuilder();
String li... | java | public static String geth2gisVersion() {
try (InputStream fs = H2GISFunctions.class.getResourceAsStream("/org/h2gis/functions/system/version.txt")) {
BufferedReader bufRead = new BufferedReader(new InputStreamReader(fs));
StringBuilder builder = new StringBuilder();
String li... | [
"public",
"static",
"String",
"geth2gisVersion",
"(",
")",
"{",
"try",
"(",
"InputStream",
"fs",
"=",
"H2GISFunctions",
".",
"class",
".",
"getResourceAsStream",
"(",
"\"/org/h2gis/functions/system/version.txt\"",
")",
")",
"{",
"BufferedReader",
"bufRead",
"=",
"ne... | Return the H2GIS version available in the version txt file Otherwise
return unknown
@return | [
"Return",
"the",
"H2GIS",
"version",
"available",
"in",
"the",
"version",
"txt",
"file",
"Otherwise",
"return",
"unknown"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java#L54-L67 |
107,626 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.firstFirstLastLast | private static void firstFirstLastLast(Statement st,
TableLocation tableName,
String pkCol,
String geomCol,
double tolerance) throws SQLException {
... | java | private static void firstFirstLastLast(Statement st,
TableLocation tableName,
String pkCol,
String geomCol,
double tolerance) throws SQLException {
... | [
"private",
"static",
"void",
"firstFirstLastLast",
"(",
"Statement",
"st",
",",
"TableLocation",
"tableName",
",",
"String",
"pkCol",
",",
"String",
"geomCol",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Selecti... | Return the first and last coordinates table
@param st
@param tableName
@param pkCol
@param geomCol
@param tolerance
@throws SQLException | [
"Return",
"the",
"first",
"and",
"last",
"coordinates",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L355-L384 |
107,627 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.makeEnvelopes | private static void makeEnvelopes(Statement st, double tolerance, boolean isH2, int srid) throws SQLException {
st.execute("DROP TABLE IF EXISTS"+ PTS_TABLE + ";");
if (tolerance > 0) {
LOGGER.info("Calculating envelopes around coordinates...");
if (isH2) {
... | java | private static void makeEnvelopes(Statement st, double tolerance, boolean isH2, int srid) throws SQLException {
st.execute("DROP TABLE IF EXISTS"+ PTS_TABLE + ";");
if (tolerance > 0) {
LOGGER.info("Calculating envelopes around coordinates...");
if (isH2) {
... | [
"private",
"static",
"void",
"makeEnvelopes",
"(",
"Statement",
"st",
",",
"double",
"tolerance",
",",
"boolean",
"isH2",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"st",
".",
"execute",
"(",
"\"DROP TABLE IF EXISTS\"",
"+",
"PTS_TABLE",
"+",
"\";... | Make a big table of all points in the coords table with an envelope around each point.
We will use this table to remove duplicate points. | [
"Make",
"a",
"big",
"table",
"of",
"all",
"points",
"in",
"the",
"coords",
"table",
"with",
"an",
"envelope",
"around",
"each",
"point",
".",
"We",
"will",
"use",
"this",
"table",
"to",
"remove",
"duplicate",
"points",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L390-L446 |
107,628 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.nodesTable | private static void nodesTable(Statement st,
TableLocation nodesName,
double tolerance, boolean isH2, int srid) throws SQLException {
LOGGER.info("Creating the nodes table...");
// Creating nodes table by removing copies from the pts ... | java | private static void nodesTable(Statement st,
TableLocation nodesName,
double tolerance, boolean isH2, int srid) throws SQLException {
LOGGER.info("Creating the nodes table...");
// Creating nodes table by removing copies from the pts ... | [
"private",
"static",
"void",
"nodesTable",
"(",
"Statement",
"st",
",",
"TableLocation",
"nodesName",
",",
"double",
"tolerance",
",",
"boolean",
"isH2",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Creating the nodes ta... | Create the nodes table. | [
"Create",
"the",
"nodes",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L451-L506 |
107,629 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.edgesTable | private static void edgesTable(Statement st,
TableLocation nodesName,
TableLocation edgesName,
double tolerance, boolean isH2) throws SQLException {
LOGGER.info("Creating the edges table...");
if (to... | java | private static void edgesTable(Statement st,
TableLocation nodesName,
TableLocation edgesName,
double tolerance, boolean isH2) throws SQLException {
LOGGER.info("Creating the edges table...");
if (to... | [
"private",
"static",
"void",
"edgesTable",
"(",
"Statement",
"st",
",",
"TableLocation",
"nodesName",
",",
"TableLocation",
"edgesName",
",",
"double",
"tolerance",
",",
"boolean",
"isH2",
")",
"throws",
"SQLException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Creati... | Create the edges table. | [
"Create",
"the",
"edges",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L511-L556 |
107,630 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java | CoordinateUtils.zMinMax | public static double[] zMinMax(final Coordinate[] cs) {
double zmin;
double zmax;
boolean validZFound = false;
double[] result = new double[2];
zmin = Double.NaN;
zmax = Double.NaN;
double z;
for (int t = cs.length - 1; t >= 0; t--) {
z = cs... | java | public static double[] zMinMax(final Coordinate[] cs) {
double zmin;
double zmax;
boolean validZFound = false;
double[] result = new double[2];
zmin = Double.NaN;
zmax = Double.NaN;
double z;
for (int t = cs.length - 1; t >= 0; t--) {
z = cs... | [
"public",
"static",
"double",
"[",
"]",
"zMinMax",
"(",
"final",
"Coordinate",
"[",
"]",
"cs",
")",
"{",
"double",
"zmin",
";",
"double",
"zmax",
";",
"boolean",
"validZFound",
"=",
"false",
";",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",... | Determine the min and max "z" values in an array of Coordinates.
@param cs The array to search.
@return An array of size 2, index 0 is min, index 1 is max. | [
"Determine",
"the",
"min",
"and",
"max",
"z",
"values",
"in",
"an",
"array",
"of",
"Coordinates",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java#L44-L77 |
107,631 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java | CoordinateUtils.contains2D | public static boolean contains2D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals2D(coord)) {
return true;
}
}
return false;
} | java | public static boolean contains2D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals2D(coord)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains2D",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"Coordinate",
"coord",
")",
"{",
"for",
"(",
"Coordinate",
"coordinate",
":",
"coords",
")",
"{",
"if",
"(",
"coordinate",
".",
"equals2D",
"(",
"coord",
")",
")",
"... | Checks if a coordinate array contains a specific coordinate.
The equality is done only in 2D (z values are not checked).
@param coords
@param coord
@return | [
"Checks",
"if",
"a",
"coordinate",
"array",
"contains",
"a",
"specific",
"coordinate",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java#L107-L114 |
107,632 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java | CoordinateUtils.vectorIntersection | public static Coordinate vectorIntersection(Coordinate p1, Vector3D v1, Coordinate p2, Vector3D v2) {
double delta;
Coordinate i = null;
// Cramer's rule for compute intersection of two planes
delta = v1.getX() * (-v2.getY()) - (-v1.getY()) * v2.getX();
if (delta != 0) {
... | java | public static Coordinate vectorIntersection(Coordinate p1, Vector3D v1, Coordinate p2, Vector3D v2) {
double delta;
Coordinate i = null;
// Cramer's rule for compute intersection of two planes
delta = v1.getX() * (-v2.getY()) - (-v1.getY()) * v2.getX();
if (delta != 0) {
... | [
"public",
"static",
"Coordinate",
"vectorIntersection",
"(",
"Coordinate",
"p1",
",",
"Vector3D",
"v1",
",",
"Coordinate",
"p2",
",",
"Vector3D",
"v2",
")",
"{",
"double",
"delta",
";",
"Coordinate",
"i",
"=",
"null",
";",
"// Cramer's rule for compute intersectio... | Compute intersection point of two vectors
@param p1 Origin point
@param v1 Direction from p1
@param p2 Origin point 2
@param v2 Direction of p2
@return Null if vectors are collinear or if intersection is done behind one of origin point | [
"Compute",
"intersection",
"point",
"of",
"two",
"vectors"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java#L124-L139 |
107,633 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java | CoordinateUtils.removeRepeatedCoordinates | public static Coordinate[] removeRepeatedCoordinates(Coordinate[] coords, double tolerance, boolean duplicateFirstLast) {
ArrayList<Coordinate> finalCoords = new ArrayList<Coordinate>();
Coordinate prevCoord = coords[0];
finalCoords.add(prevCoord);
Coordinate firstCoord =prevCoor... | java | public static Coordinate[] removeRepeatedCoordinates(Coordinate[] coords, double tolerance, boolean duplicateFirstLast) {
ArrayList<Coordinate> finalCoords = new ArrayList<Coordinate>();
Coordinate prevCoord = coords[0];
finalCoords.add(prevCoord);
Coordinate firstCoord =prevCoor... | [
"public",
"static",
"Coordinate",
"[",
"]",
"removeRepeatedCoordinates",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"double",
"tolerance",
",",
"boolean",
"duplicateFirstLast",
")",
"{",
"ArrayList",
"<",
"Coordinate",
">",
"finalCoords",
"=",
"new",
"ArrayList",... | Remove repeated coordinates according a given tolerance
@param coords the input coordinates
@param tolerance to delete the coordinates
@param duplicateFirstLast false to delete the last coordinate
if there are equals
@return | [
"Remove",
"repeated",
"coordinates",
"according",
"a",
"given",
"tolerance"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java#L183-L207 |
107,634 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java | TSVDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
String regex = ".*(?i)\\b(select|from)\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.match... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
String regex = ".*(?i)\\b(select|from)\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.match... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Str... | Export a table or a query to as TSV file
@param connection Active connection, do not close this connection.
@param tableReference [[catalog.]schema.]table reference
@param fileName File path to read
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Export",
"a",
"table",
"or",
"a",
"query",
"to",
"as",
"TSV",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java#L109-L140 |
107,635 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java | TSVDriverFunction.exportFromResultSet | public void exportFromResultSet(Connection connection, ResultSet res, File fileName, ProgressVisitor progress, String encoding) throws SQLException {
Csv csv = new Csv();
String csvOptions = "charset=UTF-8 fieldSeparator=\t fieldDelimiter=\t";
if (encoding != null) {
csvOptions = Str... | java | public void exportFromResultSet(Connection connection, ResultSet res, File fileName, ProgressVisitor progress, String encoding) throws SQLException {
Csv csv = new Csv();
String csvOptions = "charset=UTF-8 fieldSeparator=\t fieldDelimiter=\t";
if (encoding != null) {
csvOptions = Str... | [
"public",
"void",
"exportFromResultSet",
"(",
"Connection",
"connection",
",",
"ResultSet",
"res",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
"{",
"Csv",
"csv",
"=",
"new",
"Csv",
"(",
... | Export a resultset to a TSV file
@param connection
@param res
@param fileName
@param progress
@param encoding
@throws java.sql.SQLException | [
"Export",
"a",
"resultset",
"to",
"a",
"TSV",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java#L152-L160 |
107,636 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java | ST_OSMMapLink.generateLink | public static String generateLink(Geometry geom, boolean withMarker) {
if (geom == null) {
return null;
}
Envelope env = geom.getEnvelopeInternal();
StringBuilder sb = new StringBuilder("http://www.openstreetmap.org/?");
sb.append("minlon=").append(env.getMinX());
... | java | public static String generateLink(Geometry geom, boolean withMarker) {
if (geom == null) {
return null;
}
Envelope env = geom.getEnvelopeInternal();
StringBuilder sb = new StringBuilder("http://www.openstreetmap.org/?");
sb.append("minlon=").append(env.getMinX());
... | [
"public",
"static",
"String",
"generateLink",
"(",
"Geometry",
"geom",
",",
"boolean",
"withMarker",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Envelope",
"env",
"=",
"geom",
".",
"getEnvelopeInternal",
"(",
")",
";... | Create the OSM map link based on the bounding box of the geometry.
@param geom the input geometry.
@param withMarker true to place a marker on the center of the BBox.
@return | [
"Create",
"the",
"OSM",
"map",
"link",
"based",
"on",
"the",
"bounding",
"box",
"of",
"the",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java#L63-L79 |
107,637 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java | ST_MakePolygon.makePolygon | public static Polygon makePolygon(Geometry shell) throws IllegalArgumentException {
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineString(shell);
return shell.getFactory().createPolygon(outerLine, null);
} | java | public static Polygon makePolygon(Geometry shell) throws IllegalArgumentException {
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineString(shell);
return shell.getFactory().createPolygon(outerLine, null);
} | [
"public",
"static",
"Polygon",
"makePolygon",
"(",
"Geometry",
"shell",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"shell",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"LinearRing",
"outerLine",
"=",
"checkLineString",
"(",
"shell",
")"... | Creates a Polygon formed by the given shell.
@param shell
@return | [
"Creates",
"a",
"Polygon",
"formed",
"by",
"the",
"given",
"shell",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java#L52-L58 |
107,638 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java | ST_MakePolygon.makePolygon | public static Polygon makePolygon(Geometry shell, Geometry... holes) throws IllegalArgumentException {
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineString(shell);
LinearRing[] interiorlinestrings = new LinearRing[holes.length];
for (int i = 0; i ... | java | public static Polygon makePolygon(Geometry shell, Geometry... holes) throws IllegalArgumentException {
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineString(shell);
LinearRing[] interiorlinestrings = new LinearRing[holes.length];
for (int i = 0; i ... | [
"public",
"static",
"Polygon",
"makePolygon",
"(",
"Geometry",
"shell",
",",
"Geometry",
"...",
"holes",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"shell",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"LinearRing",
"outerLine",
"=",
"... | Creates a Polygon formed by the given shell and holes.
@param shell
@param holes
@return | [
"Creates",
"a",
"Polygon",
"formed",
"by",
"the",
"given",
"shell",
"and",
"holes",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java#L67-L77 |
107,639 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java | ST_MakePolygon.checkLineString | private static LinearRing checkLineString(Geometry geometry) throws IllegalArgumentException {
if (geometry instanceof LinearRing) {
return (LinearRing) geometry;
} else if (geometry instanceof LineString) {
LineString lineString = (LineString) geometry;
if (lineStri... | java | private static LinearRing checkLineString(Geometry geometry) throws IllegalArgumentException {
if (geometry instanceof LinearRing) {
return (LinearRing) geometry;
} else if (geometry instanceof LineString) {
LineString lineString = (LineString) geometry;
if (lineStri... | [
"private",
"static",
"LinearRing",
"checkLineString",
"(",
"Geometry",
"geometry",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"geometry",
"instanceof",
"LinearRing",
")",
"{",
"return",
"(",
"LinearRing",
")",
"geometry",
";",
"}",
"else",
"if",
... | Check if a geometry is a linestring and if its closed.
@param geometry
@return
@throws IllegalArgumentException | [
"Check",
"if",
"a",
"geometry",
"is",
"a",
"linestring",
"and",
"if",
"its",
"closed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java#L86-L100 |
107,640 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java | ST_Transform.ST_Transform | public static Geometry ST_Transform(Connection connection, Geometry geom, Integer codeEpsg) throws SQLException, CoordinateOperationException {
if (geom == null) {
return null;
}
if (codeEpsg == null) {
throw new IllegalArgumentException("The SRID code cannot be null.");
... | java | public static Geometry ST_Transform(Connection connection, Geometry geom, Integer codeEpsg) throws SQLException, CoordinateOperationException {
if (geom == null) {
return null;
}
if (codeEpsg == null) {
throw new IllegalArgumentException("The SRID code cannot be null.");
... | [
"public",
"static",
"Geometry",
"ST_Transform",
"(",
"Connection",
"connection",
",",
"Geometry",
"geom",
",",
"Integer",
"codeEpsg",
")",
"throws",
"SQLException",
",",
"CoordinateOperationException",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"n... | Returns a new geometry transformed to the SRID referenced by the integer
parameter available in the spatial_ref_sys table
@param connection
@param geom
@param codeEpsg
@return
@throws SQLException | [
"Returns",
"a",
"new",
"geometry",
"transformed",
"to",
"the",
"SRID",
"referenced",
"by",
"the",
"integer",
"parameter",
"available",
"in",
"the",
"spatial_ref_sys",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java#L82-L140 |
107,641 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java | ST_Node.node | public static Geometry node(Geometry geom) {
if (geom == null) {
return null;
}
Noder noder = new MCIndexNoder(new IntersectionAdder(new RobustLineIntersector()));
noder.computeNodes(SegmentStringUtil.extractNodedSegmentStrings(geom));
return SegmentStringUtil... | java | public static Geometry node(Geometry geom) {
if (geom == null) {
return null;
}
Noder noder = new MCIndexNoder(new IntersectionAdder(new RobustLineIntersector()));
noder.computeNodes(SegmentStringUtil.extractNodedSegmentStrings(geom));
return SegmentStringUtil... | [
"public",
"static",
"Geometry",
"node",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Noder",
"noder",
"=",
"new",
"MCIndexNoder",
"(",
"new",
"IntersectionAdder",
"(",
"new",
"RobustLineIntersec... | Nodes a geometry using a monotone chain and a spatial index
@param geom
@return | [
"Nodes",
"a",
"geometry",
"using",
"a",
"monotone",
"chain",
"and",
"a",
"spatial",
"index"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java#L50-L57 |
107,642 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java | AbstractGpxParserWpt.initialise | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setWptPreparedStmt(parent.getWptPreparedStmt());
setElementNames(parent.getElementNames());
setCurrentPoint(paren... | java | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setWptPreparedStmt(parent.getWptPreparedStmt());
setElementNames(parent.getElementNames());
setCurrentPoint(paren... | [
"public",
"void",
"initialise",
"(",
"XMLReader",
"reader",
",",
"AbstractGpxParserDefault",
"parent",
")",
"{",
"setReader",
"(",
"reader",
")",
";",
"setParent",
"(",
"parent",
")",
";",
"setContentBuffer",
"(",
"parent",
".",
"getContentBuffer",
"(",
")",
"... | Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames and the currentPoint.
@param reader The XMLReader used in the default class
@param parent The parser used in the default class | [
"Create",
"a",
"new",
"specific",
"parser",
".",
"It",
"has",
"in",
"memory",
"the",
"default",
"parser",
"the",
"contentBuffer",
"the",
"elementNames",
"and",
"the",
"currentPoint",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java#L48-L55 |
107,643 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java | AbstractGpxParserWpt.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
// Clear content buffer
getContentBuffer().delete(0, getContentBuffer().length());
// Store name of current element in stack
getElementNames().push(qName);
... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
// Clear content buffer
getContentBuffer().delete(0, getContentBuffer().length());
// Store name of current element in stack
getElementNames().push(qName);
... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"// Clear content buffer",
"getContentBuffer",
"(",
")",
".",
"delete"... | Fires whenever an XML start markup is encountered.
@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 in the
markup)
@throws SAXException Any SAX exception, po... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java#L68-L74 |
107,644 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeRepeatedPoints | public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLException, SQLException, SQLException, SQLException {
return removeDuplicateCoordinates(geometry, 0);
} | java | public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLException, SQLException, SQLException, SQLException {
return removeDuplicateCoordinates(geometry, 0);
} | [
"public",
"static",
"Geometry",
"removeRepeatedPoints",
"(",
"Geometry",
"geometry",
")",
"throws",
"SQLException",
",",
"SQLException",
",",
"SQLException",
",",
"SQLException",
"{",
"return",
"removeDuplicateCoordinates",
"(",
"geometry",
",",
"0",
")",
";",
"}"
] | Returns a version of the given geometry with duplicated points removed.
@param geometry
@return
@throws java.sql.SQLException | [
"Returns",
"a",
"version",
"of",
"the",
"given",
"geometry",
"with",
"duplicated",
"points",
"removed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L56-L58 |
107,645 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeDuplicateCoordinates | public static Geometry removeDuplicateCoordinates(Geometry geom, double tolerance) throws SQLException {
if (geom == null) {
return null;
} else if (geom.isEmpty()) {
return geom;
} else if (geom instanceof Point) {
return geom;
} else if (geom instanc... | java | public static Geometry removeDuplicateCoordinates(Geometry geom, double tolerance) throws SQLException {
if (geom == null) {
return null;
} else if (geom.isEmpty()) {
return geom;
} else if (geom instanceof Point) {
return geom;
} else if (geom instanc... | [
"public",
"static",
"Geometry",
"removeDuplicateCoordinates",
"(",
"Geometry",
"geom",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"geom",
".",
"i... | Removes duplicated points within a geometry.
@param geom
@param tolerance to delete the coordinates
@return
@throws java.sql.SQLException | [
"Removes",
"duplicated",
"points",
"within",
"a",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L80-L101 |
107,646 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.openSpatialDataBase | public static Connection openSpatialDataBase(String dbName) throws SQLException, ClassNotFoundException {
String dbFilePath = getDataBasePath(dbName);
String databasePath = "jdbc:h2:"+ dbFilePath + H2_PARAMETERS;
org.h2.Driver.load();
// Keep a connection alive to not close the Da... | java | public static Connection openSpatialDataBase(String dbName) throws SQLException, ClassNotFoundException {
String dbFilePath = getDataBasePath(dbName);
String databasePath = "jdbc:h2:"+ dbFilePath + H2_PARAMETERS;
org.h2.Driver.load();
// Keep a connection alive to not close the Da... | [
"public",
"static",
"Connection",
"openSpatialDataBase",
"(",
"String",
"dbName",
")",
"throws",
"SQLException",
",",
"ClassNotFoundException",
"{",
"String",
"dbFilePath",
"=",
"getDataBasePath",
"(",
"dbName",
")",
";",
"String",
"databasePath",
"=",
"\"jdbc:h2:\"",... | Open the connection to an existing database
@param dbName
@return
@throws SQLException
@throws ClassNotFoundException | [
"Open",
"the",
"connection",
"to",
"an",
"existing",
"database"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L54-L61 |
107,647 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.getDataBasePath | private static String getDataBasePath(String dbName) {
if(dbName.startsWith("file://")) {
return new File(URI.create(dbName)).getAbsolutePath();
} else {
return new File("target/test-resources/dbH2" + dbName).getAbsolutePath();
}
} | java | private static String getDataBasePath(String dbName) {
if(dbName.startsWith("file://")) {
return new File(URI.create(dbName)).getAbsolutePath();
} else {
return new File("target/test-resources/dbH2" + dbName).getAbsolutePath();
}
} | [
"private",
"static",
"String",
"getDataBasePath",
"(",
"String",
"dbName",
")",
"{",
"if",
"(",
"dbName",
".",
"startsWith",
"(",
"\"file://\"",
")",
")",
"{",
"return",
"new",
"File",
"(",
"URI",
".",
"create",
"(",
"dbName",
")",
")",
".",
"getAbsolute... | Return the path of the file database
@param dbName
@return | [
"Return",
"the",
"path",
"of",
"the",
"file",
"database"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L78-L84 |
107,648 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.createSpatialDataBase | public static Connection createSpatialDataBase(String dbName,boolean initSpatial, String h2Parameters )throws SQLException, ClassNotFoundException {
String databasePath = initDBFile(dbName, h2Parameters);
org.h2.Driver.load();
// Keep a connection alive to not close the DataBase on each unit tes... | java | public static Connection createSpatialDataBase(String dbName,boolean initSpatial, String h2Parameters )throws SQLException, ClassNotFoundException {
String databasePath = initDBFile(dbName, h2Parameters);
org.h2.Driver.load();
// Keep a connection alive to not close the DataBase on each unit tes... | [
"public",
"static",
"Connection",
"createSpatialDataBase",
"(",
"String",
"dbName",
",",
"boolean",
"initSpatial",
",",
"String",
"h2Parameters",
")",
"throws",
"SQLException",
",",
"ClassNotFoundException",
"{",
"String",
"databasePath",
"=",
"initDBFile",
"(",
"dbNa... | Create a spatial database
@param dbName filename
@param initSpatial If true add spatial features to the database
@param h2Parameters Additional h2 parameters
@return Connection
@throws java.sql.SQLException
@throws java.lang.ClassNotFoundException | [
"Create",
"a",
"spatial",
"database"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L154-L165 |
107,649 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java | H2GISDBFactory.createSpatialDataBase | public static Connection createSpatialDataBase(String dbName, boolean initSpatial )throws SQLException, ClassNotFoundException {
return createSpatialDataBase(dbName, initSpatial, H2_PARAMETERS);
} | java | public static Connection createSpatialDataBase(String dbName, boolean initSpatial )throws SQLException, ClassNotFoundException {
return createSpatialDataBase(dbName, initSpatial, H2_PARAMETERS);
} | [
"public",
"static",
"Connection",
"createSpatialDataBase",
"(",
"String",
"dbName",
",",
"boolean",
"initSpatial",
")",
"throws",
"SQLException",
",",
"ClassNotFoundException",
"{",
"return",
"createSpatialDataBase",
"(",
"dbName",
",",
"initSpatial",
",",
"H2_PARAMETER... | Create a spatial database and register all H2GIS functions
@param dbName filename
@param initSpatial If true add spatial features to the database
@return Connection
@throws java.sql.SQLException
@throws java.lang.ClassNotFoundException | [
"Create",
"a",
"spatial",
"database",
"and",
"register",
"all",
"H2GIS",
"functions"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java#L175-L177 |
107,650 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java | ST_ClosestPoint.closestPoint | public static Point closestPoint(Geometry geomA, Geometry geomB) {
if (geomA == null || geomB == null) {
return null;
}
// Return the closest point on geomA. (We would have used index
// 1 to return the closest point on geomB.)
return geomA.getFactory().createPoint(Di... | java | public static Point closestPoint(Geometry geomA, Geometry geomB) {
if (geomA == null || geomB == null) {
return null;
}
// Return the closest point on geomA. (We would have used index
// 1 to return the closest point on geomB.)
return geomA.getFactory().createPoint(Di... | [
"public",
"static",
"Point",
"closestPoint",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Return the closest point on geomA. (We would have ... | Returns the 2D point on geometry A that is closest to geometry B.
@param geomA Geometry A
@param geomB Geometry B
@return The 2D point on geometry A that is closest to geometry B | [
"Returns",
"the",
"2D",
"point",
"on",
"geometry",
"A",
"that",
"is",
"closest",
"to",
"geometry",
"B",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java#L55-L62 |
107,651 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java | ST_ToMultiSegments.createSegments | public static MultiLineString createSegments(Geometry geom) throws SQLException {
if (geom != null) {
List<LineString> result;
if (geom.getDimension() > 0) {
result = new LinkedList<LineString>();
createSegments(geom, result);
return GEOMET... | java | public static MultiLineString createSegments(Geometry geom) throws SQLException {
if (geom != null) {
List<LineString> result;
if (geom.getDimension() > 0) {
result = new LinkedList<LineString>();
createSegments(geom, result);
return GEOMET... | [
"public",
"static",
"MultiLineString",
"createSegments",
"(",
"Geometry",
"geom",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"List",
"<",
"LineString",
">",
"result",
";",
"if",
"(",
"geom",
".",
"getDimension",
"(",
")"... | Converts a geometry into a set of distinct segments stored in a
MultiLineString.
@param geom Geometry
@return A MultiLineString of the geometry's distinct segments
@throws SQLException | [
"Converts",
"a",
"geometry",
"into",
"a",
"set",
"of",
"distinct",
"segments",
"stored",
"in",
"a",
"MultiLineString",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java#L60-L73 |
107,652 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java | GeoJsonWrite.writeGeoJson | public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
GeoJsonDriverFunction geoJsonDriver = new GeoJsonDriverFunction();
geoJsonDriver.exportTable(connection,tableReference, URIUtilities.fileFromString(fileName)... | java | public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
GeoJsonDriverFunction geoJsonDriver = new GeoJsonDriverFunction();
geoJsonDriver.exportTable(connection,tableReference, URIUtilities.fileFromString(fileName)... | [
"public",
"static",
"void",
"writeGeoJson",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
",",
"String",
"encoding",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"GeoJsonDriverFunction",
"geoJsonDriver",
"=",
... | Write the GeoJSON file.
@param connection
@param fileName
@param tableReference
@param encoding
@throws IOException
@throws SQLException | [
"Write",
"the",
"GeoJSON",
"file",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java#L59-L62 |
107,653 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java | ST_RemoveHoles.removeHoles | public static Geometry removeHoles(Geometry geometry) {
if(geometry == null){
return null;
}
if (geometry instanceof Polygon) {
return removeHolesPolygon((Polygon) geometry);
} else if (geometry instanceof MultiPolygon) {
return removeHolesMultiPolygon... | java | public static Geometry removeHoles(Geometry geometry) {
if(geometry == null){
return null;
}
if (geometry instanceof Polygon) {
return removeHolesPolygon((Polygon) geometry);
} else if (geometry instanceof MultiPolygon) {
return removeHolesMultiPolygon... | [
"public",
"static",
"Geometry",
"removeHoles",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geometry",
"instanceof",
"Polygon",
")",
"{",
"return",
"removeHolesPolygon",
"(",
... | Remove any holes from the geometry. If the geometry doesn't contain any
holes, return it unchanged.
@param geometry Geometry
@return Geometry with no holes * | [
"Remove",
"any",
"holes",
"from",
"the",
"geometry",
".",
"If",
"the",
"geometry",
"doesn",
"t",
"contain",
"any",
"holes",
"return",
"it",
"unchanged",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java#L53-L76 |
107,654 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java | ST_RemoveHoles.removeHolesMultiPolygon | public static MultiPolygon removeHolesMultiPolygon(MultiPolygon multiPolygon) {
int num = multiPolygon.getNumGeometries();
Polygon[] polygons = new Polygon[num];
for (int i = 0; i < num; i++) {
polygons[i] = removeHolesPolygon((Polygon) multiPolygon.getGeometryN(i));
}
... | java | public static MultiPolygon removeHolesMultiPolygon(MultiPolygon multiPolygon) {
int num = multiPolygon.getNumGeometries();
Polygon[] polygons = new Polygon[num];
for (int i = 0; i < num; i++) {
polygons[i] = removeHolesPolygon((Polygon) multiPolygon.getGeometryN(i));
}
... | [
"public",
"static",
"MultiPolygon",
"removeHolesMultiPolygon",
"(",
"MultiPolygon",
"multiPolygon",
")",
"{",
"int",
"num",
"=",
"multiPolygon",
".",
"getNumGeometries",
"(",
")",
";",
"Polygon",
"[",
"]",
"polygons",
"=",
"new",
"Polygon",
"[",
"num",
"]",
";... | Create a new multiPolygon without hole.
@param multiPolygon
@return | [
"Create",
"a",
"new",
"multiPolygon",
"without",
"hole",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java#L84-L91 |
107,655 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java | ST_RemoveHoles.removeHolesPolygon | public static Polygon removeHolesPolygon(Polygon polygon) {
return new Polygon((LinearRing) polygon.getExteriorRing(), null, polygon.getFactory());
} | java | public static Polygon removeHolesPolygon(Polygon polygon) {
return new Polygon((LinearRing) polygon.getExteriorRing(), null, polygon.getFactory());
} | [
"public",
"static",
"Polygon",
"removeHolesPolygon",
"(",
"Polygon",
"polygon",
")",
"{",
"return",
"new",
"Polygon",
"(",
"(",
"LinearRing",
")",
"polygon",
".",
"getExteriorRing",
"(",
")",
",",
"null",
",",
"polygon",
".",
"getFactory",
"(",
")",
")",
"... | Create a new polygon without hole.
@param polygon
@return | [
"Create",
"a",
"new",
"polygon",
"without",
"hole",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java#L99-L101 |
107,656 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java | ST_Interpolate3DLine.linearZInterpolation | private static LineString linearZInterpolation(LineString lineString) {
double startz = lineString.getStartPoint().getCoordinate().z;
double endz = lineString.getEndPoint().getCoordinate().z;
if (Double.isNaN(startz) || Double.isNaN(endz)) {
return lineString;
} else {
... | java | private static LineString linearZInterpolation(LineString lineString) {
double startz = lineString.getStartPoint().getCoordinate().z;
double endz = lineString.getEndPoint().getCoordinate().z;
if (Double.isNaN(startz) || Double.isNaN(endz)) {
return lineString;
} else {
... | [
"private",
"static",
"LineString",
"linearZInterpolation",
"(",
"LineString",
"lineString",
")",
"{",
"double",
"startz",
"=",
"lineString",
".",
"getStartPoint",
"(",
")",
".",
"getCoordinate",
"(",
")",
".",
"z",
";",
"double",
"endz",
"=",
"lineString",
"."... | Interpolate a linestring according the start and the end coordinates z
value. If the start or the end z is NaN return the input linestring
@param lineString
@return | [
"Interpolate",
"a",
"linestring",
"according",
"the",
"start",
"and",
"the",
"end",
"coordinates",
"z",
"value",
".",
"If",
"the",
"start",
"or",
"the",
"end",
"z",
"is",
"NaN",
"return",
"the",
"input",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java#L70-L80 |
107,657 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java | ST_Interpolate3DLine.linearZInterpolation | private static MultiLineString linearZInterpolation(MultiLineString multiLineString) {
int nbGeom = multiLineString.getNumGeometries();
LineString[] lines = new LineString[nbGeom];
for (int i = 0; i < nbGeom; i++) {
LineString subGeom = (LineString) multiLineString.getGeometryN(i);
... | java | private static MultiLineString linearZInterpolation(MultiLineString multiLineString) {
int nbGeom = multiLineString.getNumGeometries();
LineString[] lines = new LineString[nbGeom];
for (int i = 0; i < nbGeom; i++) {
LineString subGeom = (LineString) multiLineString.getGeometryN(i);
... | [
"private",
"static",
"MultiLineString",
"linearZInterpolation",
"(",
"MultiLineString",
"multiLineString",
")",
"{",
"int",
"nbGeom",
"=",
"multiLineString",
".",
"getNumGeometries",
"(",
")",
";",
"LineString",
"[",
"]",
"lines",
"=",
"new",
"LineString",
"[",
"n... | Interpolate each linestring of the multilinestring.
@param multiLineString
@return | [
"Interpolate",
"each",
"linestring",
"of",
"the",
"multilinestring",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java#L88-L101 |
107,658 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java | ShapeType.isMultiPoint | public boolean isMultiPoint() {
boolean mp = true;
if (this == UNDEFINED) { mp = false; }
else if (this == NULL) { mp = false; }
else if (this == POINT) { mp = false; }
return mp;
} | java | public boolean isMultiPoint() {
boolean mp = true;
if (this == UNDEFINED) { mp = false; }
else if (this == NULL) { mp = false; }
else if (this == POINT) { mp = false; }
return mp;
} | [
"public",
"boolean",
"isMultiPoint",
"(",
")",
"{",
"boolean",
"mp",
"=",
"true",
";",
"if",
"(",
"this",
"==",
"UNDEFINED",
")",
"{",
"mp",
"=",
"false",
";",
"}",
"else",
"if",
"(",
"this",
"==",
"NULL",
")",
"{",
"mp",
"=",
"false",
";",
"}",
... | Is this a multipoint shape? Hint- all shapes are multipoint except NULL,
UNDEFINED, and the POINTs.
@return true if multipoint, false otherwise. | [
"Is",
"this",
"a",
"multipoint",
"shape?",
"Hint",
"-",
"all",
"shapes",
"are",
"multipoint",
"except",
"NULL",
"UNDEFINED",
"and",
"the",
"POINTs",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java#L86-L92 |
107,659 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java | ShapeType.forID | public static ShapeType forID(int id) {
ShapeType t;
switch (id) {
case 0:
t = NULL;
break;
case 1:
t = POINT;
break;
case 11:
t = POINTZ;
break;
case 21:
t = POINTM;
break;
case 3:
t = ARC;
break;
... | java | public static ShapeType forID(int id) {
ShapeType t;
switch (id) {
case 0:
t = NULL;
break;
case 1:
t = POINT;
break;
case 11:
t = POINTZ;
break;
case 21:
t = POINTM;
break;
case 3:
t = ARC;
break;
... | [
"public",
"static",
"ShapeType",
"forID",
"(",
"int",
"id",
")",
"{",
"ShapeType",
"t",
";",
"switch",
"(",
"id",
")",
"{",
"case",
"0",
":",
"t",
"=",
"NULL",
";",
"break",
";",
"case",
"1",
":",
"t",
"=",
"POINT",
";",
"break",
";",
"case",
"... | Determine the ShapeType for the id.
@param id The id to search for.
@return The ShapeType for the id. | [
"Determine",
"the",
"ShapeType",
"for",
"the",
"id",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java#L114-L161 |
107,660 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java | ShapeType.getShapeHandler | public ShapeHandler getShapeHandler() throws ShapefileException {
ShapeHandler handler;
switch (id) {
case 1: case 11: case 21:
handler = new PointHandler(this);
break;
case 3: case 13: case 23:
handler = new MultiLineHandler(this);
break;
case 5: case 15: case ... | java | public ShapeHandler getShapeHandler() throws ShapefileException {
ShapeHandler handler;
switch (id) {
case 1: case 11: case 21:
handler = new PointHandler(this);
break;
case 3: case 13: case 23:
handler = new MultiLineHandler(this);
break;
case 5: case 15: case ... | [
"public",
"ShapeHandler",
"getShapeHandler",
"(",
")",
"throws",
"ShapefileException",
"{",
"ShapeHandler",
"handler",
";",
"switch",
"(",
"id",
")",
"{",
"case",
"1",
":",
"case",
"11",
":",
"case",
"21",
":",
"handler",
"=",
"new",
"PointHandler",
"(",
"... | Each ShapeType corresponds to a handler. In the future this should probably go
else where to allow different handlers, or something...
@throws ShapefileException If the ShapeType is bogus.
@return The correct handler for this ShapeType. Returns a new one. | [
"Each",
"ShapeType",
"corresponds",
"to",
"a",
"handler",
".",
"In",
"the",
"future",
"this",
"should",
"probably",
"go",
"else",
"where",
"to",
"allow",
"different",
"handlers",
"or",
"something",
"..."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeType.java#L168-L187 |
107,661 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createTagTable | public static PreparedStatement createTagTable(Connection connection, String tagTableName) throws SQLException {
// PostgreSQL and H2 will automatically create an index on TAG_KEY,TAG_VALUE when UNIQUE constraint is set
try (Statement stmt = connection.createStatement()) {
// PostgreSQL and ... | java | public static PreparedStatement createTagTable(Connection connection, String tagTableName) throws SQLException {
// PostgreSQL and H2 will automatically create an index on TAG_KEY,TAG_VALUE when UNIQUE constraint is set
try (Statement stmt = connection.createStatement()) {
// PostgreSQL and ... | [
"public",
"static",
"PreparedStatement",
"createTagTable",
"(",
"Connection",
"connection",
",",
"String",
"tagTableName",
")",
"throws",
"SQLException",
"{",
"// PostgreSQL and H2 will automatically create an index on TAG_KEY,TAG_VALUE when UNIQUE constraint is set",
"try",
"(",
"... | Create the tag table to store all key and value
@param connection
@param tagTableName
@return
@throws SQLException | [
"Create",
"the",
"tag",
"table",
"to",
"store",
"all",
"key",
"and",
"value"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L79-L87 |
107,662 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createWayTagTable | public static PreparedStatement createWayTagTable(Connection connection, String wayTagTableName, String tagTableName) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayTagTableName);
... | java | public static PreparedStatement createWayTagTable(Connection connection, String wayTagTableName, String tagTableName) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayTagTableName);
... | [
"public",
"static",
"PreparedStatement",
"createWayTagTable",
"(",
"Connection",
"connection",
",",
"String",
"wayTagTableName",
",",
"String",
"tagTableName",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatemen... | Create a table to store the way tags.
@param connection
@param wayTagTableName
@param tagTableName
@return
@throws SQLException | [
"Create",
"a",
"table",
"to",
"store",
"the",
"way",
"tags",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L181-L195 |
107,663 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createWayNodeTable | public static PreparedStatement createWayNodeTable(Connection connection, String wayNodeTableName) throws SQLException{
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayNodeTableName);
sb.append("(ID_WAY... | java | public static PreparedStatement createWayNodeTable(Connection connection, String wayNodeTableName) throws SQLException{
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayNodeTableName);
sb.append("(ID_WAY... | [
"public",
"static",
"PreparedStatement",
"createWayNodeTable",
"(",
"Connection",
"connection",
",",
"String",
"wayNodeTableName",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"... | Create a table to store the list of nodes for each way.
@param connection
@param wayNodeTableName
@return
@throws SQLException | [
"Create",
"a",
"table",
"to",
"store",
"the",
"list",
"of",
"nodes",
"for",
"each",
"way",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L205-L213 |
107,664 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createRelationTable | public static PreparedStatement createRelationTable(Connection connection, String relationTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(relationTable);
sb.append("(ID_RELATIO... | java | public static PreparedStatement createRelationTable(Connection connection, String relationTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(relationTable);
sb.append("(ID_RELATIO... | [
"public",
"static",
"PreparedStatement",
"createRelationTable",
"(",
"Connection",
"connection",
",",
"String",
"relationTable",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"St... | Create the relation table.
@param connection
@param relationTable
@return
@throws SQLException | [
"Create",
"the",
"relation",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L223-L237 |
107,665 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createNodeMemberTable | public static PreparedStatement createNodeMemberTable(Connection connection, String nodeMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(nodeMemberTable);
sb.append("(ID_R... | java | public static PreparedStatement createNodeMemberTable(Connection connection, String nodeMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(nodeMemberTable);
sb.append("(ID_R... | [
"public",
"static",
"PreparedStatement",
"createNodeMemberTable",
"(",
"Connection",
"connection",
",",
"String",
"nodeMemberTable",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
... | Create the node members table
@param connection
@param nodeMemberTable
@return
@throws SQLException | [
"Create",
"the",
"node",
"members",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L272-L280 |
107,666 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createWayMemberTable | public static PreparedStatement createWayMemberTable(Connection connection, String wayMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayMemberTable);
sb.append("(ID_RELA... | java | public static PreparedStatement createWayMemberTable(Connection connection, String wayMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(wayMemberTable);
sb.append("(ID_RELA... | [
"public",
"static",
"PreparedStatement",
"createWayMemberTable",
"(",
"Connection",
"connection",
",",
"String",
"wayMemberTable",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"... | Create a table to store all way members.
@param connection
@param wayMemberTable
@return
@throws SQLException | [
"Create",
"a",
"table",
"to",
"store",
"all",
"way",
"members",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L290-L298 |
107,667 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.createRelationMemberTable | public static PreparedStatement createRelationMemberTable(Connection connection, String relationMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(relationMemberTable);
sb.a... | java | public static PreparedStatement createRelationMemberTable(Connection connection, String relationMemberTable) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(relationMemberTable);
sb.a... | [
"public",
"static",
"PreparedStatement",
"createRelationMemberTable",
"(",
"Connection",
"connection",
",",
"String",
"relationMemberTable",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
... | Store all relation members
@param connection
@param relationMemberTable
@return
@throws SQLException | [
"Store",
"all",
"relation",
"members"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L308-L316 |
107,668 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.dropOSMTables | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String osmTableName = requestedTable.getTable();
String[] omsTables = new String[]{TAG, NODE, NODE_TAG, W... | java | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String osmTableName = requestedTable.getTable();
String[] omsTables = new String[]{TAG, NODE, NODE_TAG, W... | [
"public",
"static",
"void",
"dropOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"String",
"tablePrefix",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"requestedTable",
"=",
"TableLocation",
".",
"parse",
"(",
"tablePrefix",
",",
... | Drop the existing OSM tables used to store the imported OSM data
@param connection
@param isH2
@param tablePrefix
@throws SQLException | [
"Drop",
"the",
"existing",
"OSM",
"tables",
"used",
"to",
"store",
"the",
"imported",
"OSM",
"data"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L327-L343 |
107,669 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java | TINFeatureFactory.createTriangle | public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException {
Coordinate[] coordinates = geom.getCoordinates();
if (coordinates.length != 4) {
throw new IllegalArgumentException("The geometry must be a triangle");
}
... | java | public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException {
Coordinate[] coordinates = geom.getCoordinates();
if (coordinates.length != 4) {
throw new IllegalArgumentException("The geometry must be a triangle");
}
... | [
"public",
"static",
"Triangle",
"createTriangle",
"(",
"Geometry",
"geom",
")",
"throws",
"IllegalArgumentException",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"geom",
".",
"getCoordinates",
"(",
")",
";",
"if",
"(",
"coordinates",
".",
"length",
"!=",
... | A factory to create a DTriangle from a Geometry
@param geom
@return
@throws IllegalArgumentException
If there are not exactly 3 coordinates in geom. | [
"A",
"factory",
"to",
"create",
"a",
"DTriangle",
"from",
"a",
"Geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java#L49-L55 |
107,670 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.toKMLLineString | public static void toKMLLineString(LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<LineString>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
appendKMLCoordinates(lineString.getCoordinates(), sb);
sb.appe... | java | public static void toKMLLineString(LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<LineString>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
appendKMLCoordinates(lineString.getCoordinates(), sb);
sb.appe... | [
"public",
"static",
"void",
"toKMLLineString",
"(",
"LineString",
"lineString",
",",
"ExtrudeMode",
"extrude",
",",
"int",
"altitudeModeEnum",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"<LineString>\"",
")",
";",
"appendExtrude",
"(",
"ex... | Defines a connected set of line segments.
Syntax :
<LineString id="ID">
<!-- specific to LineString -->
<gx:altitudeOffset>0</gx:altitudeOffset> <!-- double -->
<extrude>0</extrude> <!-- boolean -->
<tessellate>0</tessellate> <!-- boolean -->
<altitudeMode>clampToGround</altitudeMode>
<!-- kml:altitudeModeEnum: clamp... | [
"Defines",
"a",
"connected",
"set",
"of",
"line",
"segments",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L140-L146 |
107,671 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.toKMLPolygon | public static void toKMLPolygon(Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<Polygon>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
sb.append("<outerBoundaryIs>");
toKMLLinearRing(polygon.getExteriorRing(),... | java | public static void toKMLPolygon(Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<Polygon>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
sb.append("<outerBoundaryIs>");
toKMLLinearRing(polygon.getExteriorRing(),... | [
"public",
"static",
"void",
"toKMLPolygon",
"(",
"Polygon",
"polygon",
",",
"ExtrudeMode",
"extrude",
",",
"int",
"altitudeModeEnum",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"<Polygon>\"",
")",
";",
"appendExtrude",
"(",
"extrude",
",... | A Polygon is defined by an outer boundary and 0 or more inner boundaries.
The boundaries, in turn, are defined by LinearRings.
Syntax :
<Polygon id="ID">
<!-- specific to Polygon -->
<extrude>0</extrude> <!-- boolean -->
<tessellate>0</tessellate> <!-- boolean -->
<altitudeMode>clampToGround</altitudeMode>
<!-- kml:a... | [
"A",
"Polygon",
"is",
"defined",
"by",
"an",
"outer",
"boundary",
"and",
"0",
"or",
"more",
"inner",
"boundaries",
".",
"The",
"boundaries",
"in",
"turn",
"are",
"defined",
"by",
"LinearRings",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L230-L243 |
107,672 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.appendKMLCoordinates | public static void appendKMLCoordinates(Coordinate[] coords, StringBuilder sb) {
sb.append("<coordinates>");
for (int i = 0; i < coords.length; i++) {
Coordinate coord = coords[i];
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
... | java | public static void appendKMLCoordinates(Coordinate[] coords, StringBuilder sb) {
sb.append("<coordinates>");
for (int i = 0; i < coords.length; i++) {
Coordinate coord = coords[i];
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
... | [
"public",
"static",
"void",
"appendKMLCoordinates",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"<coordinates>\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"coords",
".",
"l... | Build a string represention to kml coordinates
Syntax :
<coordinates>...</coordinates> <!-- lon,lat[,alt] tuples -->
@param coords | [
"Build",
"a",
"string",
"represention",
"to",
"kml",
"coordinates"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L282-L295 |
107,673 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java | KMLGeometry.appendExtrude | private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) {
if (extrude.equals(ExtrudeMode.TRUE)) {
sb.append("<extrude>").append(1).append("</extrude>");
} else if (extrude.equals(ExtrudeMode.FALSE)) {
sb.append("<extrude>").append(0).append("</extrude>");
... | java | private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) {
if (extrude.equals(ExtrudeMode.TRUE)) {
sb.append("<extrude>").append(1).append("</extrude>");
} else if (extrude.equals(ExtrudeMode.FALSE)) {
sb.append("<extrude>").append(0).append("</extrude>");
... | [
"private",
"static",
"void",
"appendExtrude",
"(",
"ExtrudeMode",
"extrude",
",",
"StringBuilder",
"sb",
")",
"{",
"if",
"(",
"extrude",
".",
"equals",
"(",
"ExtrudeMode",
".",
"TRUE",
")",
")",
"{",
"sb",
".",
"append",
"(",
"\"<extrude>\"",
")",
".",
"... | Append the extrude value
Syntax :
<extrude>0</extrude>
@param extrude
@param sb | [
"Append",
"the",
"extrude",
"value"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java#L307-L313 |
107,674 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeNameFromConstraint.java | GeometryTypeNameFromConstraint.getGeometryTypeNameFromConstraint | public static String getGeometryTypeNameFromConstraint(String constraint, int numericPrecision) {
int geometryTypeCode = GeometryTypeFromConstraint.geometryTypeFromConstraint(constraint, numericPrecision);
return SFSUtilities.getGeometryTypeNameFromCode(geometryTypeCode);
} | java | public static String getGeometryTypeNameFromConstraint(String constraint, int numericPrecision) {
int geometryTypeCode = GeometryTypeFromConstraint.geometryTypeFromConstraint(constraint, numericPrecision);
return SFSUtilities.getGeometryTypeNameFromCode(geometryTypeCode);
} | [
"public",
"static",
"String",
"getGeometryTypeNameFromConstraint",
"(",
"String",
"constraint",
",",
"int",
"numericPrecision",
")",
"{",
"int",
"geometryTypeCode",
"=",
"GeometryTypeFromConstraint",
".",
"geometryTypeFromConstraint",
"(",
"constraint",
",",
"numericPrecisi... | Parse the constraint and return the Geometry type name.
@param constraint Constraint on geometry type
@param numericPrecision of the geometry type
@return Geometry type | [
"Parse",
"the",
"constraint",
"and",
"return",
"the",
"Geometry",
"type",
"name",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeNameFromConstraint.java#L49-L52 |
107,675 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java | ST_CoordDim.getCoordinateDimension | public static Integer getCoordinateDimension(byte[] geom) throws IOException {
if (geom == null) {
return null;
}
return GeometryMetaData.getMetaDataFromWKB(geom).dimension;
} | java | public static Integer getCoordinateDimension(byte[] geom) throws IOException {
if (geom == null) {
return null;
}
return GeometryMetaData.getMetaDataFromWKB(geom).dimension;
} | [
"public",
"static",
"Integer",
"getCoordinateDimension",
"(",
"byte",
"[",
"]",
"geom",
")",
"throws",
"IOException",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"GeometryMetaData",
".",
"getMetaDataFromWKB",
"(",
"g... | Returns the dimension of the coordinates of the given geometry.
@param geom Geometry
@return The dimension of the coordinates of the given geometry
@throws IOException | [
"Returns",
"the",
"dimension",
"of",
"the",
"coordinates",
"of",
"the",
"given",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java#L52-L57 |
107,676 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircleCenter.java | ST_BoundingCircleCenter.getCircumCenter | public static Point getCircumCenter(Geometry geometry) {
if(geometry == null || geometry.getNumPoints() == 0) {
return null;
}
return geometry.getFactory().createPoint(new MinimumBoundingCircle(geometry).getCentre());
} | java | public static Point getCircumCenter(Geometry geometry) {
if(geometry == null || geometry.getNumPoints() == 0) {
return null;
}
return geometry.getFactory().createPoint(new MinimumBoundingCircle(geometry).getCentre());
} | [
"public",
"static",
"Point",
"getCircumCenter",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
"||",
"geometry",
".",
"getNumPoints",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",
"geometry",
".",
"getF... | Compute the minimum bounding circle center of a geometry
@param geometry Any geometry
@return Minimum bounding circle center point | [
"Compute",
"the",
"minimum",
"bounding",
"circle",
"center",
"of",
"a",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircleCenter.java#L52-L57 |
107,677 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java | DBFDriver.initDriverFromFile | public void initDriverFromFile(File dbfFile, String forceEncoding) throws IOException {
// Read columns from files metadata
this.dbfFile = dbfFile;
FileInputStream fis = new FileInputStream(dbfFile);
dbaseFileReader = new DbaseFileReader(fis.getChannel(), forceEncoding);
} | java | public void initDriverFromFile(File dbfFile, String forceEncoding) throws IOException {
// Read columns from files metadata
this.dbfFile = dbfFile;
FileInputStream fis = new FileInputStream(dbfFile);
dbaseFileReader = new DbaseFileReader(fis.getChannel(), forceEncoding);
} | [
"public",
"void",
"initDriverFromFile",
"(",
"File",
"dbfFile",
",",
"String",
"forceEncoding",
")",
"throws",
"IOException",
"{",
"// Read columns from files metadata",
"this",
".",
"dbfFile",
"=",
"dbfFile",
";",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStrea... | Init file header for DBF File
@param dbfFile DBF File path
@param forceEncoding File encoding to use, null will use the file encoding provided in the file header
@throws IOException | [
"Init",
"file",
"header",
"for",
"DBF",
"File"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java#L54-L59 |
107,678 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java | DBFDriver.insertRow | @Override
public void insertRow(Object[] values) throws IOException {
checkWriter();
if(values.length != getDbaseFileHeader().getNumFields()) {
throw new IllegalArgumentException("Incorrect field count "+values.length+" expected "+getFieldCount());
}
try {
dba... | java | @Override
public void insertRow(Object[] values) throws IOException {
checkWriter();
if(values.length != getDbaseFileHeader().getNumFields()) {
throw new IllegalArgumentException("Incorrect field count "+values.length+" expected "+getFieldCount());
}
try {
dba... | [
"@",
"Override",
"public",
"void",
"insertRow",
"(",
"Object",
"[",
"]",
"values",
")",
"throws",
"IOException",
"{",
"checkWriter",
"(",
")",
";",
"if",
"(",
"values",
".",
"length",
"!=",
"getDbaseFileHeader",
"(",
")",
".",
"getNumFields",
"(",
")",
"... | Write a row
@param values Content, must be of the same type as declared in the header | [
"Write",
"a",
"row"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java#L72-L83 |
107,679 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java | ST_RingBuffer.computePositiveRingBuffer | public static Geometry computePositiveRingBuffer(Geometry geom, double bufferDistance,
int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException {
Polygon[] buffers = new Polygon[numBuffer];
if (geom instanceof Polygon) {
//Work arround t... | java | public static Geometry computePositiveRingBuffer(Geometry geom, double bufferDistance,
int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException {
Polygon[] buffers = new Polygon[numBuffer];
if (geom instanceof Polygon) {
//Work arround t... | [
"public",
"static",
"Geometry",
"computePositiveRingBuffer",
"(",
"Geometry",
"geom",
",",
"double",
"bufferDistance",
",",
"int",
"numBuffer",
",",
"BufferParameters",
"bufferParameters",
",",
"boolean",
"doDifference",
")",
"throws",
"SQLException",
"{",
"Polygon",
... | Compute a ring buffer with a positive offset
@param geom
@param bufferDistance
@param numBuffer
@param bufferParameters
@param doDifference
@return
@throws SQLException | [
"Compute",
"a",
"ring",
"buffer",
"with",
"a",
"positive",
"offset"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java#L157-L177 |
107,680 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java | ST_RingBuffer.computeNegativeRingBuffer | public static Geometry computeNegativeRingBuffer(Geometry geom, double bufferDistance,
int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException {
Polygon[] buffers = new Polygon[numBuffer];
Geometry previous = geom;
double distance = 0;
if (... | java | public static Geometry computeNegativeRingBuffer(Geometry geom, double bufferDistance,
int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException {
Polygon[] buffers = new Polygon[numBuffer];
Geometry previous = geom;
double distance = 0;
if (... | [
"public",
"static",
"Geometry",
"computeNegativeRingBuffer",
"(",
"Geometry",
"geom",
",",
"double",
"bufferDistance",
",",
"int",
"numBuffer",
",",
"BufferParameters",
"bufferParameters",
",",
"boolean",
"doDifference",
")",
"throws",
"SQLException",
"{",
"Polygon",
... | Compute a ring buffer with a negative offset
@param geom
@param bufferDistance
@param numBuffer
@param bufferParameters
@param doDifference
@return
@throws SQLException | [
"Compute",
"a",
"ring",
"buffer",
"with",
"a",
"negative",
"offset"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java#L190-L214 |
107,681 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java | ST_RingBuffer.runBuffer | public static Geometry runBuffer(final Geometry geom, final double bufferSize,
final BufferParameters bufferParameters) throws SQLException {
return BufferOp.bufferOp(geom, bufferSize, bufferParameters);
} | java | public static Geometry runBuffer(final Geometry geom, final double bufferSize,
final BufferParameters bufferParameters) throws SQLException {
return BufferOp.bufferOp(geom, bufferSize, bufferParameters);
} | [
"public",
"static",
"Geometry",
"runBuffer",
"(",
"final",
"Geometry",
"geom",
",",
"final",
"double",
"bufferSize",
",",
"final",
"BufferParameters",
"bufferParameters",
")",
"throws",
"SQLException",
"{",
"return",
"BufferOp",
".",
"bufferOp",
"(",
"geom",
",",
... | Calculate the ring buffer
@param geom
@param bufferSize
@param bufferParameters
@return
@throws SQLException | [
"Calculate",
"the",
"ring",
"buffer"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java#L225-L228 |
107,682 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java | ST_Covers.covers | public static Boolean covers(Geometry geomA, Geometry geomB) {
if(geomA == null||geomB == null){
return null;
}
return geomA.covers(geomB);
} | java | public static Boolean covers(Geometry geomA, Geometry geomB) {
if(geomA == null||geomB == null){
return null;
}
return geomA.covers(geomB);
} | [
"public",
"static",
"Boolean",
"covers",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"geomA",
".",
"covers",
"(",
"geomB",
... | Returns true if no point in geometry B is outside geometry A.
@param geomA Geometry A
@param geomB Geometry B
@return True if no point in geometry B is outside geometry A | [
"Returns",
"true",
"if",
"no",
"point",
"in",
"geometry",
"B",
"is",
"outside",
"geometry",
"A",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java#L50-L55 |
107,683 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java | TriMarkers.getNormalVector | public static Vector3D getNormalVector(Triangle t) throws IllegalArgumentException {
if(Double.isNaN(t.p0.z) || Double.isNaN(t.p1.z) || Double.isNaN(t.p2.z)) {
throw new IllegalArgumentException("Z is required, cannot compute triangle normal of "+t);
}
double dx1 = t.p0.x - t.p1.x;
... | java | public static Vector3D getNormalVector(Triangle t) throws IllegalArgumentException {
if(Double.isNaN(t.p0.z) || Double.isNaN(t.p1.z) || Double.isNaN(t.p2.z)) {
throw new IllegalArgumentException("Z is required, cannot compute triangle normal of "+t);
}
double dx1 = t.p0.x - t.p1.x;
... | [
"public",
"static",
"Vector3D",
"getNormalVector",
"(",
"Triangle",
"t",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"t",
".",
"p0",
".",
"z",
")",
"||",
"Double",
".",
"isNaN",
"(",
"t",
".",
"p1",
".",
"z",... | Get the normal vector to this triangle, of length 1.
@param t input triangle
@return vector normal to the triangle. | [
"Get",
"the",
"normal",
"vector",
"to",
"this",
"triangle",
"of",
"length",
"1",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java#L171-L182 |
107,684 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java | TriMarkers.getSteepestVector | public static Vector3D getSteepestVector(final Vector3D normal, final double epsilon) {
if (Math.abs(normal.getX()) < epsilon && Math.abs(normal.getY()) < epsilon) {
return new Vector3D(0, 0, 0);
}
Vector3D slope;
if (Math.abs(normal.getX()) < epsilon) {
slope = n... | java | public static Vector3D getSteepestVector(final Vector3D normal, final double epsilon) {
if (Math.abs(normal.getX()) < epsilon && Math.abs(normal.getY()) < epsilon) {
return new Vector3D(0, 0, 0);
}
Vector3D slope;
if (Math.abs(normal.getX()) < epsilon) {
slope = n... | [
"public",
"static",
"Vector3D",
"getSteepestVector",
"(",
"final",
"Vector3D",
"normal",
",",
"final",
"double",
"epsilon",
")",
"{",
"if",
"(",
"Math",
".",
"abs",
"(",
"normal",
".",
"getX",
"(",
")",
")",
"<",
"epsilon",
"&&",
"Math",
".",
"abs",
"(... | Get the vector with the highest down slope in the plan.
@param normal
@param epsilon
@return the steepest vector. | [
"Get",
"the",
"vector",
"with",
"the",
"highest",
"down",
"slope",
"in",
"the",
"plan",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java#L190-L209 |
107,685 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/affine_transformations/ST_Scale.java | ST_Scale.scale | public static Geometry scale(Geometry geom, double xFactor, double yFactor) {
return scale(geom, xFactor, yFactor, 1.0);
} | java | public static Geometry scale(Geometry geom, double xFactor, double yFactor) {
return scale(geom, xFactor, yFactor, 1.0);
} | [
"public",
"static",
"Geometry",
"scale",
"(",
"Geometry",
"geom",
",",
"double",
"xFactor",
",",
"double",
"yFactor",
")",
"{",
"return",
"scale",
"(",
"geom",
",",
"xFactor",
",",
"yFactor",
",",
"1.0",
")",
";",
"}"
] | Scales the given geometry by multiplying the coordinates by the
indicated x and y scale factors, leaving the z-coordinate untouched.
@param geom Geometry
@param xFactor x scale factor
@param yFactor y scale factor
@return The geometry scaled by the given x and y scale factors | [
"Scales",
"the",
"given",
"geometry",
"by",
"multiplying",
"the",
"coordinates",
"by",
"the",
"indicated",
"x",
"and",
"y",
"scale",
"factors",
"leaving",
"the",
"z",
"-",
"coordinate",
"untouched",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/affine_transformations/ST_Scale.java#L54-L56 |
107,686 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/affine_transformations/ST_Scale.java | ST_Scale.scale | public static Geometry scale(Geometry geom, double xFactor, double yFactor, double zFactor) {
if (geom != null) {
Geometry scaledGeom = geom.copy();
for (Coordinate c : scaledGeom.getCoordinates()) {
c.setOrdinate(Coordinate.X, c.getOrdinate(Coordinate.X) * xFactor);
... | java | public static Geometry scale(Geometry geom, double xFactor, double yFactor, double zFactor) {
if (geom != null) {
Geometry scaledGeom = geom.copy();
for (Coordinate c : scaledGeom.getCoordinates()) {
c.setOrdinate(Coordinate.X, c.getOrdinate(Coordinate.X) * xFactor);
... | [
"public",
"static",
"Geometry",
"scale",
"(",
"Geometry",
"geom",
",",
"double",
"xFactor",
",",
"double",
"yFactor",
",",
"double",
"zFactor",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"Geometry",
"scaledGeom",
"=",
"geom",
".",
"copy",
"(",
... | Scales the given geometry by multiplying the coordinates by the
indicated x, y and z scale factors.
@param geom Geometry
@param xFactor x scale factor
@param yFactor y scale factor
@param zFactor z scale factor
@return The geometry scaled by the given x, y and z scale factors | [
"Scales",
"the",
"given",
"geometry",
"by",
"multiplying",
"the",
"coordinates",
"by",
"the",
"indicated",
"x",
"y",
"and",
"z",
"scale",
"factors",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/affine_transformations/ST_Scale.java#L68-L80 |
107,687 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.lineIntersector | public static Geometry lineIntersector(Geometry inputLines, Geometry clipper) throws IllegalArgumentException {
if(inputLines == null||clipper == null){
return null;
}
if(inputLines.getDimension()==1){
MCIndexNoder mCIndexNoder = new MCIndexNoder();
mCIndexNoder.setSe... | java | public static Geometry lineIntersector(Geometry inputLines, Geometry clipper) throws IllegalArgumentException {
if(inputLines == null||clipper == null){
return null;
}
if(inputLines.getDimension()==1){
MCIndexNoder mCIndexNoder = new MCIndexNoder();
mCIndexNoder.setSe... | [
"public",
"static",
"Geometry",
"lineIntersector",
"(",
"Geometry",
"inputLines",
",",
"Geometry",
"clipper",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"inputLines",
"==",
"null",
"||",
"clipper",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | Split a lineal geometry by a another geometry
@param inputLines
@param clipper
@return | [
"Split",
"a",
"lineal",
"geometry",
"by",
"a",
"another",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L64-L92 |
107,688 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.addGeometryToSegments | public static void addGeometryToSegments(Geometry geometry, int flag, ArrayList<SegmentString> segments) {
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry component = geometry.getGeometryN(i);
if (component instanceof Polygon) {
add((Polygon) component, f... | java | public static void addGeometryToSegments(Geometry geometry, int flag, ArrayList<SegmentString> segments) {
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry component = geometry.getGeometryN(i);
if (component instanceof Polygon) {
add((Polygon) component, f... | [
"public",
"static",
"void",
"addGeometryToSegments",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"geometry",
".",
"getNumGeometries",
"... | Convert the a geometry as a list of segments and mark it with a flag
@param geometry
@param flag
@param segments | [
"Convert",
"the",
"a",
"geometry",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L114-L123 |
107,689 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.add | private static void add(Polygon poly, int flag, ArrayList<SegmentString> segments) {
add(poly.getExteriorRing(), flag, segments);
for (int j = 0; j < poly.getNumInteriorRing(); j++) {
add(poly.getInteriorRingN(j), flag, segments);
}
} | java | private static void add(Polygon poly, int flag, ArrayList<SegmentString> segments) {
add(poly.getExteriorRing(), flag, segments);
for (int j = 0; j < poly.getNumInteriorRing(); j++) {
add(poly.getInteriorRingN(j), flag, segments);
}
} | [
"private",
"static",
"void",
"add",
"(",
"Polygon",
"poly",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"add",
"(",
"poly",
".",
"getExteriorRing",
"(",
")",
",",
"flag",
",",
"segments",
")",
";",
"for",
"(",... | Convert a polygon as a list of segments and mark it with a flag
@param poly
@param flag
@param segments | [
"Convert",
"a",
"polygon",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L131-L136 |
107,690 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.add | private static void add(LineString line, int flag, ArrayList<SegmentString> segments) {
SegmentString ss = new NodedSegmentString(line.getCoordinates(),
flag);
segments.add(ss);
} | java | private static void add(LineString line, int flag, ArrayList<SegmentString> segments) {
SegmentString ss = new NodedSegmentString(line.getCoordinates(),
flag);
segments.add(ss);
} | [
"private",
"static",
"void",
"add",
"(",
"LineString",
"line",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"SegmentString",
"ss",
"=",
"new",
"NodedSegmentString",
"(",
"line",
".",
"getCoordinates",
"(",
")",
",",
... | Convert a linestring as a list of segments and mark it with a flag
@param line
@param flag
@param segments | [
"Convert",
"a",
"linestring",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L144-L148 |
107,691 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LocateAlong.java | ST_LocateAlong.locateAlong | public static MultiPoint locateAlong(Geometry geom,
double segmentLengthFraction,
double offsetDistance) {
if (geom == null) {
return null;
}
if (geom.getDimension() == 0) {
return null;
... | java | public static MultiPoint locateAlong(Geometry geom,
double segmentLengthFraction,
double offsetDistance) {
if (geom == null) {
return null;
}
if (geom.getDimension() == 0) {
return null;
... | [
"public",
"static",
"MultiPoint",
"locateAlong",
"(",
"Geometry",
"geom",
",",
"double",
"segmentLengthFraction",
",",
"double",
"offsetDistance",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geom",
".",
"get... | Returns a MULTIPOINT containing points along the line segments of the
given geometry matching the specified segment length fraction and offset
distance.
@param geom Geometry
@param segmentLengthFraction Segment length fraction
@param offsetDistance Offset distance
@return A MULTIPOINT containing points along the line ... | [
"Returns",
"a",
"MULTIPOINT",
"containing",
"points",
"along",
"the",
"line",
"segments",
"of",
"the",
"given",
"geometry",
"matching",
"the",
"specified",
"segment",
"length",
"fraction",
"and",
"offset",
"distance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LocateAlong.java#L67-L90 |
107,692 | orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java | NetworkFunctions.load | public static void load(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
try {
H2GISFunctions.registerFunction(st, function, "");
} catch (SQLException ex) {
... | java | public static void load(Connection connection) throws SQLException {
Statement st = connection.createStatement();
for (Function function : getBuiltInsFunctions()) {
try {
H2GISFunctions.registerFunction(st, function, "");
} catch (SQLException ex) {
... | [
"public",
"static",
"void",
"load",
"(",
"Connection",
"connection",
")",
"throws",
"SQLException",
"{",
"Statement",
"st",
"=",
"connection",
".",
"createStatement",
"(",
")",
";",
"for",
"(",
"Function",
"function",
":",
"getBuiltInsFunctions",
"(",
")",
")"... | Init H2 DataBase with the network functions
@param connection Active connection
@throws SQLException | [
"Init",
"H2",
"DataBase",
"with",
"the",
"network",
"functions"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java#L63-L73 |
107,693 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java | ShapefileReader.close | public void close() throws IOException {
if (channel != null && channel.isOpen()) {
channel.close();
}
channel = null;
header = null;
} | java | public void close() throws IOException {
if (channel != null && channel.isOpen()) {
channel.close();
}
channel = null;
header = null;
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"!=",
"null",
"&&",
"channel",
".",
"isOpen",
"(",
")",
")",
"{",
"channel",
".",
"close",
"(",
")",
";",
"}",
"channel",
"=",
"null",
";",
"header",
"=",
"nul... | Clean up any resources. Closes the channel.
@throws java.io.IOException
If errors occur while closing the channel. | [
"Clean",
"up",
"any",
"resources",
".",
"Closes",
"the",
"channel",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java#L127-L133 |
107,694 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java | ShapefileReader.geomAt | public Geometry geomAt(int offset) throws IOException {
// need to update position
buffer.position(offset);
// record header
buffer.skip(8);
// shape record is all little endian
buffer.order(ByteOrder.LITTLE_ENDIAN);
... | java | public Geometry geomAt(int offset) throws IOException {
// need to update position
buffer.position(offset);
// record header
buffer.skip(8);
// shape record is all little endian
buffer.order(ByteOrder.LITTLE_ENDIAN);
... | [
"public",
"Geometry",
"geomAt",
"(",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"// need to update position",
"buffer",
".",
"position",
"(",
"offset",
")",
";",
"// record header",
"buffer",
".",
"skip",
"(",
"8",
")",
";",
"// shape record is all little... | Fetch the next record information.
@param offset
@throws java.io.IOException
@return The record instance associated with this reader. | [
"Fetch",
"the",
"next",
"record",
"information",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java#L142-L164 |
107,695 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java | ST_3DPerimeter.st3Dperimeter | public static Double st3Dperimeter(Geometry geometry){
if(geometry==null){
return null;
}
if(geometry.getDimension()<2){
return 0d;
}
return compute3DPerimeter(geometry);
} | java | public static Double st3Dperimeter(Geometry geometry){
if(geometry==null){
return null;
}
if(geometry.getDimension()<2){
return 0d;
}
return compute3DPerimeter(geometry);
} | [
"public",
"static",
"Double",
"st3Dperimeter",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geometry",
".",
"getDimension",
"(",
")",
"<",
"2",
")",
"{",
"return",
"0d",
... | Compute the 3D perimeter of a polygon or a multipolygon.
@param geometry
@return | [
"Compute",
"the",
"3D",
"perimeter",
"of",
"a",
"polygon",
"or",
"a",
"multipolygon",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java#L51-L59 |
107,696 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java | ST_3DPerimeter.compute3DPerimeter | private static double compute3DPerimeter(Geometry geometry) {
double sum = 0;
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
if (subGeom instanceof Polygon) {
sum += ST_3DLength.length3D(((Polygon) subGeom).get... | java | private static double compute3DPerimeter(Geometry geometry) {
double sum = 0;
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry subGeom = geometry.getGeometryN(i);
if (subGeom instanceof Polygon) {
sum += ST_3DLength.length3D(((Polygon) subGeom).get... | [
"private",
"static",
"double",
"compute3DPerimeter",
"(",
"Geometry",
"geometry",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"geometry",
".",
"getNumGeometries",
"(",
")",
";",
"i",
"++",
")",
"{",
"Geo... | Compute the 3D perimeter
@param geometry
@return | [
"Compute",
"the",
"3D",
"perimeter"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java#L66-L75 |
107,697 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/DimensionFromConstraint.java | DimensionFromConstraint.dimensionFromConstraint | public static int dimensionFromConstraint(String constraint, String columnName) {
Matcher matcher = Z_CONSTRAINT_PATTERN.matcher(constraint);
if(matcher.find()) {
String extractedColumnName = matcher.group(1).replace("\"","").replace("`", "");
if(extractedColumnName.equalsIgnoreC... | java | public static int dimensionFromConstraint(String constraint, String columnName) {
Matcher matcher = Z_CONSTRAINT_PATTERN.matcher(constraint);
if(matcher.find()) {
String extractedColumnName = matcher.group(1).replace("\"","").replace("`", "");
if(extractedColumnName.equalsIgnoreC... | [
"public",
"static",
"int",
"dimensionFromConstraint",
"(",
"String",
"constraint",
",",
"String",
"columnName",
")",
"{",
"Matcher",
"matcher",
"=",
"Z_CONSTRAINT_PATTERN",
".",
"matcher",
"(",
"constraint",
")",
";",
"if",
"(",
"matcher",
".",
"find",
"(",
")... | Public for Unit test
@param constraint Constraint value ex: ST_COORDIM(the_geom) = 3
@param columnName Column name ex:the_geom
@return The dimension constraint [2-3] | [
"Public",
"for",
"Unit",
"test"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/DimensionFromConstraint.java#L59-L79 |
107,698 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java | ST_3DLength.length3D | public static double length3D(Geometry geom) {
double sum = 0;
for (int i = 0; i < geom.getNumGeometries(); i++) {
sum += length3D((LineString) geom.getGeometryN(i));
}
return sum;
} | java | public static double length3D(Geometry geom) {
double sum = 0;
for (int i = 0; i < geom.getNumGeometries(); i++) {
sum += length3D((LineString) geom.getGeometryN(i));
}
return sum;
} | [
"public",
"static",
"double",
"length3D",
"(",
"Geometry",
"geom",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"geom",
".",
"getNumGeometries",
"(",
")",
";",
"i",
"++",
")",
"{",
"sum",
"+=",
"lengt... | Returns the 3D length of the given geometry.
@param geom Geometry
@return The 3D length of the given geometry | [
"Returns",
"the",
"3D",
"length",
"of",
"the",
"given",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java#L67-L74 |
107,699 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java | ST_3DLength.length3D | public static double length3D(Polygon polygon) {
double length = 0.0;
length += length3D(polygon.getExteriorRing().getCoordinateSequence());
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
length += length3D(polygon.getInteriorRingN(i));
}
return length;
... | java | public static double length3D(Polygon polygon) {
double length = 0.0;
length += length3D(polygon.getExteriorRing().getCoordinateSequence());
for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
length += length3D(polygon.getInteriorRingN(i));
}
return length;
... | [
"public",
"static",
"double",
"length3D",
"(",
"Polygon",
"polygon",
")",
"{",
"double",
"length",
"=",
"0.0",
";",
"length",
"+=",
"length3D",
"(",
"polygon",
".",
"getExteriorRing",
"(",
")",
".",
"getCoordinateSequence",
"(",
")",
")",
";",
"for",
"(",
... | Returns the 3D perimeter of the given polygon.
@param polygon Polygon
@return The 3D perimeter of the given polygon | [
"Returns",
"the",
"3D",
"perimeter",
"of",
"the",
"given",
"polygon",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DLength.java#L82-L89 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.