Highcharts -Highmaps making map curved(geojson QGIS) - highcharts

I am trying to draw US outline in highmaps using geojson. My map is straight.
However I would like to make it curved like below link.
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/us-counties/
Here is image of curved map.
Ignore below geojson as I can't paste all here.
Here is link to paste of geojson : https://paste.fedoraproject.org/413593/. Geojson was generated using QGIS. Below is map generated by this geojson
Here is quick link to test geojson.
http://jsfiddle.net/o7u6j6ck/
> > {"type": "FeatureCollection", "features":
> > [{"type":"Feature","geometry":{"type":"Mult
>
> iPolygon","coordinates":

It's a matter of projections. Geojson can only deal with WGS84, which is a subset of the Mercator Projection.
The curved map you've shown is drawn using the Albers-USA projection.
You can use D3.js to play with different map projections. IIRC D3 can read from valid GeoJSON/TopoJSON and reproject it using the projection of your choice.

Related

Get the Triangular Polygon where the Ray Point intersected

I am rendering a 3D Obj model in iOS. http://metalbyexample.com/picking-hit-testing/. I am following the above Tutorial written by WM to find the hit point in the 3D model. Using the above link I can find the intersecting point with 3D model. I want to find the triangular polygon where I touched and I want to find the UV coordinates in the Image texture. How can I do that..

Find Inner most Polygon using actual Area from array of nested Polygon

I have Array of GMSPath and have Coordinate. I want to find out Path in which this Coordinate falls. I am able to find out total polygons in which this location falls. (Using this https://stackoverflow.com/a/38826411/2225439) Everything is working fine up to this step.
The Actual issue comes when One closed GMSPath overlap with another Closed GMSPath and Coordinate is in overlapped area. As per my requirement, I have to get only one GMSPath out of these two and which have the smaller area than another.
Please refer Image for better understanding.
You can find out the area of GMSPolygon by using following method from Google Maps iOS SDK, GMSGeometryArea(), it provides area of given polygon. Now you have area, so you can compare different polygons and find innermost area.
double GMSGeometryArea(GMSPath *path);
As per description provided by google
Returns the area of a geodesic polygon defined by |path| on Earth.
The "inside" of the polygon is defined as not containing the South pole.
If |path| is not closed, it is implicitly treated as a closed path nevertheless and the result is the same.
All coordinates of the path must be valid.
If any segment of the path is a pair of antipodal points, the result is undefined -- because two antipodal points do not form a unique great circle segment on the sphere.
The polygon must be simple (not self-overlapping) and may be concave.

Recreate the 3D outlines of a City street in iOS SceneKit with OSM XML data

What is best strategy to recreate part of a street in iOS SceneKit using .osm XML data?
Please assume part of a street is offered in the OSM XML data and contains the necessary geopoints with latitude and longitude denoting the Nodes to describe the paths/footprints of 6 buildings (i.e. ground floor plans that line the side of a street).
Specifically, what's the best strategy to convert latitude and longitude Nodes in order to locate these building footprints/polygons on the ground floor in a scene within SceneKit iOS? (i.e. running through position 0,0,0)? Thank you.
Very roughly and briefly, based on my own experience with 3D map rendering:
Transform the XML data from lat/long to appropriate coordinates for a 2D map (that is, project it to a plane using a map projection, then apply a 2D affine transform to get it into screen pixel coordinates). Create a 2D map that's wider and taller than the actual screen, because of what's going to happen in step 2:
Using a 3D coordinate system with your map vertical (i.e., set all the Z coordinates to zero), rotate the map so that it reclines at an appropriate shallow angle, as if you're in an aeroplane looking down on it; the angle might be 30 degrees from horizontal. To rotate the map you'll need to create a 3D rotation matrix. The axis of rotation will be the X axis: that is, the horizontal line that is the bottom border of your 2D map. The rotation is exactly the same as what happens when you rotate your laptop screen away from you.
Supply the new 3D coordinates to your rendering system. I haven't used SceneKit but I had a quick look at the documentation and you can use any coordinate system you like, so you will be able to use one that is convenient for the process I have just described: something that uses units the size of a screen pixel at the viewing plane, with Y going upwards, X going right, and Z going away from the viewer.
One final caveat: if you want to add extrusions giving a rough approximation of the 3D building shapes (such data is available in OSM for some areas) note that my scheme requires the tops of buildings, and indeed anything above ground level, to have negative Z coordinates.
Pretty simple. First, convert Your CLLocationCoordinate2D to a MKMapPoint, which is exactly the same as a CGRect. Second, scale down the MKMapPoint by some arbitrary number so it fits in with how you want it on your scene graph, let's say by 200. Since scenekit's coordinate system is centered at (0,0), you'll need to make sure your location is correct. Then just create your scnvector3's with the x/y of he MKMapPoint, and you will be locked to coordinates.

Mapping lat/lon coordinates to a bitmap image of a map, not fixed to one projection

I'm currently developing a small piece of (Java) software that should be able to display maps and the current GPS position within that map.
I'm absolutely new to this, but it is pretty obvious that I'll have to do some kind of coordinate transformation.
I've found "Proj4J", which seems to be able to do a lot for me.
Now, what I have and what I want to do:
I have a bitmap of a map. The projection of this map can be any "well-defined" one, like Lambert or Mercator. I cannot fix this to one projection.
I have GPS coordinates from a "standard" GPS receiver. I believe they are lat/lon in WGS84, is that correct?
Now my questions:
I must map the GPS position to basically "screen coordinates" in my map bitmap. And for that, I assume, reference points are needed for which I know their lat/lon and corresponding pixel positions. Since my map can easily cover a couple of hundred kilometers in range, a linear interpolation between the known points and an arbitrary position is probably not correct for all types of projections, am I right on that?
I've read "Convert long/lat to pixel x/y on a given picure" so far, but this deals with a Mercator projection and I believe a linear approximation will work better than for a Lambert map.
I imagine the whole process is as follows:
"Calibrate" the map, i. e. identify two positions of known lat/lon in the bitmap and thus get their pixel position.
Use the Proj.4-transformation from "lat/lon WGS84" to "map projection" to map those reference points from (1.) into map coordinates.
Take the points from (2.) and map them again to a projection that will allow linear interpolation of the pixel positions, I'll call that the "pixel projection".
Now I have two reference points with coordinates in the "pixel projection" and their corresponding pixel positions.
For a lat/lon value from the GPS receiver do the following:
Convert the position to a map position using the "map projection".
Take the map position from (1.) and convert it to a coordinate using the "pixel projection" from above.
Since all distances in the "pixel projection" are maintained (that is the condition of the pixel projection!), an interpolation of the resulting coordinates from (2.) with the known position of the reference points from above can be made.
Here the big questions:
Is this the way to go, using a final "pixel projection" to allow linear interpolation?
What type of projection would that be and can that be done with Proj.4?
Can the "way back" - I have a pixel position and want lat/lon be accomplished (like "pixel position" -> "pixel projection" -> "map projection" -> "lat/lon")?
Thank you very much,
Jens.

Google photo sphere

Does anyone have information on how to map the texture-image of a Google photo-sphere image onto a sphere yourself (not using the google api)? My goal is todo it myself in matlab but I was unable to find any information about the mapping coordinates.
Thanks in advance,
Thomas
you can find details about the metadata of a Photo Sphere here:
https://developers.google.com/photo-sphere/metadata/
Essentially, the image uses equirectangular projection [1] which you only need to map on the inside of a sphere, and put the camera at the center.If the Photo Sphere is a full 360/180 degree panorama, then you can map the whole of the inside of a sphere. If it is only a partial panorama, then you can use the metadata inside the photo to determine the exact position you need to place the texture.
[1] https://en.wikipedia.org/wiki/Equirectangular_projection
Did you try using the warp function?
a = imread('PANO.jpg');
[x,y,z] = sphere(200);
warp(x,y,z,a);
Using camera tools, you may set the camera position inside the sphere, but I think outside view can be enough with an adequate level of zoom.

Resources