Is there an option in PostGIS (in query or table option) to set the return type of a Geometry?
I'm using this query:
select * from "locations" where "locations"."id" = 2 limit 1
And that will return
2;"My Home";"My Address";"0101000020E6100000EC14AB0661855EC010CF126404B64240"
But I want to default return the geometry as JSON, without naming the parameters, I mean, I don't want to do:
select id, name, address, ST_AsGeoJSON (location) from "locations" where "locations"."id" = 2 limit 1
I just want to continue using select *
and returning location
as GeoJSON by default. Is this possible?