Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spatial results tab saying:One or more spatial objects were too large to display

I've saved country borders in my sql server 2012 as geography data from geojson files.

It turns out that when I query all the boundaries that have an administration level 2, not all the polygons are shown in the "spatial results" tab.

Clearly this issue is not specific to just admin level 2 but also the rest of the levels are affected. I'll use Austria admin level 2 as an example.

The error message I get is: "One or more spatial objects were too large to display. Please refine your query". enter image description here

As you can see Austria(Österreich) is present in the query result but is not present in the "Spatial result" tab: enter image description here

This is my query:

SELECT TOP 10 [Id]
      ,[AdminLevel]
      ,[Name]
      ,[CountryId]
      ,[OpenstreetmapId]
      ,[BoundaryPolygon]
  FROM [WorldLocation].[dbo].[GeographyBoundary]
WHERE [AdminLevel] = 2

Questions:

  1. What is the cause of the issue displaying the error message in the spatial results tab?
  2. How can I fix the error?
  3. Is there a query I can write to solve the problem?
like image 381
Carlo Luther Avatar asked Oct 19 '22 22:10

Carlo Luther


1 Answers

Use sql geo-spatial function like Reduce(), to simply the dots.

You can review the shape in the spatial results tab.

like image 137
Mick Wang Avatar answered Nov 03 '22 22:11

Mick Wang