Mapping logical units - dictionary

Most maps (maybe all of them) are just pictures made up of points, lines, fills and text. They don't incorporate any retrievable knowledge about the logical divisions they portray.
So if I want to combine a database of information about some logical entity, a well-defined neighborhood for example, with an accurate map of that neighborhood, I have to figure out how to render the neighborhood's map such that it's seamless when combined with the maps of adjacent neighborhoods.
I can brute-force it by going through the database of lat-long points that group to represent streets and similar, and add points where they pass through the logical boundaries of the neighborhood.
But I also have to do that for any other logical information I want to represent, e.g. school catchment areas, voting precincts, and so forth.
My question is: does anyone know of some software already written, C/C++ would be favorite, that handles this kind of interpolation? Or even a paper that discusses how to do it more elegantly than by brute force?

Related

A large amount of points to create separate polygons (ArcGIS/QGIS)

Visual example of the data
I used a drone to create a DOF of a small area. During the flight, it takes a photo every 20sh seconds (40sh meters of a flight). I have created a CSV file, which I transferred to a point shapefile. In total, I made with drone 10 so-called "missions", each with 100-200 points which are "shaped" as squares on the map. What I want now is to create a polygon shapefile from the point shapefile.
Because those points sometimes overlap, I cannot use the "Aggregate Points" task, as it's only distance-based. I want to make polygons automatically, using some kind of script. What could help is the fact that a maximum time between two points (AKA photos taken) is 10-20 seconds, so if the time distance is over 3 minutes, it's another "mission". Can you help with such a script, that would quickly and automatically create as many polygons as there are missions?
Okay, I think I understand what you are trying to accomplish. Since no one replied I am going to give it a quick shot, so you have something to try.
I think the best strategy would be to:
Clustering algorithm: Try running a Clustering algorithm such as DBSCAN around the timestamp dimension to classify them based on time groups, instead of the distance (since, as you said, distance based separation is not enough to properly identify and separate the points). After which, you should have all the points classified between different groups with a column group id. Maximum distance parameter in the algorithm should be around 20 seconds steps, or even a minute (since you said each mission was separated at least about 3 minutes apart).
Feature based Polygon to point: At that point, then you run your generic Polygon_from_points(...) function that transforms these clustered points to polygons shapes based on a specific discriminant feature (which in your case is going to be each group id).
How does this work?: This would properly separate the groups first (time-based) and then you should be able to find a generic point to polygon based on a feature (Arcgis should have some).
I dont have an example dataset, nor any code written, but based on what you described I think it would work, hope it helps.

Finding solution for the intersection of a line and and arbitrary-order aspheric lens surface

I apologize for any formatting mistakes, first time here.
I'm currently working on program in Java as a personal project that simulates and allows for the design of a lens system with surfaces generally defined using the equations covered here (Wikipedia). In this case the "order" of the surface referring to the greatest axrx value. Although possible, I'm pretty sure the order rarely is above 12.
Single solution:
Multiple solutions:
The linked images show two possible cases for a complex aspherical lens defined using this particular equation:
Assuming a "ray" comes from somewhere below the frame upwards as seen in the examples, how would I calculate the first point of collision between that ray and the lens surface? Specifically in three dimensions, as the examples above are only two dimensions as limited by Desmos. Being a lens, the resulting surface in three dimensions is possesses rotational symmetry where the 2D examples have reflection symmetry.
Edit removes unneeded sentence.

MariaDB spatial query to determine proportion of overlap

Background: I have two tables containing geometries (polygons and multipolygons). One table contains large polygons that touch but do not overlap (they are actually administrative boundaries). The other contains smaller polygons (in this case, they are parcels of land).
In most cases, each smaller polygon from the second table will be wholly contained within one of the larger polygons from the first table. This is simple enough to determine with spatial queries (ST_WITHIN). Some, however, will overlap two (or, theoretically, more) admin area polygons.
The question is, for those smaller polygons which overlap two large ones, how can I tell which it is most in?
This image illustrates the situation. Land parcel A is wholly within Leftshire, and B is wholly within Rightshire. This is a simple ST_WITHIN spatial query. I can determine that C overlaps both Leftshire and Rightshire as ST_WITHIN will be false but ST_OVERLAP will be true for both of them. But how can I determine that C is more in Leftshire than it is in Rightshire?
For reference, I am using MariaDB 5.5.64. If the problem is more easily solved using a different version (or even using a different DB), that would be an acceptable fallback, but I would ideally like to solve it using the tools I have to hand if possible.
[Edit: One simple solution would be to check which larger area the centroid of the smaller area falls into. This would work perfectly for rectangles, as in the example. However, it will not be reliable where the shapes are more complex, and I need this to work even for complex multipolygons as neither administrative areas nor land parcels are reliably simple in real life!]

How do you Uniquely Identify a line segment?

I'm working on a problem to eliminate common line segments in a collection of Paths. Many of these paths share the same segment.
It seems that a 2D line would have some way to uniquely identity itself. Like a Key.
So a Line [(A,B), (C,D)] is the same as [(C,D), (A,B)]
Only Solution I could come up with is to sort the points.
This seems like it would be a common problem in Math or Graphics but the solution escapes me.
From a mathematical point of view, this looks like a matter of an undirected graph (as opposed to a directed graph).
Sorting the points is one way to handle this: it's a straightforward way to represent an unordered edge with a single, unambiguously selected value (it shouldn't matter what ordering you choose, as long as it is consistent for all possible segments). You do need to ensure that you maintain this ordering as an invariant: accidentally slipping in a mis-ordered edge could cause problems for anything that depends on the ordering.
However, mathematically speaking, undirected graphs are often defined as directed graphs with a symmetry property: if (A,B) is an edge, then so is (B,A). This suggests another way: ensure that you always store both (A,B) and (B,A). Perhaps both segment orderings could have a link to any common data, and possibly a fast way to access one from the other. (As with the sorted point method, you need to maintain this symmetry as an invariant.)
The best choice depends on your application. If you're using your segments as a key, the sorting method might be best. However, some applications are a better match for the symmetric method. For example, the doubly connected edge list is a data structure which represents each edge as two linked "half-edges", one in each direction.
Since you mention graphics, note that the doubly connected edge list is often used to represent the edges of 3-D polytopes.
Also, note the similarity to oriented triangles: there are good, practical reasons for computer graphics to treat triangles as "one-sided", such that drawing a triangle visible from one side is distinct from drawing the same triangle visible from the other. Like half-edges, this distinction is determined by the order of the vertices: clockwise for one side, counterclockwise for the other.

How to find all the roads / streets / highways within a polynomial

This is a maps related question.
Summary: given a polynomial, I want to find all the roads / streets / highways within a polynomial.
The 'bounds' methodology does not seem to have way where I can ask it to give me all the roads within that bound
Similarly, the co-ordinate+radius methodology gives all the places like schools, but there is no way to get all the streets within that range.
We have tried to do something by creating our own polynomial using 4 coordinates, and then trying to estimate the roads, but we are far from the result. So we feel we are in wrong direction all-together.
The URL of my experiment is here: http://prototype.nextgeni.us/polygon/
I don't think this data is exposed by the API. What you're looking at is a collection of images with place names embedded into them. The closest thing I can think of would be to use the DirectionsService, which does give you street names (but not in a useful format). No idea how you could extend that to cover a whole polygon though, as it would just give you 1 route between markers, not all possible routes (and therefore not necessarily all streets in the polygon).

Resources