From: Regina Obe Date: Sun, 20 Mar 2016 06:33:10 +0000 (+0000) Subject: upport ST_AsEncodedPolyLine google example, alphabetize entries X-Git-Tag: 2.3.0beta1~169 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93e0273309cf6bc7b843e7ebd6098621d1d52e65;p=postgis upport ST_AsEncodedPolyLine google example, alphabetize entries git-svn-id: http://svn.osgeo.org/postgis/trunk@14792 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_output.xml b/doc/reference_output.xml index c477a2e4d..9aa58d0ad 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -106,6 +106,69 @@ + + + + ST_AsEncodedPolyline + Returns an Encoded Polyline from a LineString geometry. + + + + + + text ST_AsEncodedPolyline + geometry geom + integer precision=5 + + + + + + Description + + Returns the geometry as an Encoded Polyline. This is a format very useful if you are using google maps + + + Availability: 2.2.0 + + + + Examples + Basic + + SELECT ST_AsEncodedPolyline(GeomFromEWKT('SRID=4326;LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252)')); + --result-- + |_p~iF~ps|U_ulLnnqC_mqNvxq`@ + + + Use in conjunction with geography linestring and geography segmentize, and put on google maps + -- the SQL for Boston to San Francisco, segments every 100 KM + SELECT ST_AsEncodedPolyline( + ST_Segmentize( + ST_GeogFromText('LINESTRING(-71.0519 42.4935,-122.4483 37.64)'), + 100000)::geometry) As encodedFlightPath; + + + javascript will look something like this where $ variable you replace with query result + + + ]]> + + + + See Also + , + + + ST_AsEWKB @@ -705,6 +768,101 @@ SELECT ST_AsGML(3, ST_GeomFromEWKT('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 , + + + + ST_AsLatLonText + Return the Degrees, Minutes, Seconds representation of the given point. + + + + + + text ST_AsLatLonText + geometry pt + text format='' + + + + + + Description + + Returns the Degrees, Minutes, Seconds representation of the point. + + + It is assumed the point is in a lat/lon projection. The X (lon) and Y (lat) coordinates are normalized in the output + to the "normal" range (-180 to +180 for lon, -90 to +90 for lat). + + + The text parameter is a format string containing the format for the resulting text, similar to a date format string. Valid tokens + are "D" for degrees, "M" for minutes, "S" for seconds, and "C" for cardinal direction (NSEW). DMS tokens may be repeated to indicate + desired width and precision ("SSS.SSSS" means " 1.0023"). + + + "M", "S", and "C" are optional. If "C" is omitted, degrees are + shown with a "-" sign if south or west. If "S" is omitted, minutes will be shown as decimal with as many digits of precision + as you specify. If "M" is also omitted, degrees are shown as decimal with as many digits precision as you specify. + + + If the format string is omitted (or zero-length) a default format will be used. + + + + + Availability: 2.0 + + + + + Examples +Default format. + +SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)')); + st_aslatlontext +---------------------------- + 2°19'29.928"S 3°14'3.243"W + +Providing a format (same as the default). + +SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D°M''S.SSS"C')); + st_aslatlontext +---------------------------- + 2°19'29.928"S 3°14'3.243"W + +Characters other than D, M, S, C and . are just passed through. + +SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D degrees, M minutes, S seconds to the C')); + st_aslatlontext +-------------------------------------------------------------------------------------- + 2 degrees, 19 minutes, 30 seconds to the S 3 degrees, 14 minutes, 3 seconds to the W + +Signed degrees instead of cardinal directions. + +SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D°M''S.SSS"')); + st_aslatlontext +---------------------------- + -2°19'29.928" -3°14'3.243" + +Decimal degrees. + +SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D.DDDD degrees C')); + st_aslatlontext +----------------------------------- + 2.3250 degrees S 3.2342 degrees W + +Excessively large values are normalized. + +SELECT (ST_AsLatLonText('POINT (-302.2342342 -792.32498)')); + st_aslatlontext +------------------------------- + 72°19'29.928"S 57°45'56.757"E + + + + + + ST_AsSVG @@ -758,6 +916,139 @@ SELECT ST_AsGML(3, ST_GeomFromEWKT('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 + + + ST_AsText + Return the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata. + + + + + + text ST_AsText + geometry g1 + + + text ST_AsText + geography g1 + + + + + + Description + + Returns the Well-Known Text representation of the geometry/geography. + + + The WKT spec does not include the SRID. To get the SRID as part of the data, use the non-standard + PostGIS + + + WKT format does not maintain precision so to prevent floating truncation, use ST_AsBinary or ST_AsEWKB format for transport. + + + ST_AsText is the reverse of . Use to convert to a postgis geometry from ST_AsText representation. + + + Availability: 1.5 - support for geography was introduced. + &sfs_compliant; s2.1.1.1 + &sqlmm_compliant; SQL-MM 3: 5.1.25 + &curve_support; + + + + + Examples + + SELECT ST_AsText('01030000000100000005000000000000000000 +000000000000000000000000000000000000000000000000 +F03F000000000000F03F000000000000F03F000000000000F03 +F000000000000000000000000000000000000000000000000'); + + st_astext +-------------------------------- + POLYGON((0 0,0 1,1 1,1 0,0 0)) +(1 row) + + + + + See Also + + , , , + + + + + + ST_AsTWKB + Returns the geometry as TWKB, aka "Tiny Well-Known Binary" + + + + + + bytea ST_AsTWKB + geometry g1 + integer decimaldigits_xy=0 + integer decimaldigits_z=0 + integer decimaldigits_m=0 + boolean include_sizes=false + boolean include_bounding boxes=false + + + bytea ST_AsTWKB + geometry[] geometries + bigint[] unique_ids + integer decimaldigits_xy=0 + integer decimaldigits_z=0 + integer decimaldigits_m=0 + boolean include_sizes=false + boolean include_bounding_boxes=false + + + + + Description + Returns the geometry in TWKB (Tiny Well-Known Binary) format. TWKB is a compressed binary format with a focus on minimizing the size of the output. + The decimal digits parameters control how much precision is stored in the output. By default, values are rounded to the nearest unit before encoding. If you want to transfer more precision, increase the number. For example, a value of 1 implies that the first digit to the right of the decimal point will be preserved. + The sizes and bounding boxes parameters control whether optional information about the encoded length of the object and the bounds of the object are included in the output. By default they are not. Do not turn them on unless your client software has a use for them, as they just use up space (and saving space is the point of TWKB). + The array-input form of the function is used to convert a collection of geometries and unique identifiers into a TWKB collection that preserves the identifiers. This is useful for clients that expect to unpack a collection and then access further information about the objects inside. You can create the arrays using the array_agg function. The other parameters operate the same as for the simple form of the function. + + The format specification is available online at https://github.com/TWKB/Specification, and code for building a JavaScript client can be found at https://github.com/TWKB/twkb.js. + + + Availability: 2.2.0 + + + + + Examples + +SELECT ST_AsTWKB('LINESTRING(1 1,5 5)'::geometry); + st_astwkb +-------------------------------------------- +\x02000202020808 + + +To create an aggregate TWKB object including identifiers aggregate the desired geometries and objects first, using "array_agg()", then call the appropriate TWKB function. + + +SELECT ST_AsTWKB(array_agg(geom), array_agg(gid)) FROM mytable; + st_astwkb +-------------------------------------------- +\x040402020400000202 + + + + + + See Also + , , , + + + ST_AsX3D @@ -1009,273 +1300,4 @@ SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326),5); - - - ST_AsText - Return the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata. - - - - - - text ST_AsText - geometry g1 - - - text ST_AsText - geography g1 - - - - - - Description - - Returns the Well-Known Text representation of the geometry/geography. - - - The WKT spec does not include the SRID. To get the SRID as part of the data, use the non-standard - PostGIS - - - WKT format does not maintain precision so to prevent floating truncation, use ST_AsBinary or ST_AsEWKB format for transport. - - - ST_AsText is the reverse of . Use to convert to a postgis geometry from ST_AsText representation. - - - Availability: 1.5 - support for geography was introduced. - &sfs_compliant; s2.1.1.1 - &sqlmm_compliant; SQL-MM 3: 5.1.25 - &curve_support; - - - - - Examples - - SELECT ST_AsText('01030000000100000005000000000000000000 -000000000000000000000000000000000000000000000000 -F03F000000000000F03F000000000000F03F000000000000F03 -F000000000000000000000000000000000000000000000000'); - - st_astext --------------------------------- - POLYGON((0 0,0 1,1 1,1 0,0 0)) -(1 row) - - - - - See Also - - , , , - - - - - - - ST_AsLatLonText - Return the Degrees, Minutes, Seconds representation of the given point. - - - - - - text ST_AsLatLonText - geometry pt - text format='' - - - - - - Description - - Returns the Degrees, Minutes, Seconds representation of the point. - - - It is assumed the point is in a lat/lon projection. The X (lon) and Y (lat) coordinates are normalized in the output - to the "normal" range (-180 to +180 for lon, -90 to +90 for lat). - - - The text parameter is a format string containing the format for the resulting text, similar to a date format string. Valid tokens - are "D" for degrees, "M" for minutes, "S" for seconds, and "C" for cardinal direction (NSEW). DMS tokens may be repeated to indicate - desired width and precision ("SSS.SSSS" means " 1.0023"). - - - "M", "S", and "C" are optional. If "C" is omitted, degrees are - shown with a "-" sign if south or west. If "S" is omitted, minutes will be shown as decimal with as many digits of precision - as you specify. If "M" is also omitted, degrees are shown as decimal with as many digits precision as you specify. - - - If the format string is omitted (or zero-length) a default format will be used. - - - - - Availability: 2.0 - - - - - Examples -Default format. - -SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)')); - st_aslatlontext ----------------------------- - 2°19'29.928"S 3°14'3.243"W - -Providing a format (same as the default). - -SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D°M''S.SSS"C')); - st_aslatlontext ----------------------------- - 2°19'29.928"S 3°14'3.243"W - -Characters other than D, M, S, C and . are just passed through. - -SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D degrees, M minutes, S seconds to the C')); - st_aslatlontext --------------------------------------------------------------------------------------- - 2 degrees, 19 minutes, 30 seconds to the S 3 degrees, 14 minutes, 3 seconds to the W - -Signed degrees instead of cardinal directions. - -SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D°M''S.SSS"')); - st_aslatlontext ----------------------------- - -2°19'29.928" -3°14'3.243" - -Decimal degrees. - -SELECT (ST_AsLatLonText('POINT (-3.2342342 -2.32498)', 'D.DDDD degrees C')); - st_aslatlontext ------------------------------------ - 2.3250 degrees S 3.2342 degrees W - -Excessively large values are normalized. - -SELECT (ST_AsLatLonText('POINT (-302.2342342 -792.32498)')); - st_aslatlontext -------------------------------- - 72°19'29.928"S 57°45'56.757"E - - - - - - - - - ST_AsTWKB - Returns the geometry as TWKB, aka "Tiny Well-Known Binary" - - - - - - bytea ST_AsTWKB - geometry g1 - integer decimaldigits_xy=0 - integer decimaldigits_z=0 - integer decimaldigits_m=0 - boolean include_sizes=false - boolean include_bounding boxes=false - - - bytea ST_AsTWKB - geometry[] geometries - bigint[] unique_ids - integer decimaldigits_xy=0 - integer decimaldigits_z=0 - integer decimaldigits_m=0 - boolean include_sizes=false - boolean include_bounding_boxes=false - - - - - Description - Returns the geometry in TWKB (Tiny Well-Known Binary) format. TWKB is a compressed binary format with a focus on minimizing the size of the output. - The decimal digits parameters control how much precision is stored in the output. By default, values are rounded to the nearest unit before encoding. If you want to transfer more precision, increase the number. For example, a value of 1 implies that the first digit to the right of the decimal point will be preserved. - The sizes and bounding boxes parameters control whether optional information about the encoded length of the object and the bounds of the object are included in the output. By default they are not. Do not turn them on unless your client software has a use for them, as they just use up space (and saving space is the point of TWKB). - The array-input form of the function is used to convert a collection of geometries and unique identifiers into a TWKB collection that preserves the identifiers. This is useful for clients that expect to unpack a collection and then access further information about the objects inside. You can create the arrays using the array_agg function. The other parameters operate the same as for the simple form of the function. - - The format specification is available online at https://github.com/TWKB/Specification, and code for building a JavaScript client can be found at https://github.com/TWKB/twkb.js. - - - Availability: 2.2.0 - - - - - Examples - -SELECT ST_AsTWKB('LINESTRING(1 1,5 5)'::geometry); - st_astwkb --------------------------------------------- -\x02000202020808 - - -To create an aggregate TWKB object including identifiers aggregate the desired geometries and objects first, using "array_agg()", then call the appropriate TWKB function. - - -SELECT ST_AsTWKB(array_agg(geom), array_agg(gid)) FROM mytable; - st_astwkb --------------------------------------------- -\x040402020400000202 - - - - - - See Also - , , , - - - - - - - - ST_AsEncodedPolyline - Returns an Encoded Polyline from a LineString geometry. - - - - - - text ST_AsEncodedPolyline - geometry geom - integer precision=5 - - - - - - Description - - Returns the geometry as an Encoded Polyline. - - - Availability: 2.2.0 - - - - Examples - -ST_AsEncodedPolyline(GeomFromEWKT('SRID=4326;LINESTRING(-120.2 38.5,-120.95 40.7,-126.453 43.252)')); ---result-- -|_p~iF~ps|U_ulLnnqC_mqNvxq`@ - - - - - See Also - - -