Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

What is GIS method of Geometry data type?

I'm working on a project and we have a geometry column. I'm querying the database to get the data , send it to Mapbox and display it on the US map.

Now, the query is slow and someone at work says there's some GIS method of geometry data type that I can add to the query that simplifies the returned shape and it has some accuracy compression parameter that controls the amount of detail that is lost.

I've been Googling and we don't know what it is.

We're using SQL 2014. C# MVC VS2015.
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

The table is like this

CountyId  varchar(500)
CountyName varchar(500)
CountyStateId int
Geom  geometry

1. I do a select (I actually do this in C# code with LINQ) --> select CountyId, CountyName, CountyStateId, Goem from myTable.
2. I get the data back and do whatever.

How can I apply what you have to this?
no filter?
you get all world data and send it to mapbox?
I get all the US counties. We have 3100 rows of data.
getting 3100 rows from a single table should not be long, maybe 1 sec max...
are you sure your query is this simple?
I wonder if it's because of Entity Framework. I have table County (has name, id, state) and another one CountyGeo (has geometry). I join them and get the info. In the database, takes about 3 seconds but in the code, 3 mins.

When I want to to feed it to Mapbox, we're using this line on the Geomerty column:

map.Geom = CountyGeom.ToSqlGeometry().ToGeoJSONGeometry()

I wonder if all this processing is causing the slowness. That's why my teammate says we need to some GIS method.