Subscribe to this thread
Home - General / All posts - Copy Drawing to SQL Server - No Bounding Box in Spatial Index
BerndD

148 post(s)
#08-Jan-20 15:02

As of build 9.0.168.6 the following should work:

Copying and pasting drawings to SQL Server and similar databases preserves the original bounding box of the spatial index, if it exists, or sets it to the bounding box of the data set.

I copied a table with 500k and an rtree index to a SQL Server 2012 database and thebounding box in the spatial index properties showed this:

X-min = 0

Y-min = 0

X-max = 1

Y-max = 1

Then I did the same with a one polygon drawing and it worked.

Any ideas what went wrong?


The Future of Spatial Data // www.drahola.com // www.geocockpitug.de

BerndD

148 post(s)
#08-Jan-20 15:21

That is weird. Just ran it again and it worked with the 500K dataset.


The Future of Spatial Data // www.drahola.com // www.geocockpitug.de

adamw


9,321 post(s)
#09-Jan-20 10:41

Glad to hear that it worked in the end, but just for the record:

Were you creating a new drawing on SQL Server in both cases? How were you determining the dimensions of the bounding box (there are several methods, some may desync with data)? Was the original drawing in MAP file in both cases?

BerndD

148 post(s)
#09-Jan-20 17:52

I simply created a new database in SQL Server.

Then imported a GeoJson file, set the correct projection and checked if it has an rtree.

After that I copied the drawing and pasted it into the SQL Server database.

I am assuming I had some projection issues with the one that didn't work.


The Future of Spatial Data // www.drahola.com // www.geocockpitug.de

adamw


9,321 post(s)
#10-Jan-20 12:23

It could have been projection issues, indeed - if the projection is lat/lon, SQL Server rejects everything outside of the -180..180 / -90..90 range, so if there is a scale factor that is not accounted for correctly, the paste will fail.

Anyway, if you will ever see the issue again and it would seem that we are getting the projection - or anything else - wrong that we should be getting right, drop a note to tech support and we will look into it. Thanks in advance.

BerndD

148 post(s)
#11-Jan-20 14:39

Thanks for the explanation. Sure will do.


The Future of Spatial Data // www.drahola.com // www.geocockpitug.de

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.