Skip to main content
Typos.
Source Link

If youyour polygon is raster, digitize it.

Once youyour polygon is really a polygon :), a first solution lies, like @WhiteboxDev said, it's the straight skeleton, but it has the problem that, besides the centerline you want, it also returnreturns a lot of segments radiating from that line to the border of your polygon. But if you have PostGIS 2.2+, you can use ST_ApproximateMedialAxis() instead, which is what you want.

If you polygon is raster, digitize it.

Once you polygon is really a polygon :), a first solution lies, like @WhiteboxDev said, it's the straight skeleton, but it has the problem that, besides the centerline you want, it also return a lot of segments radiating from that line to the border of your polygon. But if you have PostGIS 2.2+, you can use ST_ApproximateMedialAxis() instead, which is what you want.

If your polygon is raster, digitize it.

Once your polygon is really a polygon :), a first solution lies, like @WhiteboxDev said, it's the straight skeleton, but it has the problem that, besides the centerline you want, it also returns a lot of segments radiating from that line to the border of your polygon. But if you have PostGIS 2.2+, you can use ST_ApproximateMedialAxis() instead, which is what you want.

Source Link

If you polygon is raster, digitize it.

Once you polygon is really a polygon :), a first solution lies, like @WhiteboxDev said, it's the straight skeleton, but it has the problem that, besides the centerline you want, it also return a lot of segments radiating from that line to the border of your polygon. But if you have PostGIS 2.2+, you can use ST_ApproximateMedialAxis() instead, which is what you want.