8

Whenever you are faced with a question like this and you simply do not have expertise in the problem domain it's good to do a couple things. First acknowledge that you don't have specific expertise in this problem domain. Second, explain how you would go about solving the problem. Although I don't have specific experience when working with ...


6

They are probably after an answer mentioning spatial indexing, most likely by selecting a database that provides spatial indexing out of the box, but you might also get a few points by mentioning it can be implemented in the application itself if needed e.g. by implementing an R-Tree (might be handy if the DB selection is fixed for other reasons? but also ...


5

The spatial datatypes are in return for only supporting one type of query, much much faster at that type of query. Consider importing something like the MaxMind Cities database and finding the city closest to you. With regular float datatypes, that query would need to check all 2.7 million records against eachother to find the closest one (calculate ...


5

On the technical side: Querrying the backend using the longitude and latitude (option 2) has the advantage of providing the country in the same way for every platform. However it has the following drawbacks: a user can refuse to share geolocalisation in order to protect his privacy. You won't get lattitude and longitude. THis will break your design. ...


4

This is probably obvious, but for many applications the poor man's slow solution may be fine. Have a table in a relational database that stores latitude and longitude. Query for all locations that have a latitude within 20 miles and a longitude within 20 miles. This gives you a bounding rectangle the size of the smallest bounding rectangle that contains ...


4

Yes, you should collect the zip code. Mostly because there are cases where the post office and locals disagree on city names, and geocoders get confused. Adding a zip code will massively improve your odds of success But there is also a case I heard of in the Boston area with 2 addresses with the same city, street, and street number..but different zip ...


3

Path- finding algorithms such as A* routinely do this using some cost function (e.g. Distance, time, or even waiting-time) and heuristics to select the most promising candidate for expanding the path (e.g. If possible departure from same station/airport, and distance between arival point and target). The basic schema would be: use a sorted queue pick the ...


3

I was hoping there would be some kind of database optimization Databases with spatial / geospatial extensions allow to store spatial objects and fast query operations like "is point in certain area", supported by so-called spatial indexes. The exact set of features as well as the syntax differs from DBMS to DBMS, but I do not know of a database which ...


3

I would only implement the dependency-injection for a geocoding client that aggregates different coordinate provider implementations if you either have more than one provider (i.e. location based on ip-adress instead of zip code) or do Test-driven_development. For me your design looks over-complicated. I have implemented something similar for android ...


2

Likely the easiest way is to use a quadtree to store the locations of your houses, assuming distributed in a 2D landscape. Searching should be fairly straightforward. If you're using a GIS-enabled RDBMS to store your stuff, then you really need not worry about that. See this question for some info on performance of the lead players.


2

Since all your criteria are not strictly geographic, I think what you're looking for falls more closely under faceted search. Faceted search allows the user to "drill down" until they get the information they want, in this case the responsible branch. You see it most frequently on shopping sites. You do a general search, then a list of criteria, or "...


2

To add to btilly's answer, yes you should require a ZIP code. Not only can this help validate the address, you also assume a US style ZIP code. Other countries use different postal code systems. The UK, for example, has a much finer grained postcode system, making it a much better validator and harder to infer from an address (although there are existing ...


1

For moving robots or calculate routes to move from point A to point B, you need to use a graph data structure. A graph is a set of nodes and a set of edges that relate nodes. A path is a sequence of segments (i.e. two nodes and the edge used to go from the first to the second). A path finding algorithm then allows to compute an optimal route between 2 ...


1

architecture that somehow partitions posts per geo area (which I want to avoid, Unfortunately that is exactly what you should be doing. First of all, drop kafka. Its not a message queue. Secondly, when a user posts you want to tag that post with one or more area aggregate keys; say post code or grid square or city rather (or as well as) the geo-location....


1

More coffee is always good! As was suggested, there's almost certainly a geospatial extension for your database, but that may be overkill for what you want. I would base it on squares, rather than circles, and then later refine the selection. The 'proper' method SELECT * FROM LOCATIONS WHERE ?1 >= X - RADIUS AND ?1 <= X + RADIUS AND ?1 >= Y - ...


1

Maybe in your case - having centers and radius would be easier, instead of combining the circles, just to check if the distance of the user to the centers of the drivers is less that the given radius. Something like: SELECT * from drivers where ST_DISTANCE(drivers.center, POINT([user.lon],[user.lat])) < drivers.radius; /* assuming drivers.center is of ...


1

Yes you would want to collect this if nothing more than for a sanity check. Addresses are frequently entered incorrectly. A geocoding engine often cannot necessarily tell you this. Take 100 main street denver co and 100 main street denver pa for example. A good thing to check is to ensure the address in fact does lie within that city and zip code. If ...


1

I had to perform the treatment you describe on the road network of German city (about 200.000 inhabitants). I devised a procedure that produced great results: the road network has over 2000 road portions and about 200 connection failures and the procedure was able to fix automatically 95% of the failures and to mark the remaining ones as “requiring ...


1

I'm not sure standard databases like MySql provide spacial indexing. You need to put them in a persistent spacial index. Like M-trees. Spacial indexes are efficient data structures that can perform range queries over distance metrics. Wikipedia M tree Stack Overflow: Storing coordinates in a smart way to obtain the set of coordinates within a certain range ...


1

I'm not sure what this question has to do with 3D. I'm assuming you're specifying points in 2 dimensions: latitude and longitude. Just find the max and min latitude and longitude among all the points. The smallest box that contains them all is (min lat, min long), (min lat, max long), (max lat, max long), (max lat, min long). That's assuming relatively ...


Only top voted, non community-wiki answers of a minimum length are eligible