1

I work on a .net core web API application collecting fishing events with latitudes and longitudes.

For each of these positions, I need to compute the corresponding Exclusive Economic Zone (EEZ), it's the national water surrounding each countries.

The official definition of these EEZ is available as shapefile on marineregions. There are few hundreds polygons.

For the moment I have stored the definition of these EEZ as polygon using the geography type in my SQL Server 2018 database, and I query with SQL the database for each position I collect.

I collect around 20,000 positions per day, and the performance is not great (takes 14 seconds for 500 positions).

So I'm looking for another solution.

What would be the fastest way to retrieve which polygon a point belongs to? Assuming I have shapefiles, but I can convert them to anything necessary. Also I need this solution to be free and if possible to offer an API so I can call it from my server.

1
  • 2
    You don't need another solution as much as you need a properly optimized solution. Coastlines are heinously complicated, and the large vertex counts makes point-in-polygon suck wind. All you need to do is overlay your EEZs with a fishnet, and use the EEZ_fishnet layer for point-in-polygon. See this blog for an example of performance gains available. Since each dataset is unique, the optimal grid will vary.
    – Vince
    Commented Apr 17, 2020 at 22:25

0

Your Answer

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

Browse other questions tagged or ask your own question.