Has anyone found a good map of world administrative_area_level_2 boundaries? - geojson

Want to graph https://covid19datahub.io/articles/data.html state level data - any suggestions?

Related

Generating road mesh from a graph

Background:
I got a unidirectional planner graph, each node in the graph contains its location and to which nodes it's connected to(up to 4 nodes each one in a separated variable).
Each connection between nodes is an edge, a road segment and each node is a junction\dead end.
The road should follow a 2D polar grid layout and will be edited in runtime.
This will be used as a road-building tool for city building game.
I'm using UE4 C++ and I'm pretty new to procedural generation.
The issue:
I'm looking for some guidance on how to generate the topology.
1. What algorithms\method\technic\math I should use or know about?
2. If I should use the extrude method then how do I include the junctions?
3. Where should I have overlapping verts? (other then places where I need to cut for UVs)
4. How do I incorporate sidewalk to the road segments and the junctions
Research:
The best way that I found is basically the extrude method which seems too primitive and will be problematic with intersections since it requires to lookup verts locations which seems extremely inefficient.
More details about the graph:
https://gamedev.stackexchange.com/questions/179214/generate-road-mesh-from-a-graph
(I'm posting here because game dev seems to be pretty dead sadly)

Using R to map seedling locations using set reference points

I'm looking for some guidance on the approach I should take to mapping some points with R.
Earlier this year I went off to a forest to map the spatial distribution of some seedlings. I created a grid—every two meters I set down a flag with a tagname, and what I did is I would measure the distance from a flag to a seedling, as well as the angle using a military compass. I chose this method in hopes of getting better accuracy (GPS Garmins prove useless for this sort of task under canopy cover).
I am really new to spatial distribution work altogether, so I was hoping someone could provide guidance on what R packages I should use.
First step is to create a grid with my reference points (the flags). Second step is to tell R to use a reference point and my directions to mark the location of a seedling. From there come other things, such as cluster analysis.
The largest R package for analysing point pattern data like yours is spatstat which has a very detailed documentation and an accompanying book.
For more specific help you would need to upload (part of) your data so we can see how it is organised and how you should read it in and convert to standard x,y coordinates.
Full disclosure: I'm a co-author of both the package and the book.

How to get nearby city or state name of a geopoint in water in ios?

I am developing a location-based application in which I need to get nearby location name of any geopoint selected by user. I'm using Google Places API which is working fine for me.
Only problem is the service returns null for geopoints in water. Is there any way that I can retrieve nearby locations for a geopoint in water or ocean?
AFAIK the API has no way to do that.
So, you've got two options, in order of the effort it takes:
When user taps water just throw a dialog saying "Please select a
point on land". Next to no effort and will slightly annoy the user.
Try to find the closest land geopoint yourself and use it to run the API request on
(instead of the original point). Below are some ideas on that.
A good approach can be based on this answer: basically you can get a KML file with land polygons. For performance reasons, you can simplify the polygons to the extent that makes sense for your zoom levels. Now if your point is in one of those polygons -- it's sea. And you can simply iterate over all polygon edges and pick the one that's closest to your point, then pick a point on it - again closest to your point - and do one little epsilon-sized step towards the outside of the polygon to get a land point you can do a geocode request on. Also, the original author suggests you can use Haversine formula to determine neares land point -- I'm not really familiar with the appliance of that one.
The downside is, you have to deal with KML, iterate over a lot of polygons and optimize them (and lose precision doing that, in addition to possible differences between marineregions.org data and Google Places data)
Another cool trick you could try is using Sobel Filter [edge detection] on the visible map fragment to determine where coastline is (although you will get some false positives there), then trace it (as in raster->vector) to get some points and edges to calculate the closest land position with, in a manner similar to the former approach. Here's a clumsy drawing of the idea
For Sobel edge detection, consider GPUImage lib -- they have the filter implemented and it's probably going to work crazy fast since the lib does all the calculations on GPU.
UPD Turns out there's also a service called Koordinates that has coastline data available, check the answer here

Rails Googlemaps Draw and Save Polygons

Using Rails and Googlemaps V3, I'm looking some advice (before i head off down the wrong path) for the best approach to build the functionality to:
1) draw a polygon that describes a geographical area
2) capture and save the polygon data to the db (postgres)
3) make a query that will tell me if a point is inside the polygon or not
As far as i can see from examples that are out there - the polygon drawing bit is fairly doable but i'm not clear how to capture that data, and in which format i should save it (i see postgres has a polygon data type...). Also for the query, i'm not sure how to go about making that happen - does postgres have any magic that can make this happen (we're using heroku).
Any advice or pointers would be greatly appreciated!
Thanks!
In general your options depend in part on scale. If this is a flat, plane map, the best approach would be a polygon and point approach. This would work best for things like city maps.
For a global map you probably want to use PostGIS's geometry and geography types since they are more flexible.

How to determine which Geocoordinates are inside a defined Area?

my Application is given a list of Geocorrdinates and now I have to determine which of those Coordinates are inside a defined Area. For example the Search would definiton would be: Show me all Areas where 100 Coordinates are in an Area of 1km^2. So I have to find out which of these coordinates are together in Areas of 1km^2 and more than 100.
But that seems to be a hard Job for my understanding of geocoordinates and I hope someone can help me with that.
The Latitude coordinates are consistent and Distance between two degrees is 111km. For example the Distance between N50,985° and N50,995° is 1,11km. The Distance between 2 Longtitude Coordinates is not so easy and depends on the Latitude coordinate.
But to be honest, I really don't know how to start.
Does someone have an Idea and can help me?
Thank you
twickl
what you need is a geospatial database, I'd recommend PostgreSQL with PostGIS. It provides the function you need to calculate this kind of stuff. Also search for good tutorials about it. An example is a radius search like "give me all McDonalds in a radius of 10km where I live"
If the problem with having a database is simply that you don't want to host it (or pay for someone to host it) then I recommend Fusion Tables.
I don't know if it supports exactly the functionality you are looking for, however I suppose you could select a random point and do a count of everything within range of that point.
I think that what you are talking could be quite a cpu intensive task (depending on how accurate you want it to be). Not something I would personally try and unload onto a portable device.

Resources