Community
Forma Developer Forum
Welcome to Autodesk Forma Developer Forum. Share your knowledge, ask questions, and explore popular Forma API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Geographic extents of the project

2 REPLIES 2
Reply
Message 1 of 3
vkokkinidis
136 Views, 2 Replies

Geographic extents of the project

Hi everyone,

 

I'd like to retrieve the geographic extents, i.e. north/west/south/east coordinates of a project.

 

All I've found so far is the latitude-longitude values returned by forma.project.getGeoLocation();

 

Is there a way to get the length in meters on either side of the project and calculate the extents from that?

 

Thanks!

 

Tags (1)
2 REPLIES 2
Message 2 of 3

Hi!

Thanks for your inquiry. What you ask for is not available right now, but today we have worked on extending the Forma SDK so that it exposes the bounding box (the axis-aligned corner coordinates) of a project. The implementation is not yet finalized but it should be available soon.


Best regards,

Kristoffer
Message 3 of 3
havard.hoiby
in reply to: vkokkinidis

@vkokkinidis: You can do this by getting the triangulation of the terrain and then doing a min/max calculation. 

 

This method is exemplified here: https://github.com/spacemakerai/forma-extensions-samples/blob/main/analyses/terrain-slope/src/compon...

 

You do not have to go through threejs to achieve this. The `Forma.geometry.getTriangles` method returns a list of [x,y,z, ...] points. So picking every third point starting at index 0, and 1 will give you all x, and y values respectively. 

 

These are metric (in meters) offsets from the reference point of the project which is the one you are getting through the `Forma.project.getGeoLocation()` as in the WSG84 coordinate system. 


A quick note here is that the local coordinate system in Forma is the local UTM zone. So if you want to express the bbox in lat long, the best method is to pick each corner in the bounding box and then project them from the local system to WSG84. If you pick only the north east + south west corner and then project, then you will have a skew between the two bounding boxes. 

I think we are still missing exposing an API to get the local coordinate system, but I can add it if you need it now 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report