1

I am trying to open a fairly large table stored on our MSSQL Spatial DB - the table has around 22,000 polygons.

The table opens perfectly on Mapinfo 12.5 (both 64bit and non-64bit), but for some strange reason only a few hundred polygons display on Mapinfo 15, however when you browse the table, all 22,000 are present.

Seems like the tabular data is present, but no spatial data i.e. cannot run queries where the missing polygons are.

I have done some testing since: When a table is pushed onto the server using EasyLoader via Mapinfo 12.5, the error appears on Mapinfo 15, and vice versa.

Any idea as to why the polygons do not display?

4
  • You did not specify SQL Server version. Although EasyLoader will perform MakeValid() , did you try it yourself ? Do you have access to MSSQL studio management to perform a MakeValid() query ?
    – sys49152
    Commented Jul 17, 2016 at 8:37
  • 1
    Do you get all spatial data over if you open the database table as linked instead of live? Commented Jul 18, 2016 at 7:56
  • When I open the table as "Linked", it opens successfully, why would this be the case? I am using SQL Server 2014. Commented Jul 18, 2016 at 10:35
  • 2
    When you open it using Live, MapInfo Pro uses the spatial index of the SQL Server table. And the Spatial Index seems to be defect because SQL Server has run into a number of invalid features. Try running the MakeValid() statement on the table Commented Dec 11, 2017 at 13:00

2 Answers 2

2

Your MapInfo.mapinfo_mapcatalog probably has the bounding rectangle incorrectly set and doesn't cover the full area in which your polygons reside.

The fields DB_X_LL, DB_Y_LL, DB_X_UR and DB_Y_UR indicate the bounding rectangle for your data. I suspect that this only covers a small area

update mapinfo.mapinfo_mapcatalog set DB_X_LL = a.xmin, DB_Y_LL = a.ymin, DB_X_UR=a.xmax, DB_Y_UR=a.ymax
from
(
select MIN((sw_geometry).STEnvelope().STPointN(1).STX) as xmin,
MAX((sw_geometry).STEnvelope().STPointN(3).STX) as xmax,
MIN((sw_geometry).STEnvelope().STPointN(1).STY) as ymin,
MAX((sw_geometry).STEnvelope().STPointN(3).STY) as ymax from DEMO_AREA_POLYGON
) a
where tablename='DEMO_AREA_POLYGON'

select * from mapinfo.mapinfo_mapcatalog
0
0

When you open it using Live, MapInfo Pro uses the spatial index of the SQL Server table.

And the Spatial Index seems to be defect - or at least missing some records - because SQL Server has run into a number of invalid features.

Try running the MakeValid() statement on the table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.