Skip to content
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

Merged
merged 12 commits into from
Nov 21, 2013
Merged

Conversation

agouge
Copy link
Contributor

@agouge agouge commented Nov 12, 2013

Here we add

  • ST_3DLength
  • ST_CoordDim
  • ST_CompactnessRatio

Note: PostGIS says ST_CoordDim is SFS, but it doesn't seem to be.

*/
public static Double computeCompacity(Geometry geom) {
if (geom != null) {
if (GeometryTypeUtil.isPolygon(geom)) {
Copy link
Member

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()

Copy link
Contributor Author

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.
@agouge
Copy link
Contributor Author

agouge commented Nov 20, 2013

@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?).

agouge added a commit to agouge/H2GIS that referenced this pull request Nov 21, 2013
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.
@agouge
Copy link
Contributor Author

agouge commented Nov 21, 2013

OK ready to merge.

nicolas-f added a commit that referenced this pull request Nov 21, 2013
Add missing property functions
@nicolas-f nicolas-f merged commit e76a054 into orbisgis:master Nov 21, 2013
@agouge agouge deleted the property-fns branch November 21, 2013 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants