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.