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: 

Terrain BBox differs from MapBox Image?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
iklimis
372 Views, 4 Replies

Terrain BBox differs from MapBox Image?

Hey Forma Team
hope you all are well and doing great

Been bumping into some issues regarding the proper fitting-scaling of satellite imageries 

After some digging around into how you guys get the image I noticed (as mentioned in my other post) that you send the terrain Bbox (which after some cross checking is the exact same we use to get imageries from providers) 

For example lets say an area around Sphere Las Vegas you use this data:

iklimis_0-1712305867585.png

After checking this area bbox  live into a map i see it corresponds to this imagery and I am using the top left corner area for comparing 
After some quick checking you see on the right the Final Mapbox imagery that you use to create the terrain texture has an extra space on the top - that ends up being absolutely correct with the real terrain 

And my question is: do you do some extra modifications in order to get the proper imagery ? Meaning how do you end up with than image that has an extra space at the top using a smaller bbox?

once again your insight are highly appreciated
Giannis

sample-imagery.jpg










4 REPLIES 4
Message 2 of 5

Hi Giannis,

 

I am assuming that this is a follow-up from this forum post: https://forums.autodesk.com/t5/forma-developer-forum/how-do-i-properly-fit-an-image-as-a-terrain-tex..., just wanted to link it here so people also can read there for more context.


I can give you an overview of the reason for this, and how our approach looks like. We plan to offer API support for the processing as part our APIs so third parties would not need to do these steps. Unfortunately I cannot provide details on when that will be available.

In short, this all has to do with projections. Forma uses UTM-based coordinate system as its native one. From Forma, images are ordered using an axis-aligned bbox as input. Those axes follow the north-south and east-west directions in the local projection.

If you have an image source that uses lat-lon coordinates when selecting/querying data, you need to convert the original UTM bbox corner coordinates to that coordinate system. When you have done so, you will see that the new bbox is not axis-aligned in the lat-lon system. It will generally be rotated (depending on the east-west distance to the center meridian in the UTM system) and also sheared (depending on latitude). This will mean that if you use this polygon as input to the image service, whenever you transform the resulting image back to UTM you will get gaps in the corners (due to the rotation).

 

To avoid those gaps, we extend the polygon and make a new, axis-aligned bbox in the lat-lon-system, and then order the image using that as input.

Afterwards, we warp the resulting image back to the original UTM projection (doing the inverse rotation and shearing), and crop it so it matches the original bbox contained in the image request from Forma.


Best regards,

Kristoffer

Message 3 of 5
iklimis
in reply to: iklimis

Hi @kristoffer.dyrkorn,

Thank you for your answer. It helped me understand the processing along with some of the mechanics that take place.
One more question:
I understand  that because of the conversion from UTM coordinate system to another there will be a rotation and a shearing effect. Also I gather that the shearing would be larger as you go near the poles.

How do you decide how much expansion will you give to the BBox? 
Do you have a math type that depending on the latitude that gives the BBox some extra meters? or give the same value to all and crop it later?

Thanks again for all the help
Giannis

Message 4 of 5

 

Hi Giannis,

 

The expansion is given by creating an axis-aligned bbox in the lat-lon-coordinate system. Essentially: Transform each corner point of the UTM bbox to lat-lon coordinates, an then take the min and max of all points in lat-lon-coordinates, and then create a bbox out of those values, and send it to the image service. 

 

Here is an illustration that might help:

Screenshot 2024-04-08 at 10.05.01.png

Best regards,

 

Kristoffer

Message 5 of 5
iklimis
in reply to: iklimis

@kristoffer.dyrkorn 

Thank you greatly, I tried the logic you suggested and got the correct results(for the first time🙂). The image shows correctly and with the right size inside Forma.
 
Best regards,
Giannis

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

Post to forums  

Autodesk Design & Make Report