Hot answers tagged postgis
select * from eating_drinking where ST_GeometryType(way)='ST_Point'
Are you in the USA? If so, determine the State Plane coordinate system that is used by your area, and what the SRID is, for example, What is my State Plane zone in Colorado? I suggest using State Plane as the units are FEET, which can easily be converted to miles. I use SRID/EPSG:2877 So now use an ST_Transform statement which will project your data ...
Just use ST_Extent for the sub-query that selects your airports. The only trick is that in PostgreSQL you must use an alias for the subquery. Look at "a" in the following example which gives the aggregated extent of the 5 first geometries of the table. select ST_AsText(ST_Extent(a.geom)) from (select geom from tableName limit 5) as a;
You could use St_Envelope on all your airports docs ! ST_Envelope — Returns a geometry representing the bounding box of the supplied geometry.
For any geometry the units are determined by the spatial reference system. Which you get for a particular geometry with functions ST_SRID(geom). http://postgis.net/docs/manual-2.1/ST_SRID.html (these numbers are in the spatial_ref_sys table and you have to look at the proj4text to see the units description). For geography type coordinates are always x ...
What you have in PostGIS for that is ST_Snap http://postgis.net/docs/ST_Snap.html This is a four-vertex polygon POLYGON (( 420 420, 420 520, 700 520, 700 420, 420 420 )) This is an adjacent five-vertex polygon that has one vertex in the middle of the common boundary at location (582 420) POLYGON (( 420 420, 582 420, 700 420, 700 320, 420 320, 420 420 )) ...
The fact that there is an SRID number (4326 in your case) coming after the type number needs to be flagged, since SRID's are an optional component of EWKB. The number you are seeing is composed of the type on the bottom byte and the "has an SRID" mask on the upper byte. https://github.com/postgis/postgis/blob/svn-trunk/liblwgeom/liblwgeom.h.in#L84
Currentyly there is a method to filter geometries within some distance in PostGIS that uses spatial index: http://postgis.net/docs/ST_DWithin.html
Only top voted, non community-wiki answers of a minimum length are eligible