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,500 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java | MakeValidOp.getSegments | private Set<LineString> getSegments(Collection<LineString> lines) {
Set<LineString> set = new HashSet<>();
for (LineString line : lines) {
Coordinate[] cc = line.getCoordinates();
for (int i = 1; i < cc.length; i++) {
if (!cc[i - 1].equals(cc[i])) {
... | java | private Set<LineString> getSegments(Collection<LineString> lines) {
Set<LineString> set = new HashSet<>();
for (LineString line : lines) {
Coordinate[] cc = line.getCoordinates();
for (int i = 1; i < cc.length; i++) {
if (!cc[i - 1].equals(cc[i])) {
... | [
"private",
"Set",
"<",
"LineString",
">",
"getSegments",
"(",
"Collection",
"<",
"LineString",
">",
"lines",
")",
"{",
"Set",
"<",
"LineString",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"LineString",
"line",
":",
"lines",
")"... | Return a set of segments from a linestring
@param lines
@return | [
"Return",
"a",
"set",
"of",
"segments",
"from",
"a",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java#L551-L564 |
107,501 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java | MakeValidOp.restoreDim4 | private Collection<Geometry> restoreDim4(Collection<Geometry> geoms, Map<Coordinate, Double> map) {
GeometryFactory factory = new GeometryFactory(
new PackedCoordinateSequenceFactory(PackedCoordinateSequenceFactory.DOUBLE, 4));
Collection<Geometry> result = new ArrayList<>();
for... | java | private Collection<Geometry> restoreDim4(Collection<Geometry> geoms, Map<Coordinate, Double> map) {
GeometryFactory factory = new GeometryFactory(
new PackedCoordinateSequenceFactory(PackedCoordinateSequenceFactory.DOUBLE, 4));
Collection<Geometry> result = new ArrayList<>();
for... | [
"private",
"Collection",
"<",
"Geometry",
">",
"restoreDim4",
"(",
"Collection",
"<",
"Geometry",
">",
"geoms",
",",
"Map",
"<",
"Coordinate",
",",
"Double",
">",
"map",
")",
"{",
"GeometryFactory",
"factory",
"=",
"new",
"GeometryFactory",
"(",
"new",
"Pack... | Use ring to restore M values on geoms | [
"Use",
"ring",
"to",
"restore",
"M",
"values",
"on",
"geoms"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java#L567-L594 |
107,502 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java | MakeValidOp.restoreDim4 | private CoordinateSequence restoreDim4(CoordinateSequence cs, Map<Coordinate, Double> map) {
CoordinateSequence seq = new PackedCoordinateSequenceFactory(DOUBLE, 4).create(cs.size(), 4);
for (int i = 0; i < cs.size(); i++) {
seq.setOrdinate(i, 0, cs.getOrdinate(i, 0));
seq.setOrd... | java | private CoordinateSequence restoreDim4(CoordinateSequence cs, Map<Coordinate, Double> map) {
CoordinateSequence seq = new PackedCoordinateSequenceFactory(DOUBLE, 4).create(cs.size(), 4);
for (int i = 0; i < cs.size(); i++) {
seq.setOrdinate(i, 0, cs.getOrdinate(i, 0));
seq.setOrd... | [
"private",
"CoordinateSequence",
"restoreDim4",
"(",
"CoordinateSequence",
"cs",
",",
"Map",
"<",
"Coordinate",
",",
"Double",
">",
"map",
")",
"{",
"CoordinateSequence",
"seq",
"=",
"new",
"PackedCoordinateSequenceFactory",
"(",
"DOUBLE",
",",
"4",
")",
".",
"c... | Use map to restore M values on the coordinate array | [
"Use",
"map",
"to",
"restore",
"M",
"values",
"on",
"the",
"coordinate",
"array"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java#L624-L634 |
107,503 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java | GPXTablesFactory.createTrackTable | public static PreparedStatement createTrackTable(Connection connection, String trackTableName,boolean isH2) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(trackTableName).append(" (");
... | java | public static PreparedStatement createTrackTable(Connection connection, String trackTableName,boolean isH2) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(trackTableName).append(" (");
... | [
"public",
"static",
"PreparedStatement",
"createTrackTable",
"(",
"Connection",
"connection",
",",
"String",
"trackTableName",
",",
"boolean",
"isH2",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createStatement",
"("... | Creat the track table
@param connection
@param trackTableName
@param isH2 set true if it's an H2 database
@return
@throws SQLException | [
"Creat",
"the",
"track",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java#L204-L233 |
107,504 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java | GPXTablesFactory.createTrackSegmentsTable | public static PreparedStatement createTrackSegmentsTable(Connection connection, String trackSegementsTableName,boolean isH2) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(trackSegementsTableNam... | java | public static PreparedStatement createTrackSegmentsTable(Connection connection, String trackSegementsTableName,boolean isH2) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(trackSegementsTableNam... | [
"public",
"static",
"PreparedStatement",
"createTrackSegmentsTable",
"(",
"Connection",
"connection",
",",
"String",
"trackSegementsTableName",
",",
"boolean",
"isH2",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"create... | Create the track segments table to store the segments of a track
@param connection
@param trackSegementsTableName
@param isH2 set true if it's an H2 database
@return
@throws SQLException | [
"Create",
"the",
"track",
"segments",
"table",
"to",
"store",
"the",
"segments",
"of",
"a",
"track"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java#L244-L266 |
107,505 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java | GPXTablesFactory.dropOSMTables | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String gpxTableName = requestedTable.getTable();
String[] gpxTables = new String[]{WAYPOINT,ROUTE,ROUTEPO... | java | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String gpxTableName = requestedTable.getTable();
String[] gpxTables = new String[]{WAYPOINT,ROUTE,ROUTEPO... | [
"public",
"static",
"void",
"dropOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"String",
"tablePrefix",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"requestedTable",
"=",
"TableLocation",
".",
"parse",
"(",
"tablePrefix",
",",
... | Drop the existing GPX tables used to store the imported OSM GPX
@param connection
@param isH2
@param tablePrefix
@throws SQLException | [
"Drop",
"the",
"existing",
"GPX",
"tables",
"used",
"to",
"store",
"the",
"imported",
"OSM",
"GPX"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java#L331-L347 |
107,506 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java | AltitudeMode.append | public static void append(int altitudeMode, StringBuilder sb) {
switch (altitudeMode) {
case KML_CLAMPTOGROUND:
sb.append("<kml:altitudeMode>clampToGround</kml:altitudeMode>");
return;
case KML_RELATIVETOGROUND:
sb.append("<kml:altitudeMode... | java | public static void append(int altitudeMode, StringBuilder sb) {
switch (altitudeMode) {
case KML_CLAMPTOGROUND:
sb.append("<kml:altitudeMode>clampToGround</kml:altitudeMode>");
return;
case KML_RELATIVETOGROUND:
sb.append("<kml:altitudeMode... | [
"public",
"static",
"void",
"append",
"(",
"int",
"altitudeMode",
",",
"StringBuilder",
"sb",
")",
"{",
"switch",
"(",
"altitudeMode",
")",
"{",
"case",
"KML_CLAMPTOGROUND",
":",
"sb",
".",
"append",
"(",
"\"<kml:altitudeMode>clampToGround</kml:altitudeMode>\"",
")"... | Generate a string value corresponding to the altitude mode.
@param altitudeMode
@param sb | [
"Generate",
"a",
"string",
"value",
"corresponding",
"to",
"the",
"altitude",
"mode",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java#L73-L98 |
107,507 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extrudePolygonAsGeometry | public static GeometryCollection extrudePolygonAsGeometry(Polygon polygon, double height){
GeometryFactory factory = polygon.getFactory();
Geometry[] geometries = new Geometry[3];
//Extract floor
//We process the exterior ring
final LineString shell = getClockWise(polygo... | java | public static GeometryCollection extrudePolygonAsGeometry(Polygon polygon, double height){
GeometryFactory factory = polygon.getFactory();
Geometry[] geometries = new Geometry[3];
//Extract floor
//We process the exterior ring
final LineString shell = getClockWise(polygo... | [
"public",
"static",
"GeometryCollection",
"extrudePolygonAsGeometry",
"(",
"Polygon",
"polygon",
",",
"double",
"height",
")",
"{",
"GeometryFactory",
"factory",
"=",
"polygon",
".",
"getFactory",
"(",
")",
";",
"Geometry",
"[",
"]",
"geometries",
"=",
"new",
"G... | Extrude the polygon as a collection of geometries
The output geometryCollection contains the floor, the walls and the roof.
@param polygon
@param height
@return | [
"Extrude",
"the",
"polygon",
"as",
"a",
"collection",
"of",
"geometries",
"The",
"output",
"geometryCollection",
"contains",
"the",
"floor",
"the",
"walls",
"and",
"the",
"roof",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L49-L75 |
107,508 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extrudeLineStringAsGeometry | public static GeometryCollection extrudeLineStringAsGeometry(LineString lineString, double height){
Geometry[] geometries = new Geometry[3];
GeometryFactory factory = lineString.getFactory();
//Extract the walls
Coordinate[] coords = lineString.getCoordinates();
P... | java | public static GeometryCollection extrudeLineStringAsGeometry(LineString lineString, double height){
Geometry[] geometries = new Geometry[3];
GeometryFactory factory = lineString.getFactory();
//Extract the walls
Coordinate[] coords = lineString.getCoordinates();
P... | [
"public",
"static",
"GeometryCollection",
"extrudeLineStringAsGeometry",
"(",
"LineString",
"lineString",
",",
"double",
"height",
")",
"{",
"Geometry",
"[",
"]",
"geometries",
"=",
"new",
"Geometry",
"[",
"3",
"]",
";",
"GeometryFactory",
"factory",
"=",
"lineStr... | Extrude the linestring as a collection of geometries
The output geometryCollection contains the floor, the walls and the roof.
@param lineString
@param height
@return | [
"Extrude",
"the",
"linestring",
"as",
"a",
"collection",
"of",
"geometries",
"The",
"output",
"geometryCollection",
"contains",
"the",
"floor",
"the",
"walls",
"and",
"the",
"roof",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L84-L98 |
107,509 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractRoof | public static Geometry extractRoof(LineString lineString, double height) {
LineString result = (LineString)lineString.copy();
result.apply(new TranslateCoordinateSequenceFilter(height));
return result;
} | java | public static Geometry extractRoof(LineString lineString, double height) {
LineString result = (LineString)lineString.copy();
result.apply(new TranslateCoordinateSequenceFilter(height));
return result;
} | [
"public",
"static",
"Geometry",
"extractRoof",
"(",
"LineString",
"lineString",
",",
"double",
"height",
")",
"{",
"LineString",
"result",
"=",
"(",
"LineString",
")",
"lineString",
".",
"copy",
"(",
")",
";",
"result",
".",
"apply",
"(",
"new",
"TranslateCo... | Extract the linestring "roof".
@param lineString
@param height
@return | [
"Extract",
"the",
"linestring",
"roof",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L107-L111 |
107,510 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractWalls | public static MultiPolygon extractWalls(Polygon polygon, double height){
GeometryFactory factory = polygon.getFactory();
//We process the exterior ring
final LineString shell = getClockWise(polygon.getExteriorRing());
ArrayList<Polygon> walls = new ArrayList<Polygon>();
for (in... | java | public static MultiPolygon extractWalls(Polygon polygon, double height){
GeometryFactory factory = polygon.getFactory();
//We process the exterior ring
final LineString shell = getClockWise(polygon.getExteriorRing());
ArrayList<Polygon> walls = new ArrayList<Polygon>();
for (in... | [
"public",
"static",
"MultiPolygon",
"extractWalls",
"(",
"Polygon",
"polygon",
",",
"double",
"height",
")",
"{",
"GeometryFactory",
"factory",
"=",
"polygon",
".",
"getFactory",
"(",
")",
";",
"//We process the exterior ring ",
"final",
"LineString",
"shell",
"=",
... | Extract the walls from a polygon
@param polygon
@param height
@return | [
"Extract",
"the",
"walls",
"from",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L121-L141 |
107,511 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractRoof | public static Polygon extractRoof(Polygon polygon, double height) {
GeometryFactory factory = polygon.getFactory();
Polygon roofP = (Polygon)polygon.copy();
roofP.apply(new TranslateCoordinateSequenceFilter(height));
final LinearRing shell = factory.createLinearRing(getCounterClockWise(... | java | public static Polygon extractRoof(Polygon polygon, double height) {
GeometryFactory factory = polygon.getFactory();
Polygon roofP = (Polygon)polygon.copy();
roofP.apply(new TranslateCoordinateSequenceFilter(height));
final LinearRing shell = factory.createLinearRing(getCounterClockWise(... | [
"public",
"static",
"Polygon",
"extractRoof",
"(",
"Polygon",
"polygon",
",",
"double",
"height",
")",
"{",
"GeometryFactory",
"factory",
"=",
"polygon",
".",
"getFactory",
"(",
")",
";",
"Polygon",
"roofP",
"=",
"(",
"Polygon",
")",
"polygon",
".",
"copy",
... | Extract the roof of a polygon
@param polygon
@param height
@return | [
"Extract",
"the",
"roof",
"of",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L150-L162 |
107,512 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractWalls | public static MultiPolygon extractWalls(LineString lineString, double height) {
GeometryFactory factory = lineString.getFactory();
//Extract the walls
Coordinate[] coords = lineString.getCoordinates();
Polygon[] walls = new Polygon[coords.length - 1];
for (int i = 0; i < ... | java | public static MultiPolygon extractWalls(LineString lineString, double height) {
GeometryFactory factory = lineString.getFactory();
//Extract the walls
Coordinate[] coords = lineString.getCoordinates();
Polygon[] walls = new Polygon[coords.length - 1];
for (int i = 0; i < ... | [
"public",
"static",
"MultiPolygon",
"extractWalls",
"(",
"LineString",
"lineString",
",",
"double",
"height",
")",
"{",
"GeometryFactory",
"factory",
"=",
"lineString",
".",
"getFactory",
"(",
")",
";",
"//Extract the walls ",
"Coordinate",
"[",
"]",
"coords"... | Extrude the LineString as a set of walls.
@param lineString
@param height
@return | [
"Extrude",
"the",
"LineString",
"as",
"a",
"set",
"of",
"walls",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L170-L179 |
107,513 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.getClockWise | private static LineString getClockWise(final LineString lineString) {
final Coordinate c0 = lineString.getCoordinateN(0);
final Coordinate c1 = lineString.getCoordinateN(1);
final Coordinate c2 = lineString.getCoordinateN(2);
lineString.apply(new UpdateZCoordinateSequenceFilter(0, 3));
... | java | private static LineString getClockWise(final LineString lineString) {
final Coordinate c0 = lineString.getCoordinateN(0);
final Coordinate c1 = lineString.getCoordinateN(1);
final Coordinate c2 = lineString.getCoordinateN(2);
lineString.apply(new UpdateZCoordinateSequenceFilter(0, 3));
... | [
"private",
"static",
"LineString",
"getClockWise",
"(",
"final",
"LineString",
"lineString",
")",
"{",
"final",
"Coordinate",
"c0",
"=",
"lineString",
".",
"getCoordinateN",
"(",
"0",
")",
";",
"final",
"Coordinate",
"c1",
"=",
"lineString",
".",
"getCoordinateN... | Reverse the LineString to be oriented clockwise.
All NaN z values are replaced by a zero value.
@param lineString
@return | [
"Reverse",
"the",
"LineString",
"to",
"be",
"oriented",
"clockwise",
".",
"All",
"NaN",
"z",
"values",
"are",
"replaced",
"by",
"a",
"zero",
"value",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L187-L197 |
107,514 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.getCounterClockWise | private static LineString getCounterClockWise(final LineString lineString) {
final Coordinate c0 = lineString.getCoordinateN(0);
final Coordinate c1 = lineString.getCoordinateN(1);
final Coordinate c2 = lineString.getCoordinateN(2);
lineString.apply(new UpdateZCoordinateSequenceFilter(0,... | java | private static LineString getCounterClockWise(final LineString lineString) {
final Coordinate c0 = lineString.getCoordinateN(0);
final Coordinate c1 = lineString.getCoordinateN(1);
final Coordinate c2 = lineString.getCoordinateN(2);
lineString.apply(new UpdateZCoordinateSequenceFilter(0,... | [
"private",
"static",
"LineString",
"getCounterClockWise",
"(",
"final",
"LineString",
"lineString",
")",
"{",
"final",
"Coordinate",
"c0",
"=",
"lineString",
".",
"getCoordinateN",
"(",
"0",
")",
";",
"final",
"Coordinate",
"c1",
"=",
"lineString",
".",
"getCoor... | Reverse the LineString to be oriented counter-clockwise.
@param lineString
@return | [
"Reverse",
"the",
"LineString",
"to",
"be",
"oriented",
"counter",
"-",
"clockwise",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L204-L214 |
107,515 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractFloor | private static Polygon extractFloor(final Polygon polygon) {
GeometryFactory factory = polygon.getFactory();
final LinearRing shell = factory.createLinearRing(getClockWise(
polygon.getExteriorRing()).getCoordinates());
final int nbOfHoles = polygon.getNumInteriorRing();
f... | java | private static Polygon extractFloor(final Polygon polygon) {
GeometryFactory factory = polygon.getFactory();
final LinearRing shell = factory.createLinearRing(getClockWise(
polygon.getExteriorRing()).getCoordinates());
final int nbOfHoles = polygon.getNumInteriorRing();
f... | [
"private",
"static",
"Polygon",
"extractFloor",
"(",
"final",
"Polygon",
"polygon",
")",
"{",
"GeometryFactory",
"factory",
"=",
"polygon",
".",
"getFactory",
"(",
")",
";",
"final",
"LinearRing",
"shell",
"=",
"factory",
".",
"createLinearRing",
"(",
"getClockW... | Reverse the polygon to be oriented clockwise
@param polygon
@return | [
"Reverse",
"the",
"polygon",
"to",
"be",
"oriented",
"clockwise"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L221-L232 |
107,516 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extrudeEdge | private static Polygon extrudeEdge(final Coordinate beginPoint,
Coordinate endPoint, final double height, GeometryFactory factory) {
beginPoint.z = Double.isNaN(beginPoint.z) ? 0 : beginPoint.z;
endPoint.z = Double.isNaN(endPoint.z) ? 0 : endPoint.z;
return factory.createPoly... | java | private static Polygon extrudeEdge(final Coordinate beginPoint,
Coordinate endPoint, final double height, GeometryFactory factory) {
beginPoint.z = Double.isNaN(beginPoint.z) ? 0 : beginPoint.z;
endPoint.z = Double.isNaN(endPoint.z) ? 0 : endPoint.z;
return factory.createPoly... | [
"private",
"static",
"Polygon",
"extrudeEdge",
"(",
"final",
"Coordinate",
"beginPoint",
",",
"Coordinate",
"endPoint",
",",
"final",
"double",
"height",
",",
"GeometryFactory",
"factory",
")",
"{",
"beginPoint",
".",
"z",
"=",
"Double",
".",
"isNaN",
"(",
"be... | Create a polygon corresponding to the wall.
@param beginPoint
@param endPoint
@param height
@return | [
"Create",
"a",
"polygon",
"corresponding",
"to",
"the",
"wall",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L243-L253 |
107,517 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ColumnSRID.java | ColumnSRID.fetchConstraint | public static String fetchConstraint(Connection connection, String catalogName, String schemaName, String tableName) throws SQLException {
// Merge column constraint and table constraint
PreparedStatement pst = SFSUtilities.prepareInformationSchemaStatement(connection, catalogName, schemaName,
... | java | public static String fetchConstraint(Connection connection, String catalogName, String schemaName, String tableName) throws SQLException {
// Merge column constraint and table constraint
PreparedStatement pst = SFSUtilities.prepareInformationSchemaStatement(connection, catalogName, schemaName,
... | [
"public",
"static",
"String",
"fetchConstraint",
"(",
"Connection",
"connection",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"// Merge column constraint and table constraint",
"PreparedStatement... | Read table constraints from database metadata.
@param connection Active connection
@param catalogName Catalog name or empty string
@param schemaName Schema name or empty string
@param tableName table name
@return Found table constraints
@throws SQLException | [
"Read",
"table",
"constraints",
"from",
"database",
"metadata",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ColumnSRID.java#L82-L98 |
107,518 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUrlParser.java | JDBCUrlParser.parse | public static Properties parse(String jdbcUrl) throws IllegalArgumentException {
if(!jdbcUrl.startsWith(URL_STARTS)) {
throw new IllegalArgumentException("JDBC Url must start with "+URL_STARTS);
}
String driverAndURI = jdbcUrl.substring(URL_STARTS.length());
Properties pr... | java | public static Properties parse(String jdbcUrl) throws IllegalArgumentException {
if(!jdbcUrl.startsWith(URL_STARTS)) {
throw new IllegalArgumentException("JDBC Url must start with "+URL_STARTS);
}
String driverAndURI = jdbcUrl.substring(URL_STARTS.length());
Properties pr... | [
"public",
"static",
"Properties",
"parse",
"(",
"String",
"jdbcUrl",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"jdbcUrl",
".",
"startsWith",
"(",
"URL_STARTS",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"JDBC Url must s... | Convert JDBC URL into JDBC Connection properties
@param jdbcUrl JDBC connection path
@return Properties to be used in OSGi DataSourceFactory that does not handle {@link DataSourceFactory#JDBC_URL}
@throws IllegalArgumentException Argument is not a valid JDBC connection URL or cannot be parsed by this class | [
"Convert",
"JDBC",
"URL",
"into",
"JDBC",
"Connection",
"properties"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUrlParser.java#L48-L91 |
107,519 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java | ST_ZUpdateLineExtremities.updateZExtremities | public static Geometry updateZExtremities(Geometry geometry, double startZ, double endZ, boolean interpolate) {
if(geometry == null){
return null;
}
if (geometry instanceof LineString) {
return force3DStartEnd((LineString) geometry, startZ, endZ, interpolate);
} e... | java | public static Geometry updateZExtremities(Geometry geometry, double startZ, double endZ, boolean interpolate) {
if(geometry == null){
return null;
}
if (geometry instanceof LineString) {
return force3DStartEnd((LineString) geometry, startZ, endZ, interpolate);
} e... | [
"public",
"static",
"Geometry",
"updateZExtremities",
"(",
"Geometry",
"geometry",
",",
"double",
"startZ",
",",
"double",
"endZ",
",",
"boolean",
"interpolate",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"("... | Update the start and end Z values. If the interpolate is true the
vertices are interpolated according the start and end z values.
@param geometry
@param startZ
@param endZ
@param interpolate
@return | [
"Update",
"the",
"start",
"and",
"end",
"Z",
"values",
".",
"If",
"the",
"interpolate",
"is",
"true",
"the",
"vertices",
"are",
"interpolated",
"according",
"the",
"start",
"and",
"end",
"z",
"values",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java#L60-L77 |
107,520 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java | ST_ZUpdateLineExtremities.force3DStartEnd | private static Geometry force3DStartEnd(LineString lineString, final double startZ,
final double endZ, final boolean interpolate) {
final double bigD = lineString.getLength();
final double z = endZ - startZ;
final Coordinate coordEnd = lineString.getCoordinates()[lineString.getCoordi... | java | private static Geometry force3DStartEnd(LineString lineString, final double startZ,
final double endZ, final boolean interpolate) {
final double bigD = lineString.getLength();
final double z = endZ - startZ;
final Coordinate coordEnd = lineString.getCoordinates()[lineString.getCoordi... | [
"private",
"static",
"Geometry",
"force3DStartEnd",
"(",
"LineString",
"lineString",
",",
"final",
"double",
"startZ",
",",
"final",
"double",
"endZ",
",",
"final",
"boolean",
"interpolate",
")",
"{",
"final",
"double",
"bigD",
"=",
"lineString",
".",
"getLength... | Updates all z values by a new value using the specified first and the
last coordinates.
@param geom
@param startZ
@param endZ
@param interpolate is true the z value of the vertices are interpolate
according the length of the line.
@return | [
"Updates",
"all",
"z",
"values",
"by",
"a",
"new",
"value",
"using",
"the",
"specified",
"first",
"and",
"the",
"last",
"coordinates",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java#L90-L135 |
107,521 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/StringStack.java | StringStack.push | public boolean push(String newText) {
if (stackTop < stack.length - 1) {
stack[stackTop++] = newText;
return true;
} else {
return false;
}
} | java | public boolean push(String newText) {
if (stackTop < stack.length - 1) {
stack[stackTop++] = newText;
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"push",
"(",
"String",
"newText",
")",
"{",
"if",
"(",
"stackTop",
"<",
"stack",
".",
"length",
"-",
"1",
")",
"{",
"stack",
"[",
"stackTop",
"++",
"]",
"=",
"newText",
";",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"f... | Puts string in the stack.
@param newText A new string to put in the stack
@return false if the stack is full | [
"Puts",
"string",
"in",
"the",
"stack",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/StringStack.java#L49-L56 |
107,522 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java | ReadBufferManager.getWindowOffset | private int getWindowOffset(long bytePos, int length) throws IOException {
long desiredMax = bytePos + length - 1;
if ((bytePos >= windowStart)
&& (desiredMax < windowStart + buffer.capacity())) {
long res = bytePos - windowStart;
... | java | private int getWindowOffset(long bytePos, int length) throws IOException {
long desiredMax = bytePos + length - 1;
if ((bytePos >= windowStart)
&& (desiredMax < windowStart + buffer.capacity())) {
long res = bytePos - windowStart;
... | [
"private",
"int",
"getWindowOffset",
"(",
"long",
"bytePos",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"long",
"desiredMax",
"=",
"bytePos",
"+",
"length",
"-",
"1",
";",
"if",
"(",
"(",
"bytePos",
">=",
"windowStart",
")",
"&&",
"(",
"des... | Moves the window if necessary to contain the desired byte and returns the
position of the byte in the window
@param bytePos
@throws java.io.IOException | [
"Moves",
"the",
"window",
"if",
"necessary",
"to",
"contain",
"the",
"desired",
"byte",
"and",
"returns",
"the",
"position",
"of",
"the",
"byte",
"in",
"the",
"window"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java#L70-L102 |
107,523 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getJulianCycle | private static long getJulianCycle(double J, double lw) {
return Math.round(J - J2000 - J0 - lw / (2 * Math.PI));
} | java | private static long getJulianCycle(double J, double lw) {
return Math.round(J - J2000 - J0 - lw / (2 * Math.PI));
} | [
"private",
"static",
"long",
"getJulianCycle",
"(",
"double",
"J",
",",
"double",
"lw",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"J",
"-",
"J2000",
"-",
"J0",
"-",
"lw",
"/",
"(",
"2",
"*",
"Math",
".",
"PI",
")",
")",
";",
"}"
] | general sun calculations | [
"general",
"sun",
"calculations"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L72-L74 |
107,524 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getApproxTransit | private static double getApproxTransit(double Ht, double lw, double n) {
return J2000 + J0 + (Ht + lw) / (2 * Math.PI) + n;
} | java | private static double getApproxTransit(double Ht, double lw, double n) {
return J2000 + J0 + (Ht + lw) / (2 * Math.PI) + n;
} | [
"private",
"static",
"double",
"getApproxTransit",
"(",
"double",
"Ht",
",",
"double",
"lw",
",",
"double",
"n",
")",
"{",
"return",
"J2000",
"+",
"J0",
"+",
"(",
"Ht",
"+",
"lw",
")",
"/",
"(",
"2",
"*",
"Math",
".",
"PI",
")",
"+",
"n",
";",
... | calculations for sun times | [
"calculations",
"for",
"sun",
"times"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L93-L95 |
107,525 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getRightAscension | private static double getRightAscension(double Ls) {
return Math.atan2(Math.sin(Ls) * Math.cos(e), Math.cos(Ls));
} | java | private static double getRightAscension(double Ls) {
return Math.atan2(Math.sin(Ls) * Math.cos(e), Math.cos(Ls));
} | [
"private",
"static",
"double",
"getRightAscension",
"(",
"double",
"Ls",
")",
"{",
"return",
"Math",
".",
"atan2",
"(",
"Math",
".",
"sin",
"(",
"Ls",
")",
"*",
"Math",
".",
"cos",
"(",
"e",
")",
",",
"Math",
".",
"cos",
"(",
"Ls",
")",
")",
";",... | calculations for sun position | [
"calculations",
"for",
"sun",
"position"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L107-L109 |
107,526 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getPosition | public static Coordinate getPosition(Date date, double lat,
double lng) {
if (isGeographic(lat, lng)) {
double lw = rad * -lng;
double phi = rad * lat;
double J = dateToJulianDate(date);
double M = getSolarMeanAnomaly(J);
double C = getEqua... | java | public static Coordinate getPosition(Date date, double lat,
double lng) {
if (isGeographic(lat, lng)) {
double lw = rad * -lng;
double phi = rad * lat;
double J = dateToJulianDate(date);
double M = getSolarMeanAnomaly(J);
double C = getEqua... | [
"public",
"static",
"Coordinate",
"getPosition",
"(",
"Date",
"date",
",",
"double",
"lat",
",",
"double",
"lng",
")",
"{",
"if",
"(",
"isGeographic",
"(",
"lat",
",",
"lng",
")",
")",
"{",
"double",
"lw",
"=",
"rad",
"*",
"-",
"lng",
";",
"double",
... | Returns the sun position as a coordinate with the following properties
x: sun azimuth in radians (direction along the horizon, measured from south to
west), e.g. 0 is south and Math.PI * 3/4 is northwest.
y: sun altitude above the horizon in radians, e.g. 0 at the
horizon and PI/2 at the zenith (straight over your hea... | [
"Returns",
"the",
"sun",
"position",
"as",
"a",
"coordinate",
"with",
"the",
"following",
"properties"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L155-L172 |
107,527 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java | IndexFile.getContentLength | public int getContentLength(int index) throws IOException {
int ret = -1;
if (this.lastIndex != index) {
this.readRecord(index);
}
ret = this.recLen;
return ret;
} | java | public int getContentLength(int index) throws IOException {
int ret = -1;
if (this.lastIndex != index) {
this.readRecord(index);
}
ret = this.recLen;
return ret;
} | [
"public",
"int",
"getContentLength",
"(",
"int",
"index",
")",
"throws",
"IOException",
"{",
"int",
"ret",
"=",
"-",
"1",
";",
"if",
"(",
"this",
".",
"lastIndex",
"!=",
"index",
")",
"{",
"this",
".",
"readRecord",
"(",
"index",
")",
";",
"}",
"ret"... | Get the content length of the given record in bytes, not 16 bit words.
@param index
The index, from 0 to getRecordCount - 1
@return The lengh in bytes of the record.
@throws java.io.IOException | [
"Get",
"the",
"content",
"length",
"of",
"the",
"given",
"record",
"in",
"bytes",
"not",
"16",
"bit",
"words",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java#L152-L162 |
107,528 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse.java | ST_Reverse.reverse | public static Geometry reverse(Geometry geometry) {
if (geometry == null) {
return null;
}
if (geometry instanceof MultiPoint) {
return reverseMultiPoint((MultiPoint) geometry);
}
return geometry.reverse();
} | java | public static Geometry reverse(Geometry geometry) {
if (geometry == null) {
return null;
}
if (geometry instanceof MultiPoint) {
return reverseMultiPoint((MultiPoint) geometry);
}
return geometry.reverse();
} | [
"public",
"static",
"Geometry",
"reverse",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geometry",
"instanceof",
"MultiPoint",
")",
"{",
"return",
"reverseMultiPoint",
"(",
"(... | Returns the geometry with vertex order reversed.
@param geometry Geometry
@return geometry with vertex order reversed | [
"Returns",
"the",
"geometry",
"with",
"vertex",
"order",
"reversed",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse.java#L51-L59 |
107,529 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse.java | ST_Reverse.reverseMultiPoint | public static Geometry reverseMultiPoint(MultiPoint mp) {
int nPoints = mp.getNumGeometries();
Point[] revPoints = new Point[nPoints];
for (int i = 0; i < nPoints; i++) {
revPoints[nPoints - 1 - i] = (Point) mp.getGeometryN(i).reverse();
}
return mp.getFactory().creat... | java | public static Geometry reverseMultiPoint(MultiPoint mp) {
int nPoints = mp.getNumGeometries();
Point[] revPoints = new Point[nPoints];
for (int i = 0; i < nPoints; i++) {
revPoints[nPoints - 1 - i] = (Point) mp.getGeometryN(i).reverse();
}
return mp.getFactory().creat... | [
"public",
"static",
"Geometry",
"reverseMultiPoint",
"(",
"MultiPoint",
"mp",
")",
"{",
"int",
"nPoints",
"=",
"mp",
".",
"getNumGeometries",
"(",
")",
";",
"Point",
"[",
"]",
"revPoints",
"=",
"new",
"Point",
"[",
"nPoints",
"]",
";",
"for",
"(",
"int",... | Returns the MultiPoint with vertex order reversed. We do our own
implementation here because JTS does not handle it.
@param mp MultiPoint
@return MultiPoint with vertex order reversed | [
"Returns",
"the",
"MultiPoint",
"with",
"vertex",
"order",
"reversed",
".",
"We",
"do",
"our",
"own",
"implementation",
"here",
"because",
"JTS",
"does",
"not",
"handle",
"it",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse.java#L68-L75 |
107,530 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java | ST_MakeEnvelope.makeEnvelope | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax) {
Coordinate[] coordinates = new Coordinate[]{
new Coordinate(xmin, ymin),
new Coordinate(xmax, ymin),
new Coordinate(xmax, ymax),
new Coordinate(xmin, ymax),
new Co... | java | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax) {
Coordinate[] coordinates = new Coordinate[]{
new Coordinate(xmin, ymin),
new Coordinate(xmax, ymin),
new Coordinate(xmax, ymax),
new Coordinate(xmin, ymax),
new Co... | [
"public",
"static",
"Polygon",
"makeEnvelope",
"(",
"double",
"xmin",
",",
"double",
"ymin",
",",
"double",
"xmax",
",",
"double",
"ymax",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"new",
"Coordinate",
"[",
"]",
"{",
"new",
"Coordinate",
"(",
... | Creates a rectangular Polygon formed from the minima and maxima by the
given shell.
@param xmin X min
@param ymin Y min
@param xmax X max
@param ymax Y max
@return Envelope as a POLYGON | [
"Creates",
"a",
"rectangular",
"Polygon",
"formed",
"from",
"the",
"minima",
"and",
"maxima",
"by",
"the",
"given",
"shell",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java#L59-L68 |
107,531 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java | ST_MakeEnvelope.makeEnvelope | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax, int srid) {
Polygon geom = makeEnvelope(xmin, ymin, xmax, ymax);
geom.setSRID(srid);
return geom;
} | java | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax, int srid) {
Polygon geom = makeEnvelope(xmin, ymin, xmax, ymax);
geom.setSRID(srid);
return geom;
} | [
"public",
"static",
"Polygon",
"makeEnvelope",
"(",
"double",
"xmin",
",",
"double",
"ymin",
",",
"double",
"xmax",
",",
"double",
"ymax",
",",
"int",
"srid",
")",
"{",
"Polygon",
"geom",
"=",
"makeEnvelope",
"(",
"xmin",
",",
"ymin",
",",
"xmax",
",",
... | Creates a rectangular Polygon formed from the minima and maxima by the
given shell.
The user can set a srid.
@param xmin X min
@param ymin Y min
@param xmax X max
@param ymax Y max
@param srid SRID
@return Envelope as a POLYGON | [
"Creates",
"a",
"rectangular",
"Polygon",
"formed",
"from",
"the",
"minima",
"and",
"maxima",
"by",
"the",
"given",
"shell",
".",
"The",
"user",
"can",
"set",
"a",
"srid",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java#L81-L85 |
107,532 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java | ST_Simplify.simplify | public static Geometry simplify(Geometry geometry, double distance) {
if(geometry == null){
return null;
}
return DouglasPeuckerSimplifier.simplify(geometry, distance);
} | java | public static Geometry simplify(Geometry geometry, double distance) {
if(geometry == null){
return null;
}
return DouglasPeuckerSimplifier.simplify(geometry, distance);
} | [
"public",
"static",
"Geometry",
"simplify",
"(",
"Geometry",
"geometry",
",",
"double",
"distance",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"DouglasPeuckerSimplifier",
".",
"simplify",
"(",
"geometry",
"... | Simplify the geometry using the douglad peucker algorithm.
@param geometry
@param distance
@return | [
"Simplify",
"the",
"geometry",
"using",
"the",
"douglad",
"peucker",
"algorithm",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java#L51-L56 |
107,533 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Expand.java | ST_Expand.expand | public static Geometry expand(Geometry geometry, double deltaX, double deltaY) {
if(geometry == null){
return null;
}
Envelope env = geometry.getEnvelopeInternal();
// As the time of writing Envelope.expand is buggy with negative parameters
double minX = env.getMinX()... | java | public static Geometry expand(Geometry geometry, double deltaX, double deltaY) {
if(geometry == null){
return null;
}
Envelope env = geometry.getEnvelopeInternal();
// As the time of writing Envelope.expand is buggy with negative parameters
double minX = env.getMinX()... | [
"public",
"static",
"Geometry",
"expand",
"(",
"Geometry",
"geometry",
",",
"double",
"deltaX",
",",
"double",
"deltaY",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Envelope",
"env",
"=",
"geometry",
".",
"getEnv... | Expands a geometry's envelope by the given delta X and delta Y. Both
positive and negative distances are supported.
@param geometry the input geometry
@param deltaX the distance to expand the envelope along the X axis
@param deltaY the distance to expand the envelope along the Y axis
@return the expanded geometry | [
"Expands",
"a",
"geometry",
"s",
"envelope",
"by",
"the",
"given",
"delta",
"X",
"and",
"delta",
"Y",
".",
"Both",
"positive",
"and",
"negative",
"distances",
"are",
"supported",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Expand.java#L65-L80 |
107,534 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java | ST_TriangleDirection.computeDirection | public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException {
if(geometry == null){
return null;
}
// Convert geometry into triangle
Triangle triangle = TINFeatureFactory.createTriangle(geometry);
// Compute slope vector
Vector... | java | public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException {
if(geometry == null){
return null;
}
// Convert geometry into triangle
Triangle triangle = TINFeatureFactory.createTriangle(geometry);
// Compute slope vector
Vector... | [
"public",
"static",
"LineString",
"computeDirection",
"(",
"Geometry",
"geometry",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Convert geometry into triangle",
"Triangle",
"triangle",
... | Compute the main slope direction
@param geometry
@return
@throws IllegalArgumentException | [
"Compute",
"the",
"main",
"slope",
"direction"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java#L55-L87 |
107,535 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.drapePoints | public static Geometry drapePoints(Geometry pts, Geometry triangles, STRtree sTRtree) {
Geometry geomDrapped = pts.copy();
CoordinateSequenceFilter drapeFilter = new DrapeFilter(sTRtree);
geomDrapped.apply(drapeFilter);
return geomDrapped;
} | java | public static Geometry drapePoints(Geometry pts, Geometry triangles, STRtree sTRtree) {
Geometry geomDrapped = pts.copy();
CoordinateSequenceFilter drapeFilter = new DrapeFilter(sTRtree);
geomDrapped.apply(drapeFilter);
return geomDrapped;
} | [
"public",
"static",
"Geometry",
"drapePoints",
"(",
"Geometry",
"pts",
",",
"Geometry",
"triangles",
",",
"STRtree",
"sTRtree",
")",
"{",
"Geometry",
"geomDrapped",
"=",
"pts",
".",
"copy",
"(",
")",
";",
"CoordinateSequenceFilter",
"drapeFilter",
"=",
"new",
... | Drape a point or a multipoint geometry to a set of triangles
@param pts
@param triangles
@param sTRtree
@return | [
"Drape",
"a",
"point",
"or",
"a",
"multipoint",
"geometry",
"to",
"a",
"set",
"of",
"triangles"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L91-L96 |
107,536 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.drapeLineString | public static Geometry drapeLineString(LineString line, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = line.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
Geometry... | java | public static Geometry drapeLineString(LineString line, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = line.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
Geometry... | [
"public",
"static",
"Geometry",
"drapeLineString",
"(",
"LineString",
"line",
",",
"Geometry",
"triangles",
",",
"STRtree",
"sTRtree",
")",
"{",
"GeometryFactory",
"factory",
"=",
"line",
".",
"getFactory",
"(",
")",
";",
"//Split the triangles in lines to perform all... | Drape a linestring to a set of triangles
@param line
@param triangles
@param sTRtree
@return | [
"Drape",
"a",
"linestring",
"to",
"a",
"set",
"of",
"triangles"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L150-L158 |
107,537 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.drapePolygon | public static Geometry drapePolygon(Polygon p, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = p.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
Polygon spli... | java | public static Geometry drapePolygon(Polygon p, Geometry triangles, STRtree sTRtree) {
GeometryFactory factory = p.getFactory();
//Split the triangles in lines to perform all intersections
Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);
Polygon spli... | [
"public",
"static",
"Geometry",
"drapePolygon",
"(",
"Polygon",
"p",
",",
"Geometry",
"triangles",
",",
"STRtree",
"sTRtree",
")",
"{",
"GeometryFactory",
"factory",
"=",
"p",
".",
"getFactory",
"(",
")",
";",
"//Split the triangles in lines to perform all intersectio... | Drape a polygon on a set of triangles
@param p
@param triangles
@param sTRtree
@return | [
"Drape",
"a",
"polygon",
"on",
"a",
"set",
"of",
"triangles"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L167-L175 |
107,538 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.processPolygon | private static Polygon processPolygon(Polygon p, Geometry triangleLines, GeometryFactory factory) {
Geometry diffExt = p.getExteriorRing().difference(triangleLines);
final int nbOfHoles = p.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nb... | java | private static Polygon processPolygon(Polygon p, Geometry triangleLines, GeometryFactory factory) {
Geometry diffExt = p.getExteriorRing().difference(triangleLines);
final int nbOfHoles = p.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nb... | [
"private",
"static",
"Polygon",
"processPolygon",
"(",
"Polygon",
"p",
",",
"Geometry",
"triangleLines",
",",
"GeometryFactory",
"factory",
")",
"{",
"Geometry",
"diffExt",
"=",
"p",
".",
"getExteriorRing",
"(",
")",
".",
"difference",
"(",
"triangleLines",
")",... | Cut the lines of the polygon with the triangles
@param p
@param triangleLines
@param factory
@return | [
"Cut",
"the",
"lines",
"of",
"the",
"polygon",
"with",
"the",
"triangles"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L184-L193 |
107,539 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java | ST_Drape.lineMerge | public static Geometry lineMerge(Geometry geom, GeometryFactory factory) {
LineMerger merger = new LineMerger();
merger.add(geom);
Collection lines = merger.getMergedLineStrings();
return factory.buildGeometry(lines);
} | java | public static Geometry lineMerge(Geometry geom, GeometryFactory factory) {
LineMerger merger = new LineMerger();
merger.add(geom);
Collection lines = merger.getMergedLineStrings();
return factory.buildGeometry(lines);
} | [
"public",
"static",
"Geometry",
"lineMerge",
"(",
"Geometry",
"geom",
",",
"GeometryFactory",
"factory",
")",
"{",
"LineMerger",
"merger",
"=",
"new",
"LineMerger",
"(",
")",
";",
"merger",
".",
"add",
"(",
"geom",
")",
";",
"Collection",
"lines",
"=",
"me... | A method to merge a geometry to a set of linestring
@param geom
@param factory
@return | [
"A",
"method",
"to",
"merge",
"a",
"geometry",
"to",
"a",
"set",
"of",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java#L201-L206 |
107,540 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java | ST_PrecisionReducer.precisionReducer | public static Geometry precisionReducer(Geometry geometry, int nbDec) throws SQLException {
if(geometry == null){
return null;
}
if (nbDec < 0) {
throw new SQLException("Decimal_places has to be >= 0.");
}
PrecisionModel pm = new PrecisionModel(scaleFactor... | java | public static Geometry precisionReducer(Geometry geometry, int nbDec) throws SQLException {
if(geometry == null){
return null;
}
if (nbDec < 0) {
throw new SQLException("Decimal_places has to be >= 0.");
}
PrecisionModel pm = new PrecisionModel(scaleFactor... | [
"public",
"static",
"Geometry",
"precisionReducer",
"(",
"Geometry",
"geometry",
",",
"int",
"nbDec",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"nbDec",
"<",
"0",
")",
"{",
... | Reduce the geometry precision. Decimal_Place is the number of decimals to
keep.
@param geometry
@param nbDec
@return
@throws SQLException | [
"Reduce",
"the",
"geometry",
"precision",
".",
"Decimal_Place",
"is",
"the",
"number",
"of",
"decimals",
"to",
"keep",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java#L54-L64 |
107,541 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java | ST_RingSideBuffer.ringSideBuffer | public static Geometry ringSideBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException {
return ringSideBuffer(geom, bufferSize, numBuffer, "endcap=flat");
} | java | public static Geometry ringSideBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException {
return ringSideBuffer(geom, bufferSize, numBuffer, "endcap=flat");
} | [
"public",
"static",
"Geometry",
"ringSideBuffer",
"(",
"Geometry",
"geom",
",",
"double",
"bufferSize",
",",
"int",
"numBuffer",
")",
"throws",
"SQLException",
"{",
"return",
"ringSideBuffer",
"(",
"geom",
",",
"bufferSize",
",",
"numBuffer",
",",
"\"endcap=flat\"... | Compute a ring buffer on one side of the geometry
@param geom
@param bufferSize
@param numBuffer
@return
@throws java.sql.SQLException | [
"Compute",
"a",
"ring",
"buffer",
"on",
"one",
"side",
"of",
"the",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java#L65-L67 |
107,542 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleAspect.java | ST_TriangleAspect.computeAspect | public static Double computeAspect(Geometry geometry) throws IllegalArgumentException {
if (geometry == null) {
return null;
}
Vector3D vector = TriMarkers.getSteepestVector(TriMarkers.getNormalVector(TINFeatureFactory.createTriangle(geometry)), TINFeatureFactory.EPSILON);
if... | java | public static Double computeAspect(Geometry geometry) throws IllegalArgumentException {
if (geometry == null) {
return null;
}
Vector3D vector = TriMarkers.getSteepestVector(TriMarkers.getNormalVector(TINFeatureFactory.createTriangle(geometry)), TINFeatureFactory.EPSILON);
if... | [
"public",
"static",
"Double",
"computeAspect",
"(",
"Geometry",
"geometry",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Vector3D",
"vector",
"=",
"TriMarkers",
".",
"getSteepestVecto... | Compute the aspect in degree. The geometry must be a triangle.
@param geometry Polygon triangle
@return aspect in degree
@throws IllegalArgumentException ST_TriangleAspect accept only triangles | [
"Compute",
"the",
"aspect",
"in",
"degree",
".",
"The",
"geometry",
"must",
"be",
"a",
"triangle",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleAspect.java#L53-L64 |
107,543 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_ZMin.java | ST_ZMin.getMinZ | public static Double getMinZ(Geometry geom) {
if (geom != null) {
return CoordinateUtils.zMinMax(geom.getCoordinates())[0];
} else {
return null;
}
} | java | public static Double getMinZ(Geometry geom) {
if (geom != null) {
return CoordinateUtils.zMinMax(geom.getCoordinates())[0];
} else {
return null;
}
} | [
"public",
"static",
"Double",
"getMinZ",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"return",
"CoordinateUtils",
".",
"zMinMax",
"(",
"geom",
".",
"getCoordinates",
"(",
")",
")",
"[",
"0",
"]",
";",
"}",
"else",
"{... | Returns the minimal z-value of the given geometry.
@param geom Geometry
@return The minimal z-value of the given geometry, or null if the geometry is null. | [
"Returns",
"the",
"minimal",
"z",
"-",
"value",
"of",
"the",
"given",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_ZMin.java#L49-L55 |
107,544 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java | ST_Reverse3DLine.reverse3D | private static LineString reverse3D(LineString lineString, String order) {
CoordinateSequence seq = lineString.getCoordinateSequence();
double startZ = seq.getCoordinate(0).z;
double endZ = seq.getCoordinate(seq.size() - 1).z;
if (order.equalsIgnoreCase("desc")) {
if (!Double... | java | private static LineString reverse3D(LineString lineString, String order) {
CoordinateSequence seq = lineString.getCoordinateSequence();
double startZ = seq.getCoordinate(0).z;
double endZ = seq.getCoordinate(seq.size() - 1).z;
if (order.equalsIgnoreCase("desc")) {
if (!Double... | [
"private",
"static",
"LineString",
"reverse3D",
"(",
"LineString",
"lineString",
",",
"String",
"order",
")",
"{",
"CoordinateSequence",
"seq",
"=",
"lineString",
".",
"getCoordinateSequence",
"(",
")",
";",
"double",
"startZ",
"=",
"seq",
".",
"getCoordinate",
... | Reverses a LineString according to the z value. The z of the first point
must be lower than the z of the end point.
@param lineString
@return | [
"Reverses",
"a",
"LineString",
"according",
"to",
"the",
"z",
"value",
".",
"The",
"z",
"of",
"the",
"first",
"point",
"must",
"be",
"lower",
"than",
"the",
"z",
"of",
"the",
"end",
"point",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java#L87-L106 |
107,545 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java | ST_GoogleMapLink.generateGMLink | public static String generateGMLink(Geometry geom, String layerType, int zoom) {
if (geom == null) {
return null;
}
try {
LayerType layer = LayerType.valueOf(layerType.toLowerCase());
Coordinate centre = geom.getEnvelopeInternal().centre();
StringB... | java | public static String generateGMLink(Geometry geom, String layerType, int zoom) {
if (geom == null) {
return null;
}
try {
LayerType layer = LayerType.valueOf(layerType.toLowerCase());
Coordinate centre = geom.getEnvelopeInternal().centre();
StringB... | [
"public",
"static",
"String",
"generateGMLink",
"(",
"Geometry",
"geom",
",",
"String",
"layerType",
",",
"int",
"zoom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"LayerType",
"layer",
"=",
"LayerType",
... | Generate a Google Map link URL based on the center of the bounding box of the input geometry.
Set the layer type and the zoom level.
@param geom
@param layerType
@param zoom
@return | [
"Generate",
"a",
"Google",
"Map",
"link",
"URL",
"based",
"on",
"the",
"center",
"of",
"the",
"bounding",
"box",
"of",
"the",
"input",
"geometry",
".",
"Set",
"the",
"layer",
"type",
"and",
"the",
"zoom",
"level",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java#L78-L97 |
107,546 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/FullConvexHull.java | FullConvexHull.toCoordinateArray | protected Coordinate[] toCoordinateArray(Stack stack) {
Coordinate[] coordinates = new Coordinate[stack.size()];
for (int i = 0; i < stack.size(); i++) {
Coordinate coordinate = (Coordinate) stack.get(i);
coordinates[i] = coordinate;
}
return coordinates;
} | java | protected Coordinate[] toCoordinateArray(Stack stack) {
Coordinate[] coordinates = new Coordinate[stack.size()];
for (int i = 0; i < stack.size(); i++) {
Coordinate coordinate = (Coordinate) stack.get(i);
coordinates[i] = coordinate;
}
return coordinates;
} | [
"protected",
"Coordinate",
"[",
"]",
"toCoordinateArray",
"(",
"Stack",
"stack",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"new",
"Coordinate",
"[",
"stack",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | An alternative to Stack.toArray, which is not present in earlier versions
of Java.
@param stack | [
"An",
"alternative",
"to",
"Stack",
".",
"toArray",
"which",
"is",
"not",
"present",
"in",
"earlier",
"versions",
"of",
"Java",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/FullConvexHull.java#L117-L124 |
107,547 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/FullConvexHull.java | FullConvexHull.grahamScan | private Stack grahamScan(Coordinate[] c) {
Coordinate p;
Stack ps = new Stack();
p = (Coordinate) ps.push(c[0]);
p = (Coordinate) ps.push(c[1]);
p = (Coordinate) ps.push(c[2]);
for (int i = 3; i < c.length; i++) {
p = (Coordinate) ps.pop();
// chec... | java | private Stack grahamScan(Coordinate[] c) {
Coordinate p;
Stack ps = new Stack();
p = (Coordinate) ps.push(c[0]);
p = (Coordinate) ps.push(c[1]);
p = (Coordinate) ps.push(c[2]);
for (int i = 3; i < c.length; i++) {
p = (Coordinate) ps.pop();
// chec... | [
"private",
"Stack",
"grahamScan",
"(",
"Coordinate",
"[",
"]",
"c",
")",
"{",
"Coordinate",
"p",
";",
"Stack",
"ps",
"=",
"new",
"Stack",
"(",
")",
";",
"p",
"=",
"(",
"Coordinate",
")",
"ps",
".",
"push",
"(",
"c",
"[",
"0",
"]",
")",
";",
"p"... | Uses the Graham Scan algorithm to compute the convex hull vertices.
@param c a list of points, with at least 3 entries
@return a Stack containing the ordered points of the convex hull ring | [
"Uses",
"the",
"Graham",
"Scan",
"algorithm",
"to",
"compute",
"the",
"convex",
"hull",
"vertices",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/FullConvexHull.java#L219-L238 |
107,548 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java | ST_Force3D.force3D | public static Geometry force3D(Geometry geom) {
if (geom == null) {
return null;
}
return GeometryCoordinateDimension.force(geom, 3);
} | java | public static Geometry force3D(Geometry geom) {
if (geom == null) {
return null;
}
return GeometryCoordinateDimension.force(geom, 3);
} | [
"public",
"static",
"Geometry",
"force3D",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"GeometryCoordinateDimension",
".",
"force",
"(",
"geom",
",",
"3",
")",
";",
"}"
] | Converts a XY geometry to XYZ. If a geometry has no Z component, then a 0
Z coordinate is tacked on.
@param geom
@return | [
"Converts",
"a",
"XY",
"geometry",
"to",
"XYZ",
".",
"If",
"a",
"geometry",
"has",
"no",
"Z",
"component",
"then",
"a",
"0",
"Z",
"coordinate",
"is",
"tacked",
"on",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java#L54-L59 |
107,549 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java | ST_DWithin.isWithinDistance | public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
if(geomA == null||geomB == null){
return null;
}
return geomA.isWithinDistance(geomB, distance);
} | java | public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
if(geomA == null||geomB == null){
return null;
}
return geomA.isWithinDistance(geomB, distance);
} | [
"public",
"static",
"Boolean",
"isWithinDistance",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
",",
"Double",
"distance",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"ge... | Returns true if the geometries are within the specified distance of one another.
@param geomA Geometry A
@param geomB Geometry B
@param distance Distance
@return True if if the geometries are within the specified distance of one another | [
"Returns",
"true",
"if",
"the",
"geometries",
"are",
"within",
"the",
"specified",
"distance",
"of",
"one",
"another",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java#L52-L57 |
107,550 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojson | public static String toGeojson(Geometry geom) {
StringBuilder sb = new StringBuilder();
toGeojsonGeometry(geom, sb);
return sb.toString();
} | java | public static String toGeojson(Geometry geom) {
StringBuilder sb = new StringBuilder();
toGeojsonGeometry(geom, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"toGeojson",
"(",
"Geometry",
"geom",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"toGeojsonGeometry",
"(",
"geom",
",",
"sb",
")",
";",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] | Convert the geometry to a GeoJSON representation.
@param geom
@return | [
"Convert",
"the",
"geometry",
"to",
"a",
"GeoJSON",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L50-L54 |
107,551 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonGeometry | public static void toGeojsonGeometry(Geometry geom, StringBuilder sb) {
if (geom instanceof Point) {
toGeojsonPoint((Point) geom, sb);
} else if (geom instanceof LineString) {
toGeojsonLineString((LineString) geom, sb);
} else if (geom instanceof Polygon) {
to... | java | public static void toGeojsonGeometry(Geometry geom, StringBuilder sb) {
if (geom instanceof Point) {
toGeojsonPoint((Point) geom, sb);
} else if (geom instanceof LineString) {
toGeojsonLineString((LineString) geom, sb);
} else if (geom instanceof Polygon) {
to... | [
"public",
"static",
"void",
"toGeojsonGeometry",
"(",
"Geometry",
"geom",
",",
"StringBuilder",
"sb",
")",
"{",
"if",
"(",
"geom",
"instanceof",
"Point",
")",
"{",
"toGeojsonPoint",
"(",
"(",
"Point",
")",
"geom",
",",
"sb",
")",
";",
"}",
"else",
"if",
... | Transform a JTS geometry to a GeoJSON representation.
@param geom
@param sb | [
"Transform",
"a",
"JTS",
"geometry",
"to",
"a",
"GeoJSON",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L63-L79 |
107,552 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonPoint | public static void toGeojsonPoint(Point point, StringBuilder sb) {
Coordinate coord = point.getCoordinate();
sb.append("{\"type\":\"Point\",\"coordinates\":[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
... | java | public static void toGeojsonPoint(Point point, StringBuilder sb) {
Coordinate coord = point.getCoordinate();
sb.append("{\"type\":\"Point\",\"coordinates\":[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
... | [
"public",
"static",
"void",
"toGeojsonPoint",
"(",
"Point",
"point",
",",
"StringBuilder",
"sb",
")",
"{",
"Coordinate",
"coord",
"=",
"point",
".",
"getCoordinate",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[\"",
... | For type "Point", the "coordinates" member must be a single position.
A position is the fundamental geometry construct. The "coordinates"
member of a geometry object is composed of one position (in the case of a
Point geometry), an array of positions (LineString or MultiPoint
geometries), an array of arrays of positio... | [
"For",
"type",
"Point",
"the",
"coordinates",
"member",
"must",
"be",
"a",
"single",
"position",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L106-L114 |
107,553 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonMultiPoint | public static void toGeojsonMultiPoint(MultiPoint multiPoint, StringBuilder sb) {
sb.append("{\"type\":\"MultiPoint\",\"coordinates\":");
toGeojsonCoordinates(multiPoint.getCoordinates(), sb);
sb.append("}");
} | java | public static void toGeojsonMultiPoint(MultiPoint multiPoint, StringBuilder sb) {
sb.append("{\"type\":\"MultiPoint\",\"coordinates\":");
toGeojsonCoordinates(multiPoint.getCoordinates(), sb);
sb.append("}");
} | [
"public",
"static",
"void",
"toGeojsonMultiPoint",
"(",
"MultiPoint",
"multiPoint",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"MultiPoint\\\",\\\"coordinates\\\":\"",
")",
";",
"toGeojsonCoordinates",
"(",
"multiPoint",
".",
"ge... | Coordinates of a MultiPoint are an array of positions.
Syntax:
{ "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }
@param multiPoint
@param sb | [
"Coordinates",
"of",
"a",
"MultiPoint",
"are",
"an",
"array",
"of",
"positions",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L126-L130 |
107,554 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonLineString | public static void toGeojsonLineString(LineString lineString, StringBuilder sb) {
sb.append("{\"type\":\"LineString\",\"coordinates\":");
toGeojsonCoordinates(lineString.getCoordinates(), sb);
sb.append("}");
} | java | public static void toGeojsonLineString(LineString lineString, StringBuilder sb) {
sb.append("{\"type\":\"LineString\",\"coordinates\":");
toGeojsonCoordinates(lineString.getCoordinates(), sb);
sb.append("}");
} | [
"public",
"static",
"void",
"toGeojsonLineString",
"(",
"LineString",
"lineString",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"LineString\\\",\\\"coordinates\\\":\"",
")",
";",
"toGeojsonCoordinates",
"(",
"lineString",
".",
"ge... | Coordinates of LineString are an array of positions.
Syntax:
{ "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }
@param lineString
@param sb | [
"Coordinates",
"of",
"LineString",
"are",
"an",
"array",
"of",
"positions",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L142-L146 |
107,555 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonMultiLineString | public static void toGeojsonMultiLineString(MultiLineString multiLineString, StringBuilder sb) {
sb.append("{\"type\":\"MultiLineString\",\"coordinates\":[");
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
toGeojsonCoordinates(multiLineString.getGeometryN(i).getCoordinates(),... | java | public static void toGeojsonMultiLineString(MultiLineString multiLineString, StringBuilder sb) {
sb.append("{\"type\":\"MultiLineString\",\"coordinates\":[");
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
toGeojsonCoordinates(multiLineString.getGeometryN(i).getCoordinates(),... | [
"public",
"static",
"void",
"toGeojsonMultiLineString",
"(",
"MultiLineString",
"multiLineString",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"MultiLineString\\\",\\\"coordinates\\\":[\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Coordinates of a MultiLineString are an array of LineString coordinate
arrays.
Syntax:
{ "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0,
1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] }
@param multiLineString
@param sb | [
"Coordinates",
"of",
"a",
"MultiLineString",
"are",
"an",
"array",
"of",
"LineString",
"coordinate",
"arrays",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L160-L169 |
107,556 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonMultiPolygon | public static void toGeojsonMultiPolygon(MultiPolygon multiPolygon, StringBuilder sb) {
sb.append("{\"type\":\"MultiPolygon\",\"coordinates\":[");
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Polygon p = (Polygon) multiPolygon.getGeometryN(i);
sb.append("[");
... | java | public static void toGeojsonMultiPolygon(MultiPolygon multiPolygon, StringBuilder sb) {
sb.append("{\"type\":\"MultiPolygon\",\"coordinates\":[");
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Polygon p = (Polygon) multiPolygon.getGeometryN(i);
sb.append("[");
... | [
"public",
"static",
"void",
"toGeojsonMultiPolygon",
"(",
"MultiPolygon",
"multiPolygon",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"MultiPolygon\\\",\\\"coordinates\\\":[\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",... | Coordinates of a MultiPolygon are an array of Polygon coordinate arrays.
Syntax:
{ "type": "MultiPolygon", "coordinates": [ [[[102.0, 2.0], [103.0, 2.0],
[103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0],
[101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2],
[100.8, 0.8], [100... | [
"Coordinates",
"of",
"a",
"MultiPolygon",
"are",
"an",
"array",
"of",
"Polygon",
"coordinate",
"arrays",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L218-L237 |
107,557 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonGeometryCollection | public static void toGeojsonGeometryCollection(GeometryCollection geometryCollection, StringBuilder sb) {
sb.append("{\"type\":\"GeometryCollection\",\"geometries\":[");
for (int i = 0; i < geometryCollection.getNumGeometries(); i++) {
Geometry geom = geometryCollection.getGeometryN(i);
... | java | public static void toGeojsonGeometryCollection(GeometryCollection geometryCollection, StringBuilder sb) {
sb.append("{\"type\":\"GeometryCollection\",\"geometries\":[");
for (int i = 0; i < geometryCollection.getNumGeometries(); i++) {
Geometry geom = geometryCollection.getGeometryN(i);
... | [
"public",
"static",
"void",
"toGeojsonGeometryCollection",
"(",
"GeometryCollection",
"geometryCollection",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"{\\\"type\\\":\\\"GeometryCollection\\\",\\\"geometries\\\":[\"",
")",
";",
"for",
"(",
"int",
"i... | A GeoJSON object with type "GeometryCollection" is a geometry object
which represents a collection of geometry objects.
A geometry collection must have a member with the name "geometries". The
value corresponding to "geometries"is an array. Each element in this
array is a GeoJSON geometry object.
Syntax:
{ "type": "... | [
"A",
"GeoJSON",
"object",
"with",
"type",
"GeometryCollection",
"is",
"a",
"geometry",
"object",
"which",
"represents",
"a",
"collection",
"of",
"geometry",
"objects",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L256-L272 |
107,558 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonCoordinates | public static void toGeojsonCoordinates(Coordinate[] coords, StringBuilder sb) {
sb.append("[");
for (int i = 0; i < coords.length; i++) {
toGeojsonCoordinate(coords[i], sb);
if (i < coords.length - 1) {
sb.append(",");
}
}
sb.append("]... | java | public static void toGeojsonCoordinates(Coordinate[] coords, StringBuilder sb) {
sb.append("[");
for (int i = 0; i < coords.length; i++) {
toGeojsonCoordinate(coords[i], sb);
if (i < coords.length - 1) {
sb.append(",");
}
}
sb.append("]... | [
"public",
"static",
"void",
"toGeojsonCoordinates",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"[\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"coords",
".",
"length",
";... | Convert a jts array of coordinates to a GeoJSON coordinates
representation.
Syntax:
[[X1,Y1],[X2,Y2]]
@param coords
@param sb | [
"Convert",
"a",
"jts",
"array",
"of",
"coordinates",
"to",
"a",
"GeoJSON",
"coordinates",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L285-L294 |
107,559 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonCoordinate | public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
sb.append("[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
}
sb.append("]");
} | java | public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
sb.append("[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
}
sb.append("]");
} | [
"public",
"static",
"void",
"toGeojsonCoordinate",
"(",
"Coordinate",
"coord",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"[\"",
")",
";",
"sb",
".",
"append",
"(",
"coord",
".",
"x",
")",
".",
"append",
"(",
"\",\"",
")",
".",
... | Convert a JTS coordinate to a GeoJSON representation.
Only x, y and z values are supported.
Syntax:
[X,Y] or [X,Y,Z]
@param coord
@param sb | [
"Convert",
"a",
"JTS",
"coordinate",
"to",
"a",
"GeoJSON",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L308-L315 |
107,560 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeoJsonEnvelope | public String toGeoJsonEnvelope(Envelope e) {
return new StringBuffer().append("[").append(e.getMinX()).append(",")
.append(e.getMinY()).append(",").append(e.getMaxX()).append(",")
.append(e.getMaxY()).append("]").toString();
} | java | public String toGeoJsonEnvelope(Envelope e) {
return new StringBuffer().append("[").append(e.getMinX()).append(",")
.append(e.getMinY()).append(",").append(e.getMaxX()).append(",")
.append(e.getMaxY()).append("]").toString();
} | [
"public",
"String",
"toGeoJsonEnvelope",
"(",
"Envelope",
"e",
")",
"{",
"return",
"new",
"StringBuffer",
"(",
")",
".",
"append",
"(",
"\"[\"",
")",
".",
"append",
"(",
"e",
".",
"getMinX",
"(",
")",
")",
".",
"append",
"(",
"\",\"",
")",
".",
"appe... | Convert a JTS Envelope to a GeoJSON representation.
@param e The envelope
@return The envelope encoded as GeoJSON | [
"Convert",
"a",
"JTS",
"Envelope",
"to",
"a",
"GeoJSON",
"representation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L324-L328 |
107,561 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java | ST_OSMDownloader.downloadOSMFile | public static void downloadOSMFile(File file, Envelope geometryEnvelope) throws IOException {
HttpURLConnection urlCon = (HttpURLConnection) createOsmUrl(geometryEnvelope).openConnection();
urlCon.setRequestMethod("GET");
urlCon.connect();
switch (urlCon.getResponseCode()) {
... | java | public static void downloadOSMFile(File file, Envelope geometryEnvelope) throws IOException {
HttpURLConnection urlCon = (HttpURLConnection) createOsmUrl(geometryEnvelope).openConnection();
urlCon.setRequestMethod("GET");
urlCon.connect();
switch (urlCon.getResponseCode()) {
... | [
"public",
"static",
"void",
"downloadOSMFile",
"(",
"File",
"file",
",",
"Envelope",
"geometryEnvelope",
")",
"throws",
"IOException",
"{",
"HttpURLConnection",
"urlCon",
"=",
"(",
"HttpURLConnection",
")",
"createOsmUrl",
"(",
"geometryEnvelope",
")",
".",
"openCon... | Download OSM file from the official server
@param file
@param geometryEnvelope
@throws IOException | [
"Download",
"OSM",
"file",
"from",
"the",
"official",
"server"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java#L116-L142 |
107,562 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java | ST_OSMDownloader.createOsmUrl | private static URL createOsmUrl(Envelope geometryEnvelope) {
try {
return new URL(OSM_API_URL + "map?bbox=" + geometryEnvelope.getMinX() + ","
+ geometryEnvelope.getMinY()
+ "," + geometryEnvelope.getMaxX() + "," + geometryEnvelope.getMaxY());
} catch ... | java | private static URL createOsmUrl(Envelope geometryEnvelope) {
try {
return new URL(OSM_API_URL + "map?bbox=" + geometryEnvelope.getMinX() + ","
+ geometryEnvelope.getMinY()
+ "," + geometryEnvelope.getMaxX() + "," + geometryEnvelope.getMaxY());
} catch ... | [
"private",
"static",
"URL",
"createOsmUrl",
"(",
"Envelope",
"geometryEnvelope",
")",
"{",
"try",
"{",
"return",
"new",
"URL",
"(",
"OSM_API_URL",
"+",
"\"map?bbox=\"",
"+",
"geometryEnvelope",
".",
"getMinX",
"(",
")",
"+",
"\",\"",
"+",
"geometryEnvelope",
"... | Build the OSM URL based on a given envelope
@param geometryEnvelope
@return | [
"Build",
"the",
"OSM",
"URL",
"based",
"on",
"a",
"given",
"envelope"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java#L150-L158 |
107,563 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java | ST_Disjoint.geomDisjoint | public static Boolean geomDisjoint(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.disjoint(b);
} | java | public static Boolean geomDisjoint(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.disjoint(b);
} | [
"public",
"static",
"Boolean",
"geomDisjoint",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"disjoint",
"(",
"b",
")",
";",
... | Return true if the two Geometries are disjoint
@param a Geometry Geometry.
@param b Geometry instance
@return true if the two Geometries are disjoint | [
"Return",
"true",
"if",
"the",
"two",
"Geometries",
"are",
"disjoint"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java#L52-L57 |
107,564 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.write | public void write(ProgressVisitor progress) throws SQLException {
if (FileUtil.isExtensionWellFormated(fileName, "kml")) {
writeKML(progress);
} else if (FileUtil.isExtensionWellFormated(fileName, "kmz")) {
String name = fileName.getName();
int pos = name.last... | java | public void write(ProgressVisitor progress) throws SQLException {
if (FileUtil.isExtensionWellFormated(fileName, "kml")) {
writeKML(progress);
} else if (FileUtil.isExtensionWellFormated(fileName, "kmz")) {
String name = fileName.getName();
int pos = name.last... | [
"public",
"void",
"write",
"(",
"ProgressVisitor",
"progress",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"FileUtil",
".",
"isExtensionWellFormated",
"(",
"fileName",
",",
"\"kml\"",
")",
")",
"{",
"writeKML",
"(",
"progress",
")",
";",
"}",
"else",
"if"... | Write spatial table to kml or kmz file format.
@param progress
@throws SQLException | [
"Write",
"spatial",
"table",
"to",
"kml",
"or",
"kmz",
"file",
"format",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L65-L75 |
107,565 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writeKML | private void writeKML(ProgressVisitor progress) throws SQLException {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(fileName);
writeKMLDocument(progress, fos);
} catch (FileNotFoundException ex) {
throw new SQLException(ex);
} finally ... | java | private void writeKML(ProgressVisitor progress) throws SQLException {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(fileName);
writeKMLDocument(progress, fos);
} catch (FileNotFoundException ex) {
throw new SQLException(ex);
} finally ... | [
"private",
"void",
"writeKML",
"(",
"ProgressVisitor",
"progress",
")",
"throws",
"SQLException",
"{",
"FileOutputStream",
"fos",
"=",
"null",
";",
"try",
"{",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"fileName",
")",
";",
"writeKMLDocument",
"(",
"progress",... | Write the spatial table to a KML format
@param progress
@throws SQLException | [
"Write",
"the",
"spatial",
"table",
"to",
"a",
"KML",
"format"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L83-L100 |
107,566 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writeKMZ | private void writeKMZ(ProgressVisitor progress, String fileNameWithExtension) throws SQLException {
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(new FileOutputStream(fileName));
// Create a zip entry for the main KML file
zos.putNextEntry(new ZipEntry(f... | java | private void writeKMZ(ProgressVisitor progress, String fileNameWithExtension) throws SQLException {
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(new FileOutputStream(fileName));
// Create a zip entry for the main KML file
zos.putNextEntry(new ZipEntry(f... | [
"private",
"void",
"writeKMZ",
"(",
"ProgressVisitor",
"progress",
",",
"String",
"fileNameWithExtension",
")",
"throws",
"SQLException",
"{",
"ZipOutputStream",
"zos",
"=",
"null",
";",
"try",
"{",
"zos",
"=",
"new",
"ZipOutputStream",
"(",
"new",
"FileOutputStre... | Write the spatial table to a KMZ format
@param progress
@param fileNameWithExtension
@throws SQLException | [
"Write",
"the",
"spatial",
"table",
"to",
"a",
"KMZ",
"format"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L109-L140 |
107,567 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writeKMLDocument | private void writeKMLDocument(ProgressVisitor progress, OutputStream outputStream) throws SQLException {
// Read Geometry Index and type
List<String> spatialFieldNames = SFSUtilities.getGeometryFields(connection, TableLocation.parse(tableName, JDBCUtilities.isH2DataBase(connection.getMetaData())));
... | java | private void writeKMLDocument(ProgressVisitor progress, OutputStream outputStream) throws SQLException {
// Read Geometry Index and type
List<String> spatialFieldNames = SFSUtilities.getGeometryFields(connection, TableLocation.parse(tableName, JDBCUtilities.isH2DataBase(connection.getMetaData())));
... | [
"private",
"void",
"writeKMLDocument",
"(",
"ProgressVisitor",
"progress",
",",
"OutputStream",
"outputStream",
")",
"throws",
"SQLException",
"{",
"// Read Geometry Index and type",
"List",
"<",
"String",
">",
"spatialFieldNames",
"=",
"SFSUtilities",
".",
"getGeometryFi... | Write the KML document Note the document stores only the first geometry
column in the placeMark element. The other geomtry columns are ignored.
@param progress
@param outputStream
@throws SQLException | [
"Write",
"the",
"KML",
"document",
"Note",
"the",
"document",
"stores",
"only",
"the",
"first",
"geometry",
"column",
"in",
"the",
"placeMark",
"element",
".",
"The",
"other",
"geomtry",
"columns",
"are",
"ignored",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L150-L201 |
107,568 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.writePlacemark | public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, int geoFieldIndex, String spatialFieldName) throws XMLStreamException, SQLException {
xmlOut.writeStartElement("Placemark");
if (columnCount > 1) {
writeExtendedData(xmlOut, rs);
}
StringBuilder sb = new StringB... | java | public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, int geoFieldIndex, String spatialFieldName) throws XMLStreamException, SQLException {
xmlOut.writeStartElement("Placemark");
if (columnCount > 1) {
writeExtendedData(xmlOut, rs);
}
StringBuilder sb = new StringB... | [
"public",
"void",
"writePlacemark",
"(",
"XMLStreamWriter",
"xmlOut",
",",
"ResultSet",
"rs",
",",
"int",
"geoFieldIndex",
",",
"String",
"spatialFieldName",
")",
"throws",
"XMLStreamException",
",",
"SQLException",
"{",
"xmlOut",
".",
"writeStartElement",
"(",
"\"P... | A Placemark is a Feature with associated Geometry.
Syntax :
<Placemark id="ID">
<!-- inherited from Feature element -->
<name>...</name> <!-- string -->
<visibility>1</visibility> <!-- boolean -->
<open>0</open> <!-- boolean -->
<atom:author>...<atom:author> <!-- xmlns:atom -->
<atom:link href=" "/> <!-- xmlns:atom -... | [
"A",
"Placemark",
"is",
"a",
"Feature",
"with",
"associated",
"Geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L295-L313 |
107,569 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java | KMLWriterDriver.getKMLType | private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException {
switch (sqlTypeId) {
case Types.BOOLEAN:
return "bool";
case Types.DOUBLE:
return "double";
case Types.FLOAT:
return "float";
... | java | private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException {
switch (sqlTypeId) {
case Types.BOOLEAN:
return "bool";
case Types.DOUBLE:
return "double";
case Types.FLOAT:
return "float";
... | [
"private",
"static",
"String",
"getKMLType",
"(",
"int",
"sqlTypeId",
",",
"String",
"sqlTypeName",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"sqlTypeId",
")",
"{",
"case",
"Types",
".",
"BOOLEAN",
":",
"return",
"\"bool\"",
";",
"case",
"Types",
".... | Return the kml type representation from SQL data type
@param sqlTypeId
@param sqlTypeName
@return
@throws SQLException | [
"Return",
"the",
"kml",
"type",
"representation",
"from",
"SQL",
"data",
"type"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L377-L398 |
107,570 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java | ST_Touches.geomTouches | public static Boolean geomTouches(Geometry a,Geometry b) {
if(a==null || b==null) {
return null;
}
return a.touches(b);
} | java | public static Boolean geomTouches(Geometry a,Geometry b) {
if(a==null || b==null) {
return null;
}
return a.touches(b);
} | [
"public",
"static",
"Boolean",
"geomTouches",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"touches",
"(",
"b",
")",
";",
"}... | Return true if the geometry A touches the geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if the geometry A touches the geometry B | [
"Return",
"true",
"if",
"the",
"geometry",
"A",
"touches",
"the",
"geometry",
"B"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java#L50-L55 |
107,571 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java | ST_RemoveDuplicatedCoordinates.removeCoordinates | public static Geometry removeCoordinates(Geometry geom) {
if(geom ==null){
return null;
}
else if (geom.isEmpty()) {
return geom;
} else if (geom instanceof Point){
return geom; }
else if (geom instanceof MultiPoint) {
retur... | java | public static Geometry removeCoordinates(Geometry geom) {
if(geom ==null){
return null;
}
else if (geom.isEmpty()) {
return geom;
} else if (geom instanceof Point){
return geom; }
else if (geom instanceof MultiPoint) {
retur... | [
"public",
"static",
"Geometry",
"removeCoordinates",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"geom",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"geom",
";",
"}",
... | Removes duplicated coordinates within a geometry.
@param geom
@return | [
"Removes",
"duplicated",
"coordinates",
"within",
"a",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java#L48-L70 |
107,572 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java | ST_RemoveDuplicatedCoordinates.removeCoordinates | public static MultiPoint removeCoordinates(MultiPoint g) {
Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(),false);
return FACTORY.createMultiPoint(coords);
} | java | public static MultiPoint removeCoordinates(MultiPoint g) {
Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(),false);
return FACTORY.createMultiPoint(coords);
} | [
"public",
"static",
"MultiPoint",
"removeCoordinates",
"(",
"MultiPoint",
"g",
")",
"{",
"Coordinate",
"[",
"]",
"coords",
"=",
"CoordinateUtils",
".",
"removeDuplicatedCoordinates",
"(",
"g",
".",
"getCoordinates",
"(",
")",
",",
"false",
")",
";",
"return",
... | Removes duplicated coordinates within a MultiPoint.
@param g
@return | [
"Removes",
"duplicated",
"coordinates",
"within",
"a",
"MultiPoint",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java#L79-L82 |
107,573 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java | KMLWrite.writeKML | public static void writeKML(Connection connection, String fileName, String tableReference) throws SQLException, IOException {
KMLDriverFunction kMLDriverFunction = new KMLDriverFunction();
kMLDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressV... | java | public static void writeKML(Connection connection, String fileName, String tableReference) throws SQLException, IOException {
KMLDriverFunction kMLDriverFunction = new KMLDriverFunction();
kMLDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressV... | [
"public",
"static",
"void",
"writeKML",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"KMLDriverFunction",
"kMLDriverFunction",
"=",
"new",
"KMLDriverFunction",
"(",... | This method is used to write a spatial table into a KML file
@param connection
@param fileName
@param tableReference
@throws SQLException
@throws IOException | [
"This",
"method",
"is",
"used",
"to",
"write",
"a",
"spatial",
"table",
"into",
"a",
"KML",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java#L56-L59 |
107,574 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java | EditUtilities.getVertexToSnap | public static GeometryLocation getVertexToSnap(Geometry g, Point p, double tolerance) {
DistanceOp distanceOp = new DistanceOp(g, p);
GeometryLocation snapedPoint = distanceOp.nearestLocations()[0];
if (tolerance == 0 || snapedPoint.getCoordinate().distance(p.getCoordinate()) <= tolerance) {
... | java | public static GeometryLocation getVertexToSnap(Geometry g, Point p, double tolerance) {
DistanceOp distanceOp = new DistanceOp(g, p);
GeometryLocation snapedPoint = distanceOp.nearestLocations()[0];
if (tolerance == 0 || snapedPoint.getCoordinate().distance(p.getCoordinate()) <= tolerance) {
... | [
"public",
"static",
"GeometryLocation",
"getVertexToSnap",
"(",
"Geometry",
"g",
",",
"Point",
"p",
",",
"double",
"tolerance",
")",
"{",
"DistanceOp",
"distanceOp",
"=",
"new",
"DistanceOp",
"(",
"g",
",",
"p",
")",
";",
"GeometryLocation",
"snapedPoint",
"="... | Gets the coordinate of a Geometry that is the nearest of a given Point,
with a distance tolerance.
@param g
@param p
@param tolerance
@return | [
"Gets",
"the",
"coordinate",
"of",
"a",
"Geometry",
"that",
"is",
"the",
"nearest",
"of",
"a",
"given",
"Point",
"with",
"a",
"distance",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java#L44-L52 |
107,575 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java | ST_BoundingCircle.computeBoundingCircle | public static Geometry computeBoundingCircle(Geometry geometry) {
if (geometry == null) {
return null;
}
return new MinimumBoundingCircle(geometry).getCircle();
} | java | public static Geometry computeBoundingCircle(Geometry geometry) {
if (geometry == null) {
return null;
}
return new MinimumBoundingCircle(geometry).getCircle();
} | [
"public",
"static",
"Geometry",
"computeBoundingCircle",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"MinimumBoundingCircle",
"(",
"geometry",
")",
".",
"getCircle",
"(",
... | Computes the bounding circle
@param geometry
@return | [
"Computes",
"the",
"bounding",
"circle"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java#L50-L55 |
107,576 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileWriter.java | DbaseFileWriter.write | public void write(Object[] record) throws IOException, DbaseFileException {
if (record.length != header.getNumFields()) {
throw new DbaseFileException("Wrong number of fields "
+ record.length + " expected " + header.getNumFields());
}
buffer.position(0);
// put the 'not-deleted' marker
buffer.put(... | java | public void write(Object[] record) throws IOException, DbaseFileException {
if (record.length != header.getNumFields()) {
throw new DbaseFileException("Wrong number of fields "
+ record.length + " expected " + header.getNumFields());
}
buffer.position(0);
// put the 'not-deleted' marker
buffer.put(... | [
"public",
"void",
"write",
"(",
"Object",
"[",
"]",
"record",
")",
"throws",
"IOException",
",",
"DbaseFileException",
"{",
"if",
"(",
"record",
".",
"length",
"!=",
"header",
".",
"getNumFields",
"(",
")",
")",
"{",
"throw",
"new",
"DbaseFileException",
"... | Write a single dbase record.
@param record
The entries to write.
@throws java.io.IOException
If IO error occurs.
@throws DbaseFileException
If the entry doesn't comply to the header. | [
"Write",
"a",
"single",
"dbase",
"record",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileWriter.java#L130-L154 |
107,577 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_XMax.java | ST_XMax.getMaxX | public static Double getMaxX(Geometry geom) {
if (geom != null) {
return geom.getEnvelopeInternal().getMaxX();
} else {
return null;
}
} | java | public static Double getMaxX(Geometry geom) {
if (geom != null) {
return geom.getEnvelopeInternal().getMaxX();
} else {
return null;
}
} | [
"public",
"static",
"Double",
"getMaxX",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"return",
"geom",
".",
"getEnvelopeInternal",
"(",
")",
".",
"getMaxX",
"(",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}"... | Returns the maximal x-value of the given geometry.
@param geom Geometry
@return The maximal x-value of the given geometry, or null if the geometry is null. | [
"Returns",
"the",
"maximal",
"x",
"-",
"value",
"of",
"the",
"given",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_XMax.java#L48-L54 |
107,578 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java | DelaunayData.put | public void put(Geometry geom, MODE mode) throws IllegalArgumentException {
gf = geom.getFactory();
convertedInput = null;
// Does not use instanceof here as we must not match for overload of GeometryCollection
int dimension;
if(geom.getClass().getName().equals(GeometryCollection... | java | public void put(Geometry geom, MODE mode) throws IllegalArgumentException {
gf = geom.getFactory();
convertedInput = null;
// Does not use instanceof here as we must not match for overload of GeometryCollection
int dimension;
if(geom.getClass().getName().equals(GeometryCollection... | [
"public",
"void",
"put",
"(",
"Geometry",
"geom",
",",
"MODE",
"mode",
")",
"throws",
"IllegalArgumentException",
"{",
"gf",
"=",
"geom",
".",
"getFactory",
"(",
")",
";",
"convertedInput",
"=",
"null",
";",
"// Does not use instanceof here as we must not match for ... | Put a geometry into the data array. Set true to populate the list of
points and edges, needed for the ContrainedDelaunayTriangulation. Set
false to populate only the list of points. Note the z-value is forced to
O when it's equal to NaN.
@param geom Geometry
@param mode Delaunay mode
@throws IllegalArgumentException | [
"Put",
"a",
"geometry",
"into",
"the",
"data",
"array",
".",
"Set",
"true",
"to",
"populate",
"the",
"list",
"of",
"points",
"and",
"edges",
"needed",
"for",
"the",
"ContrainedDelaunayTriangulation",
".",
"Set",
"false",
"to",
"populate",
"only",
"the",
"lis... | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java#L117-L176 |
107,579 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java | DelaunayData.get3DArea | public double get3DArea(){
if(convertedInput != null) {
List<DelaunayTriangle> delaunayTriangle = convertedInput.getTriangles();
double sum = 0;
for (DelaunayTriangle triangle : delaunayTriangle) {
sum += computeTriangleArea3D(triangle);
... | java | public double get3DArea(){
if(convertedInput != null) {
List<DelaunayTriangle> delaunayTriangle = convertedInput.getTriangles();
double sum = 0;
for (DelaunayTriangle triangle : delaunayTriangle) {
sum += computeTriangleArea3D(triangle);
... | [
"public",
"double",
"get3DArea",
"(",
")",
"{",
"if",
"(",
"convertedInput",
"!=",
"null",
")",
"{",
"List",
"<",
"DelaunayTriangle",
">",
"delaunayTriangle",
"=",
"convertedInput",
".",
"getTriangles",
"(",
")",
";",
"double",
"sum",
"=",
"0",
";",
"for",... | Return the 3D area of all triangles
@return | [
"Return",
"the",
"3D",
"area",
"of",
"all",
"triangles"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java#L204-L215 |
107,580 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java | DelaunayData.computeTriangleArea3D | private double computeTriangleArea3D(DelaunayTriangle triangle) {
TriangulationPoint[] points = triangle.points;
TriangulationPoint p1 = points[0];
TriangulationPoint p2 = points[1];
TriangulationPoint p3 = points[2];
/**
* Uses the formula 1/2 * | u x v |... | java | private double computeTriangleArea3D(DelaunayTriangle triangle) {
TriangulationPoint[] points = triangle.points;
TriangulationPoint p1 = points[0];
TriangulationPoint p2 = points[1];
TriangulationPoint p3 = points[2];
/**
* Uses the formula 1/2 * | u x v |... | [
"private",
"double",
"computeTriangleArea3D",
"(",
"DelaunayTriangle",
"triangle",
")",
"{",
"TriangulationPoint",
"[",
"]",
"points",
"=",
"triangle",
".",
"points",
";",
"TriangulationPoint",
"p1",
"=",
"points",
"[",
"0",
"]",
";",
"TriangulationPoint",
"p2",
... | Computes the 3D area of a triangle.
@param triangle
@return | [
"Computes",
"the",
"3D",
"area",
"of",
"a",
"triangle",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java#L223-L254 |
107,581 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java | DelaunayData.addGeometry | private void addGeometry(Geometry geom) throws IllegalArgumentException {
if(!geom.isValid()) {
throw new IllegalArgumentException("Provided geometry is not valid !");
}
if(geom instanceof GeometryCollection) {
Map<TriangulationPoint, Integer> pts = new HashMap<Triangulat... | java | private void addGeometry(Geometry geom) throws IllegalArgumentException {
if(!geom.isValid()) {
throw new IllegalArgumentException("Provided geometry is not valid !");
}
if(geom instanceof GeometryCollection) {
Map<TriangulationPoint, Integer> pts = new HashMap<Triangulat... | [
"private",
"void",
"addGeometry",
"(",
"Geometry",
"geom",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"geom",
".",
"isValid",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Provided geometry is not valid !\"",
")",
";"... | Add a geometry to the list of points and edges used by the triangulation.
@param geom Any geometry
@throws IllegalArgumentException | [
"Add",
"a",
"geometry",
"to",
"the",
"list",
"of",
"points",
"and",
"edges",
"used",
"by",
"the",
"triangulation",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java#L288-L315 |
107,582 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java | GPXLine.setAttribute | public final void setAttribute(String currentElement, StringBuilder contentBuffer) {
if (currentElement.equalsIgnoreCase(GPXTags.NAME)) {
setName(contentBuffer);
} else if (currentElement.equalsIgnoreCase(GPXTags.CMT)) {
setCmt(contentBuffer);
} else if (currentElement.eq... | java | public final void setAttribute(String currentElement, StringBuilder contentBuffer) {
if (currentElement.equalsIgnoreCase(GPXTags.NAME)) {
setName(contentBuffer);
} else if (currentElement.equalsIgnoreCase(GPXTags.CMT)) {
setCmt(contentBuffer);
} else if (currentElement.eq... | [
"public",
"final",
"void",
"setAttribute",
"(",
"String",
"currentElement",
",",
"StringBuilder",
"contentBuffer",
")",
"{",
"if",
"(",
"currentElement",
".",
"equalsIgnoreCase",
"(",
"GPXTags",
".",
"NAME",
")",
")",
"{",
"setName",
"(",
"contentBuffer",
")",
... | Set an attribute for a line. The String currentElement gives the
information of which attribute have to be setted. The attribute to set is
given by the StringBuilder contentBuffer.
@param currentElement a string presenting the text of the current markup.
@param contentBuffer it contains all informations about the curr... | [
"Set",
"an",
"attribute",
"for",
"a",
"line",
".",
"The",
"String",
"currentElement",
"gives",
"the",
"information",
"of",
"which",
"attribute",
"have",
"to",
"be",
"setted",
".",
"The",
"attribute",
"to",
"set",
"is",
"given",
"by",
"the",
"StringBuilder",
... | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java#L59-L75 |
107,583 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java | GPXLine.setLink | public final void setLink(Attributes attributes) {
lineValues[GpxMetadata.LINELINK_HREF] = attributes.getValue(GPXTags.HREF);
} | java | public final void setLink(Attributes attributes) {
lineValues[GpxMetadata.LINELINK_HREF] = attributes.getValue(GPXTags.HREF);
} | [
"public",
"final",
"void",
"setLink",
"(",
"Attributes",
"attributes",
")",
"{",
"lineValues",
"[",
"GpxMetadata",
".",
"LINELINK_HREF",
"]",
"=",
"attributes",
".",
"getValue",
"(",
"GPXTags",
".",
"HREF",
")",
";",
"}"
] | Set a link to additional information about the route or the track.
@param attributes The current attributes being parsed | [
"Set",
"a",
"link",
"to",
"additional",
"information",
"about",
"the",
"route",
"or",
"the",
"track",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java#L122-L124 |
107,584 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java | GPXLine.setNumber | public final void setNumber(StringBuilder contentBuffer) {
lineValues[GpxMetadata.LINENUMBER] = Integer.parseInt(contentBuffer.toString());
} | java | public final void setNumber(StringBuilder contentBuffer) {
lineValues[GpxMetadata.LINENUMBER] = Integer.parseInt(contentBuffer.toString());
} | [
"public",
"final",
"void",
"setNumber",
"(",
"StringBuilder",
"contentBuffer",
")",
"{",
"lineValues",
"[",
"GpxMetadata",
".",
"LINENUMBER",
"]",
"=",
"Integer",
".",
"parseInt",
"(",
"contentBuffer",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Set the GPS number to additional information about the route or the
track.
@param contentBuffer Contains the information to put in the table | [
"Set",
"the",
"GPS",
"number",
"to",
"additional",
"information",
"about",
"the",
"route",
"or",
"the",
"track",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXLine.java#L149-L151 |
107,585 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Densify.java | ST_Densify.densify | public static Geometry densify(Geometry geometry, double tolerance) {
if(geometry == null){
return null;
}
return Densifier.densify(geometry, tolerance);
} | java | public static Geometry densify(Geometry geometry, double tolerance) {
if(geometry == null){
return null;
}
return Densifier.densify(geometry, tolerance);
} | [
"public",
"static",
"Geometry",
"densify",
"(",
"Geometry",
"geometry",
",",
"double",
"tolerance",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Densifier",
".",
"densify",
"(",
"geometry",
",",
"tolerance... | Densify a geometry using the given distance tolerance.
@param geometry Geometry
@param tolerance Distance tolerance
@return Densified geometry | [
"Densify",
"a",
"geometry",
"using",
"the",
"given",
"distance",
"tolerance",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Densify.java#L51-L56 |
107,586 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java | TableUtilities.parseInputTable | public static TableLocation parseInputTable(Connection connection,
String inputTable) throws SQLException {
return TableLocation.parse(inputTable, JDBCUtilities.isH2DataBase(connection.getMetaData()));
} | java | public static TableLocation parseInputTable(Connection connection,
String inputTable) throws SQLException {
return TableLocation.parse(inputTable, JDBCUtilities.isH2DataBase(connection.getMetaData()));
} | [
"public",
"static",
"TableLocation",
"parseInputTable",
"(",
"Connection",
"connection",
",",
"String",
"inputTable",
")",
"throws",
"SQLException",
"{",
"return",
"TableLocation",
".",
"parse",
"(",
"inputTable",
",",
"JDBCUtilities",
".",
"isH2DataBase",
"(",
"con... | Convert an input table String to a TableLocation
@param connection Connection
@param inputTable Input table
@return corresponding TableLocation
@throws SQLException | [
"Convert",
"an",
"input",
"table",
"String",
"to",
"a",
"TableLocation"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java#L104-L107 |
107,587 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java | TableUtilities.suffixTableLocation | public static TableLocation suffixTableLocation(TableLocation inputTable,
String suffix) {
return new TableLocation(inputTable.getCatalog(), inputTable.getSchema(),
inputTable.getTable() + suffix);
} | java | public static TableLocation suffixTableLocation(TableLocation inputTable,
String suffix) {
return new TableLocation(inputTable.getCatalog(), inputTable.getSchema(),
inputTable.getTable() + suffix);
} | [
"public",
"static",
"TableLocation",
"suffixTableLocation",
"(",
"TableLocation",
"inputTable",
",",
"String",
"suffix",
")",
"{",
"return",
"new",
"TableLocation",
"(",
"inputTable",
".",
"getCatalog",
"(",
")",
",",
"inputTable",
".",
"getSchema",
"(",
")",
",... | Suffix a TableLocation
@param inputTable Input table
@param suffix Suffix
@return suffixed TableLocation | [
"Suffix",
"a",
"TableLocation"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java#L118-L122 |
107,588 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java | TableUtilities.caseIdentifier | public static String caseIdentifier(TableLocation requestedTable, String tableName, boolean isH2) {
return new TableLocation(requestedTable.getCatalog(), requestedTable.getSchema(),
TableLocation.parse(tableName, isH2).getTable()).toString();
} | java | public static String caseIdentifier(TableLocation requestedTable, String tableName, boolean isH2) {
return new TableLocation(requestedTable.getCatalog(), requestedTable.getSchema(),
TableLocation.parse(tableName, isH2).getTable()).toString();
} | [
"public",
"static",
"String",
"caseIdentifier",
"(",
"TableLocation",
"requestedTable",
",",
"String",
"tableName",
",",
"boolean",
"isH2",
")",
"{",
"return",
"new",
"TableLocation",
"(",
"requestedTable",
".",
"getCatalog",
"(",
")",
",",
"requestedTable",
".",
... | Return the table identifier in the best fit depending on database type
@param requestedTable Catalog and schema used
@param tableName Table without quotes
@param isH2 True if H2, false if PostGRES
@return Find table identifier | [
"Return",
"the",
"table",
"identifier",
"in",
"the",
"best",
"fit",
"depending",
"on",
"database",
"type"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java#L133-L136 |
107,589 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateSequenceDimensionFilter.java | CoordinateSequenceDimensionFilter.apply | public static CoordinateSequenceDimensionFilter apply(Geometry geometry) {
CoordinateSequenceDimensionFilter cd = new CoordinateSequenceDimensionFilter();
geometry.apply(cd);
return cd;
} | java | public static CoordinateSequenceDimensionFilter apply(Geometry geometry) {
CoordinateSequenceDimensionFilter cd = new CoordinateSequenceDimensionFilter();
geometry.apply(cd);
return cd;
} | [
"public",
"static",
"CoordinateSequenceDimensionFilter",
"apply",
"(",
"Geometry",
"geometry",
")",
"{",
"CoordinateSequenceDimensionFilter",
"cd",
"=",
"new",
"CoordinateSequenceDimensionFilter",
"(",
")",
";",
"geometry",
".",
"apply",
"(",
"cd",
")",
";",
"return",... | Init CoordinateSequenceDimensionFilter object.
@param geometry Geometry instance
@return CoordinateSequenceDimensionFilter instance | [
"Init",
"CoordinateSequenceDimensionFilter",
"object",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateSequenceDimensionFilter.java#L76-L80 |
107,590 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java | DbaseFileHeader.removeColumn | public int removeColumn(String inFieldName) {
int retCol = -1;
int tempLength = 1;
DbaseField[] tempFieldDescriptors = new DbaseField[fields.length - 1];
for (int i = 0, j = 0; i < fields.length; i++) {
if (!inFieldName.equalsIgnoreCase(fields[i].fieldName.trim())) {
// if this is the last field and we ... | java | public int removeColumn(String inFieldName) {
int retCol = -1;
int tempLength = 1;
DbaseField[] tempFieldDescriptors = new DbaseField[fields.length - 1];
for (int i = 0, j = 0; i < fields.length; i++) {
if (!inFieldName.equalsIgnoreCase(fields[i].fieldName.trim())) {
// if this is the last field and we ... | [
"public",
"int",
"removeColumn",
"(",
"String",
"inFieldName",
")",
"{",
"int",
"retCol",
"=",
"-",
"1",
";",
"int",
"tempLength",
"=",
"1",
";",
"DbaseField",
"[",
"]",
"tempFieldDescriptors",
"=",
"new",
"DbaseField",
"[",
"fields",
".",
"length",
"-",
... | Remove a column from this DbaseFileHeader.
@todo This is really ugly, don't know who wrote it, but it needs fixin...
@param inFieldName
The name of the field, will ignore case and trim.
@return index of the removed column, -1 if no found | [
"Remove",
"a",
"column",
"from",
"this",
"DbaseFileHeader",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java#L319-L348 |
107,591 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java | DbaseFileHeader.setEncoding | public boolean setEncoding(String encoding) {
for(Map.Entry<Byte, String> entry : CODE_PAGE_ENCODING.entrySet()) {
if(entry.getValue().equalsIgnoreCase(encoding)) {
this.fileEncoding = entry.getValue();
return true;
}
}
return false;
} | java | public boolean setEncoding(String encoding) {
for(Map.Entry<Byte, String> entry : CODE_PAGE_ENCODING.entrySet()) {
if(entry.getValue().equalsIgnoreCase(encoding)) {
this.fileEncoding = entry.getValue();
return true;
}
}
return false;
} | [
"public",
"boolean",
"setEncoding",
"(",
"String",
"encoding",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Byte",
",",
"String",
">",
"entry",
":",
"CODE_PAGE_ENCODING",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"entry",
".",
"getValue",
"("... | Set file encoding
@param encoding Encoding to set
@return True if the encoding can be set to DBF file | [
"Set",
"file",
"encoding"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java#L599-L607 |
107,592 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java | DbaseFileHeader.writeHeader | public void writeHeader(WritableByteChannel out) throws IOException {
// take care of the annoying case where no records have been added...
if (headerLength == -1) {
headerLength = MINIMUM_HEADER;
}
ByteBuffer buffer = ByteBuffer.allocateDirect(headerLength);
buffer.order(ByteOrder.LITTLE_ENDIAN);
// wr... | java | public void writeHeader(WritableByteChannel out) throws IOException {
// take care of the annoying case where no records have been added...
if (headerLength == -1) {
headerLength = MINIMUM_HEADER;
}
ByteBuffer buffer = ByteBuffer.allocateDirect(headerLength);
buffer.order(ByteOrder.LITTLE_ENDIAN);
// wr... | [
"public",
"void",
"writeHeader",
"(",
"WritableByteChannel",
"out",
")",
"throws",
"IOException",
"{",
"// take care of the annoying case where no records have been added...",
"if",
"(",
"headerLength",
"==",
"-",
"1",
")",
"{",
"headerLength",
"=",
"MINIMUM_HEADER",
";",... | Write the header data to the DBF file.
@param out
A channel to write to. If you have an OutputStream you can
obtain the correct channel by using
java.nio.Channels.newChannel(OutputStream out).
@throws java.io.IOException
If errors occur. | [
"Write",
"the",
"header",
"data",
"to",
"the",
"DBF",
"file",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java#L628-L704 |
107,593 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_ZMax.java | ST_ZMax.getMaxZ | public static Double getMaxZ(Geometry geom) {
if (geom != null) {
return CoordinateUtils.zMinMax(geom.getCoordinates())[1];
} else {
return null;
}
} | java | public static Double getMaxZ(Geometry geom) {
if (geom != null) {
return CoordinateUtils.zMinMax(geom.getCoordinates())[1];
} else {
return null;
}
} | [
"public",
"static",
"Double",
"getMaxZ",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"!=",
"null",
")",
"{",
"return",
"CoordinateUtils",
".",
"zMinMax",
"(",
"geom",
".",
"getCoordinates",
"(",
")",
")",
"[",
"1",
"]",
";",
"}",
"else",
"{... | Returns the maximal z-value of the given geometry.
@param geom Geometry
@return The maximal z-value of the given geometry, or null if the geometry is null. | [
"Returns",
"the",
"maximal",
"z",
"-",
"value",
"of",
"the",
"given",
"geometry",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_ZMax.java#L49-L55 |
107,594 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java | SHPDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
String regex = ".*(?i)\\b(select|from)\\b.*";
... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
String regex = ".*(?i)\\b(select|from)\\b.*";
... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"fin... | Save a table or a query to a shpfile
@param connection Active connection, do not close this connection.
@param tableReference [[catalog.]schema.]table reference
@param fileName File path to write, if exists it may be replaced
@param progress to display the IO progress
@param encoding File encoding, null will use defaul... | [
"Save",
"a",
"table",
"or",
"a",
"query",
"to",
"a",
"shpfile"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java#L75-L122 |
107,595 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java | SHPDriverFunction.doExport | private int doExport(String tableReference, List<String> spatialFieldNames, ResultSet rs, int recordCount, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
if (spatialFieldNames.isEmpty()) {
throw new SQLException(String.format("The table or the query %s d... | java | private int doExport(String tableReference, List<String> spatialFieldNames, ResultSet rs, int recordCount, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
if (spatialFieldNames.isEmpty()) {
throw new SQLException(String.format("The table or the query %s d... | [
"private",
"int",
"doExport",
"(",
"String",
"tableReference",
",",
"List",
"<",
"String",
">",
"spatialFieldNames",
",",
"ResultSet",
"rs",
",",
"int",
"recordCount",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
... | Method to export a resulset into a shapefile
@param connection Active connection, do not close this connection.
@param selectQuery the select query to export
@param fileName File path to write, if exists it may be replaced
@param progress to display the IO progress
@param encoding File encoding, null will use default e... | [
"Method",
"to",
"export",
"a",
"resulset",
"into",
"a",
"shapefile"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java#L133-L187 |
107,596 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java | SHPDriverFunction.getShapeTypeFromGeometryMetaData | private static ShapeType getShapeTypeFromGeometryMetaData(GeometryMetaData meta) throws SQLException {
ShapeType shapeType;
switch (meta.geometryType) {
case GeometryTypeCodes.MULTILINESTRING:
case GeometryTypeCodes.LINESTRING:
case GeometryTypeCodes.MULTILINESTRINGM:... | java | private static ShapeType getShapeTypeFromGeometryMetaData(GeometryMetaData meta) throws SQLException {
ShapeType shapeType;
switch (meta.geometryType) {
case GeometryTypeCodes.MULTILINESTRING:
case GeometryTypeCodes.LINESTRING:
case GeometryTypeCodes.MULTILINESTRINGM:... | [
"private",
"static",
"ShapeType",
"getShapeTypeFromGeometryMetaData",
"(",
"GeometryMetaData",
"meta",
")",
"throws",
"SQLException",
"{",
"ShapeType",
"shapeType",
";",
"switch",
"(",
"meta",
".",
"geometryType",
")",
"{",
"case",
"GeometryTypeCodes",
".",
"MULTILINE... | Return the shape type supported by the shapefile format
@param meta
@return
@throws SQLException | [
"Return",
"the",
"shape",
"type",
"supported",
"by",
"the",
"shapefile",
"format"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java#L333-L358 |
107,597 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseGeoJson | private void parseGeoJson(ProgressVisitor progress) throws SQLException, IOException {
this.progress = progress.subProcess(100);
init();
if (parseMetadata()) {
GF = new GeometryFactory(new PrecisionModel(), parsedSRID);
parseData();
setGeometryTypeConstraints(... | java | private void parseGeoJson(ProgressVisitor progress) throws SQLException, IOException {
this.progress = progress.subProcess(100);
init();
if (parseMetadata()) {
GF = new GeometryFactory(new PrecisionModel(), parsedSRID);
parseData();
setGeometryTypeConstraints(... | [
"private",
"void",
"parseGeoJson",
"(",
"ProgressVisitor",
"progress",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"this",
".",
"progress",
"=",
"progress",
".",
"subProcess",
"(",
"100",
")",
";",
"init",
"(",
")",
";",
"if",
"(",
"parseMetadata... | Parses a GeoJSON 1.0 file and writes it to a table.
A GeoJSON file is structured as follows:
{ "type": "FeatureCollection", "features": [ { "type": "Feature",
"geometry": {"type": "Point", "coordinates": [102.0, 0.5]}, "properties":
{"prop0": "value0"} }, { "type": "Feature", "geometry": { "type":
"LineString", "coor... | [
"Parses",
"a",
"GeoJSON",
"1",
".",
"0",
"file",
"and",
"writes",
"it",
"to",
"a",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L151-L161 |
107,598 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseMetadata | private boolean parseMetadata() throws SQLException, IOException {
FileInputStream fis = null;
try {
fis = new FileInputStream(fileName);
this.fc = fis.getChannel();
this.fileSize = fc.size();
// Given the file size and ... | java | private boolean parseMetadata() throws SQLException, IOException {
FileInputStream fis = null;
try {
fis = new FileInputStream(fileName);
this.fc = fis.getChannel();
this.fileSize = fc.size();
// Given the file size and ... | [
"private",
"boolean",
"parseMetadata",
"(",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"fileName",
")",
";",
"this",
".",
"fc",
"=",
"fis",
".",... | Parses the all GeoJSON feature to create the PreparedStatement.
@throws SQLException
@throws IOException | [
"Parses",
"the",
"all",
"GeoJSON",
"feature",
"to",
"create",
"the",
"PreparedStatement",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L170-L246 |
107,599 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseFeaturesMetadata | private void parseFeaturesMetadata(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(G... | java | private void parseFeaturesMetadata(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(G... | [
"private",
"void",
"parseFeaturesMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME features",
"// Passes all the properties until \"Feature\" object is found",
"while",
"(",
"!... | Parses the featureCollection to collect the field properties
@param jp
@throws IOException
@throws SQLException | [
"Parses",
"the",
"featureCollection",
"to",
"collect",
"the",
"field",
"properties"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L255-L300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.