Skip to main content
Archived

Dynamic Bounding Box for Spatial Index for Geometry Data on MSSQL_SPATIAL

Related products:FME Form
  • December 11, 2017
  • 2 replies
  • 62 views

mattias
Contributor
Forum|alt.badge.img+3

I'm currently using the "SQL To Run After Write" option to specify a script for creating a spatial index based on the bounding box of the features written.

It uses e.g. "geometry::UnionAggregate([SpatialColumn]).STEnvelope().STPointN().STX" to get the coordinates of the envelope of all features in the newly written table.

Why not have the MSSQL_SPATIAL writer do this automatically using a third spatial index option for geometry data?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

fmelizard
Safer
Forum|alt.badge.img+22
  • Safer
  • December 17, 2017

Hi @mattias, under the Table Creation Parameters in the Writer Feature Type, you can set a bounding box for the geometry if the spatial index type is set to "Auto". Are you using your method in conjunction with another index being created?

'


mattias
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • February 8, 2018

Hello @TiaAtSafe!

I'm only generating that one index (except the primary key).

 

 

I started out trying to use the "Spatial Index Type: Auto" method, but as I understand it that method requires a bounding box to be specified before execution time for geometry data. Since the index seems to be created at the same time as the table is created (when the first feature arrives to the writer), my solution for generating a dynamic bounding box would have been to use a BoundingBoxAccumulator + FeatureHolder and then extracting the coordinates of the bounding box feature to use for the spatial index. However, the min-max values can only be specified as User Parameters, not as attributes. I've not learned of any way to manipulate User Parameters at execution time.

 

 

I guess I might be missing something here, how can I get the extent of the Spatial Index to use the extent of the incoming features without knowing the extent before execution time?