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 triangle analysis function #75

Merged
merged 5 commits into from
Dec 16, 2013
Merged

Conversation

ebocher
Copy link
Member

@ebocher ebocher commented Dec 13, 2013

This PR adds 3 new functions for triangle.

ST_TriangleSlope(GEOMETRY); 

Compute the slope of a triangle in degrees

ST_TriangleAspect(GEOMETRY); 

Compute the aspect of a triangle Aspect represents the main slope direction angle compared to the north direction.

ST_TriangleDirection(GEOMETRY); 

Compute the main slope direction on a triangle represented by a linesegment

See #46.

@ebocher ebocher mentioned this pull request Dec 13, 2013

/**
* This function is used to computed the aspect of a triangle Aspect represents
* the main slope direction angle compared to the north direction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to compute" ...
missing '.' before 'Aspect'

Please see all my javadoc comments in orbisgis/orbisgis#556.

import org.jdelaunay.delaunay.geometries.DTriangle;

/**
* This function is used to compute the aspect of a triangle aspect represents
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a run-on sentence. You need a '.' after triangle.

+ "(ST_GeomFromText('POLYGON ((0 0 0, 4 0 0, 2 3 9, 0 0 0))'));");
ResultSet rs = st.executeQuery("SELECT ST_TriangleDirection(the_geom) FROM input_table;");
rs.next();
assertTrue(((Geometry)rs.getObject(1)).equals(WKT_READER.read("LINESTRING(2 1 3, 2 0 0)")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a comment, nothing to change. You can do:

assertEquals("LINESTRING(2 1 3, 2 0 0)", rs.getString(1))

agouge added a commit that referenced this pull request Dec 16, 2013
Add triangle analysis functions

This PR adds 3 new functions for triangle.

```mysql
ST_TriangleSlope(GEOMETRY); 
```
Compute the slope of a triangle in degrees

```mysql
ST_TriangleAspect(GEOMETRY); 
```
Compute the aspect of a triangle Aspect represents the main slope direction angle compared to the north direction.

```mysql
ST_TriangleDirection(GEOMETRY); 
```
Compute the main slope direction on a triangle represented by a linesegment

See #46.
@agouge agouge merged commit c34693f into orbisgis:master Dec 16, 2013
@ebocher ebocher deleted the feature/tin_analysis branch April 11, 2014 08:24
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

3 participants