Skip to content
Permalink
Browse files

geom_to_wkt returns a string

  • Loading branch information
DelazJ authored and nyalldawson committed Aug 31, 2020
1 parent ac5884f commit 13573d2b2956a0bd6ae8140f8228ed2485808b9d
@@ -4,6 +4,6 @@
"groups": ["GeometryGroup"],
"description": "Returns a closed line string of the input line string by appending the first point to the end of the line, if it is not already closed. If the geometry is not a line string or multi line string then the result will be NULL.",
"arguments": [ {"arg":"geometry","description":"a line string geometry"}],
"examples": [ { "expression":"geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1)')))", "returns":"LineString (0 0, 1 0, 1 1, 0 0)"},
{ "expression":"geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1, 0 0)')))", "returns":"LineString (0 0, 1 0, 1 1, 0 0)"}]
"examples": [ { "expression":"geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1)')))", "returns":"'LineString (0 0, 1 0, 1 1, 0 0)'"},
{ "expression":"geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1, 0 0)')))", "returns":"'LineString (0 0, 1 0, 1 1, 0 0)'"}]
}
@@ -10,7 +10,7 @@
"examples": [
{
"expression":"geom_to_wkt(closest_point(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))",
"returns":"Point(73.0769 115.384)"
"returns":"'Point(73.0769 115.384)'"
}
]
}
@@ -5,8 +5,8 @@
"description": "Returns the combination of two geometries.",
"arguments": [ {"arg":"geometry1","description":"a geometry"},
{"arg":"geometry2","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )", "returns":"MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))"},
{ "expression":"geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 6 6, 2 1)' ) ) )", "returns":"LINESTRING(3 3, 4 4, 6 6, 2 1)"}
"examples": [ { "expression":"geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )", "returns":"'MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))'"},
{ "expression":"geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 6 6, 2 1)' ) ) )", "returns":"'LINESTRING(3 3, 4 4, 6 6, 2 1)'"}
]
}

@@ -4,6 +4,6 @@
"groups": ["GeometryGroup"],
"description": "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.",
"arguments": [ {"arg":"geometry","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt( convex_hull( geom_from_wkt( 'LINESTRING(3 3, 4 4, 4 10)' ) ) )", "returns":"POLYGON((3 3,4 10,4 4,3 3))"}
"examples": [ { "expression":"geom_to_wkt( convex_hull( geom_from_wkt( 'LINESTRING(3 3, 4 4, 4 10)' ) ) )", "returns":"'POLYGON((3 3, 4 10, 4 4, 3 3))'"}
]
}
@@ -5,5 +5,5 @@
"description": "Returns a geometry that represents that part of geometry1 that does not intersect with geometry2.",
"arguments": [ {"arg":"geometry1","description":"a geometry"},
{"arg":"geometry2","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt( difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )", "returns":"LINESTRING(4 4, 5 5)"} ]
"examples": [ { "expression":"geom_to_wkt( difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )", "returns":"'LINESTRING(4 4, 5 5)'"} ]
}
@@ -6,6 +6,6 @@
"arguments": [ {"arg":"geometry","description":"a (multi)linestring geometry"},
{"arg":"start_distance","description":"distance to extend the start of the line"},
{"arg":"end_distance","description":"distance to extend the end of the line."}],
"examples": [ { "expression":"geom_to_wkt(extend(geom_from_wkt('LineString(0 0, 1 0, 1 1)'),1,2))", "returns":"LineString (-1 0, 1 0, 1 3)"}]
"examples": [ { "expression":"geom_to_wkt(extend(geom_from_wkt('LineString(0 0, 1 0, 1 1)'),1,2))", "returns":"'LineString (-1 0, 1 0, 1 3)'"}]
}

@@ -4,6 +4,6 @@
"groups": ["GeometryGroup"],
"description": "Returns a copy of the geometry with the x and y coordinates swapped. Useful for repairing geometries which have had their latitude and longitude values reversed.",
"arguments": [ {"arg":"geometry","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt(flip_coordinates(make_point(1, 2)))", "returns":"Point (2 1)"}
"examples": [ { "expression":"geom_to_wkt(flip_coordinates(make_point(1, 2)))", "returns":"'Point (2 1)'"}
]
}
@@ -4,6 +4,6 @@
"groups": ["GeometryGroup"],
"description": "Forces a geometry to respect the Right-Hand-Rule, in which the area that is bounded by a polygon is to the right of the boundary. In particular, the exterior ring is oriented in a clockwise direction and the interior rings in a counter-clockwise direction.",
"arguments": [ {"arg":"geometry","description":"a geometry. Any non-polygon geometries are returned unchanged."}],
"examples": [ { "expression":"geom_to_wkt(force_rhr(geometry:=geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))')))", "returns":"Polygon ((-1 -1, 0 2, 4 2, 4 0, -1 -1))"}]
"examples": [ { "expression":"geom_to_wkt(force_rhr(geometry:=geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))')))", "returns":"'Polygon ((-1 -1, 0 2, 4 2, 4 0, -1 -1))'"}]
}

@@ -6,7 +6,7 @@
"arguments": [ {"arg":"geometry","description":"a geometry"},
{"arg":"precision","description":"numeric precision", "optional":true, "default":"8"}],
"examples": [ { "expression":"geom_to_wkt( make_point(6, 50) )", "returns":"'POINT(6 50)'"},
{ "expression":"geom_to_wkt(centroid(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')))", "returns":"POINT(0 0.66666667)"},
{ "expression":"geom_to_wkt(centroid(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')), 2)", "returns":"POINT(0 0.67)"}
{ "expression":"geom_to_wkt(centroid(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')))", "returns":"'POINT(0 0.66666667)'"},
{ "expression":"geom_to_wkt(centroid(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')), 2)", "returns":"'POINT(0 0.67)'"}
]
}
@@ -5,5 +5,5 @@
"description": "Returns a geometry that represents the shared portion of two geometries.",
"arguments": [ {"arg":"geometry1","description":"a geometry"},
{"arg":"geometry2","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt( intersection( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )", "returns":"LINESTRING(3 3, 4 4)"} ]
"examples": [ { "expression":"geom_to_wkt( intersection( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )", "returns":"'LINESTRING(3 3, 4 4)'"} ]
}
@@ -7,7 +7,7 @@
{"arg":"geometry","description":"a geometry"},
{"arg":"segments", "optional": true, "default": "36", "description": "optional argument for polygon segmentation. By default this value is 36"}],
"examples": [
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))"}
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )", "returns":"'Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))'"},
{ "expression":"geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )", "returns":"'Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))'"}
]
}
@@ -10,6 +10,6 @@
{"arg":"elevation","description":"angle of inclination in radians", "optional":true}
],
"examples": [
{ "expression":"geom_to_wkt(project(make_point(1, 2), 3, radians(270)))", "returns":"Point(-2, 2)"}
{ "expression":"geom_to_wkt(project(make_point(1, 2), 3, radians(270)))", "returns":"'Point(-2, 2)'"}
]
}
@@ -10,7 +10,7 @@
"examples": [
{
"expression":"geom_to_wkt(shortest_line(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))",
"returns":"LineString(73.0769 115.384, 100 100)"
"returns":"'LineString(73.0769 115.384, 100 100)'"
}
]
}
@@ -5,5 +5,5 @@
"description": "Returns a geometry that represents the portions of two geometries that do not intersect.",
"arguments": [ {"arg":"geometry1","description":"a geometry"},
{"arg":"geometry2","description":"a geometry"}],
"examples": [ { "expression":"geom_to_wkt( sym_difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 8 8)' ) ) )", "returns":"LINESTRING(5 5, 8 8)"} ]
"examples": [ { "expression":"geom_to_wkt( sym_difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 8 8)' ) ) )", "returns":"'LINESTRING(5 5, 8 8)'"} ]
}

0 comments on commit 13573d2

Please sign in to comment.
You can’t perform that action at this time.