geojson-points
Points → GeoJSON (PostGIS)
Use this skill when you have tabular data (rows or JSON) that include latitude/longitude fields and you need a GeoJSON FeatureCollection for map display.
This skill documents the canonical raw SQL pattern for building GeoJSON from point data in PostGIS.
When to use
- You have rows like
{ id, lat, lng, ... } - You want GeoJSON directly from Postgres
- You want predictable geometry and property handling
Input assumptions
- Latitude and longitude are stored as numeric or castable to numeric
- Longitude comes first in point construction
- Geometry is output in WGS84 (EPSG:4326)
Canonical SQL pattern
From JSON input
More from mmbmf1/geospatial-skills
geojson-postgis
Serialize PostGIS geometry rows into a GeoJSON FeatureCollection for map display (4326, Feature + properties).
21geojson-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).
7postgis-extract-xy
Extract longitude and latitude from PostGIS geometries using ST_X and ST_Y safely.
7