How to get Center Point of the Geometry - PostgreSQL
Postgis - How do I find the center of a number of geographic points?
In the previous post I explained how to Convert Latitude, Longitude to Geography Point in PostGIS, Get Latitude and Longitude from Geometry Point in PostGres.
Now I will explain how to get Center point of the Geometry. We use ST_Centroid function here in PostgreSQL. It Returns the geometric center of a geometry.
Example 1: In Geometry format
select ST_Centroid("sp_geometry") from "Delhi_Zone" where "ZONE" in('West')
Example 2: In Text format
Select ST_Y(ST_Centroid("sp_geometry")) , ST_X(ST_Centroid("sp_geometry")) from "Delhi_Zone" where "ZONE" in('West')
for more visit http://workshops.opengeo.org/postgis-intro/geometry_returning.html
How to get Center Point of the Geometry - PostgreSQL
Reviewed by Ravi Kumar
on
6:18 PM
Rating:

No comments: