-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing property functions #29
Conversation
*/ | ||
public static Double computeCompacity(Geometry geom) { | ||
if (geom != null) { | ||
if (GeometryTypeUtil.isPolygon(geom)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could have used SC_Polygon.isPolygon()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Note 1: PostGIS does not allow ST_3DLength to take a Polygon as a parameter. For this purpose, a PostGIS user must use ST_Perimeter, which was not implemented in GDMS. Note 2: PostGIS also allows MutliLineStrings (for ST_3DLength) and MultiPolygons (for ST_Perimeter), while GDMS only allowed for LineStrings and Polygons.
@ebocher As for ST_CircleCompacity, we could certainly call this ST_CircleIndex. But according to your link (http://www.spatialanalysisonline.com/HTML/?shape.htm), this doesn't seem to be a standardized index. Instead of dividing the circle circumference by the polygon perimeter, the compactness ratio (C) takes the square root of the circle area divided by the polygon area. This is similar, but different. So now the question is which formula we keep (or both), and what name we use (ST_CompactnessRatio for the root of the ratio of areas?). |
Note that the definition given in http://www.spatialanalysisonline.com/HTML/?shape.htm is equivalent to the previous definition (in ST_CircleCompacity).
Before, ST_3DLength was returning 0 for a 2D geometry, which didn't make any sense. Now it returns the same value as ST_Length for 2D geometries. Unit tests added. Fixes orbisgis#29.
Before, ST_3DLength was returning 0 for a 2D geometry, which didn't make any sense. Now it returns the same value as ST_Length for 2D geometries. Unit tests added. Fixes orbisgis#33.
OK ready to merge. |
Add missing property functions
Here we add
Note: PostGIS says ST_CoordDim is SFS, but it doesn't seem to be.