Thursday 18 May 2017

postgis - Finding units for specific spatial reference system?


I want to use the st_within function to find geometries within a specifi distance. My geometries are both in the same SRID stored in a postgis db. From what I read here: http://postgis.net/docs/ST_DWithin.html "The distance is specified in units defined by the spatial reference system of the geometries."



Where can I find the units of this specific reference system I use (EPSG:2100)?



Answer



Usually, the unit is given for each CRS inside its documentation, so you can find it directly in the CRS information, for example :



UNIT["metre",1,AUTHORITY["EPSG","9001"]


UNIT["degree",0.01745329251994328, AUTHORITY["EPSG","9122"]]



if you don't find the information on your system (, you can check on spatialreference.org


Be aware that sometimes both the unit of the datum (usually degree) and the projection are mentioned, in this case you need to select the unit of the projection.


> PROJCS["GGRS87 / Greek Grid",    <-- this is the name of your coordinate system

> GEOGCS["GGRS87", <-- here starts the desription of the datum
> DATUM["Greek_Geodetic_Reference_System_1987",
> SPHEROID["GRS 1980",6378137,298.257222101,
> AUTHORITY["EPSG","7019"]],
> TOWGS84[-199.87,74.79,246.62,0,0,0,0],
> AUTHORITY["EPSG","6121"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.01745329251994328,
> AUTHORITY["EPSG","9122"]],

> AUTHORITY["EPSG","4121"]],
> <-- Here starts the description of the projection, below you find the unit that will be used for calculation
> UNIT["metre",1, AUTHORITY["EPSG","9001"]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",24],
> PARAMETER["scale_factor",0.9996],
> PARAMETER["false_easting",500000],
> PARAMETER["false_northing",0],
> AUTHORITY["EPSG","2100"],

> AXIS["Easting",EAST],
> AXIS["Northing",NORTH]]

in the proj4text, you'll find the unit of the CRS only



+units=m



when no unit is mentioned, the default is degree.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...