postgis-extract-xy
Extract X / Y from Geometry (ST_X, ST_Y)
Use this skill when you need to extract numeric longitude/latitude values from a PostGIS geometry.
This is common when:
- returning tabular data alongside geometry
- exporting points to CSV
- debugging coordinate issues
- integrating with non-GIS systems
Core rules
ST_XandST_Yonly work on POINT geometries- Units and meaning depend on the geometry’s SRID
- For web use, extract coordinates after transforming to EPSG:4326
Canonical patterns
More from mmbmf1/geospatial-skills
geojson-postgis
Serialize PostGIS geometry rows into a GeoJSON FeatureCollection for map display (4326, Feature + properties).
21geojson-points
Convert JSON rows with latitude/longitude fields into a GeoJSON FeatureCollection using raw PostGIS SQL.
16geojson-wkt
Convert JSON rows with WKT geometry strings into a GeoJSON FeatureCollection using raw PostGIS SQL.
13postgis-distance
Compute numeric distances safely with ST_Distance (geometry vs geography units) and pair with ST_DWithin for performance.
9postgis-dwithin
Distance-based spatial filtering with ST_DWithin, using index-friendly and unit-safe patterns.
8postgis-nearest
Find nearest features efficiently using PostGIS KNN (<->) and distance ordering (with SRID/unit guidance).
7