ThinkGeo.com    |     Documentation    |     Premium Support

Function to get bounding box of collection of features?

Hello, is there a ThinkGeo function to get the bounding box of a list of features that are not already in a layer?

Thanks,
Dan

Hi @Dan_Weaver,

So, your features are just in a file or database and you want to get the boundingbox there without loading them into a ThinkGeo layer? I don’t believe this is possible. You’ll need to first load the features into some type of Layer or FeatureSource and then use the GetBoundingBox function. But you don’t have to add the layer to your map or style the layer in order to get the bounding box. But you do have to create a layer just so we know where your data is located.

Or, if you have a feature already loaded, you can also GetBoundingBox on the feature itself.

Dan, let me know if I’m misunderstanding your question or if you have more details on the requirement.

Thanks,
John

Basically I have to do some calculations with the bounding box of a group of features long before they get added to a layer, so I was just wondering if there was a function that took in a list of features that I wasn’t seeing. But if not, no problem! Putting them into a “temp” layer like you mentioned will work fine.

Thanks!

Sounds good Dan. Let us know if you need anything else.