Select to view content in your preferred language

Clarification on AGSEnvelopeBuilder's expandByFactor

507
2
Jump to solution
12-19-2023 11:31 AM
CollinSchuricht
New Contributor

Hello! I have been trying to find an answer as to what sort of units the factor parameter of the expandByFactor method in the AGSEnvelopeBuilder. I wish to use a similar method in another area of the codebase and wanted both to have the same "expanding" value consistent throughout. In the documentation I see that the function states that "A factor < 1.0 shrinks the envelope and > 1.0 expands it" but it is never described what sort of units that factor is in. Is it expanded by a set amount of feet? Meters? Percentage?

In my code, my factor value is set to 1.5 but how much does that mean the envelope is actually expanding by?

Thank you in advance for any clarification/answers!

0 Kudos
1 Solution

Accepted Solutions
rolson_esri
Regular Contributor

The factor is a simple multiplication factor. So a factor of 1.5 is 150%.  The amount of distance that correlates to depends on the units of the spatial reference that the envelope is in. So if the envelope's SR is web mercator then it would ultimately be meters. If you use a factor of 1.5, it is not to say a simple value of 1.5 meters is the expansion, but it is saying the expansion is 1.5 times as many meters as it currently is.

View solution in original post

0 Kudos
2 Replies
rolson_esri
Regular Contributor

The factor is a simple multiplication factor. So a factor of 1.5 is 150%.  The amount of distance that correlates to depends on the units of the spatial reference that the envelope is in. So if the envelope's SR is web mercator then it would ultimately be meters. If you use a factor of 1.5, it is not to say a simple value of 1.5 meters is the expansion, but it is saying the expansion is 1.5 times as many meters as it currently is.

0 Kudos
CollinSchuricht
New Contributor

Great, thank you so much for the timely response! That makes sense to me and thank you for clarifying! 😁

0 Kudos