D
D
den2346242346422019-08-27 11:12:10
OpenStreetMap
den234624234642, 2019-08-27 11:12:10

How to determine the occurrence of coordinates in an interesting OpenStreetMap OSM polygon?

Good afternoon!
Help with a thought!
1. I have a database with cities in the nearest area. The database contains the coordinates of these cities. Some cities have coordinates in the form of polygons, some just have a point (there are no polygons).
2. There is a landfill with a delivery area.
How to organize a check of occurrence of polygons and points recorded in the database in my polygon?
Cities can be under a thousand. And there are also many delivery sites. We are talking about delivery from points of issue of goods and, accordingly, each large city will have its own base with nearby cities, and each such city will have its own / its own delivery zones.
The coordinates in the database will be written something like this - most likely the coordinates themselves are separated from the type.
geojson='{"type":"Polygon","coordinates":[]}
And the delivery zone/zones will be saved in the same way in a separate table.
The task is to get the value true or false in the column with delivery against each city. True even if it just partially "hooked" the city zone with the delivery zone. (Let's think separately).
Delivery zones will, of course, change, but this is not daily.
Help with the order / logic of actions in this case!
5d64e55d6c62f366782028.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Moskus, 2019-08-27
@den234624234642

Use a database that can work with spatial data (PostgreSQL, SpatiaLite) and use the appropriate SQL spatial extensions. Storing data in GeoJSON is not necessary .

F
freeExec, 2019-08-27
@freeExec

The simple answer is to keep your polygons in a spatially expanded database. She will tell you who will get where, or even be able to lay the route.
Well, either write a bicycle yourself with spatial indexes and check whether a point enters a polygon.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question