Looking for a Highmaps example of worldmap with GPS coordinates - highmaps

Looking for a Highmaps example of world map with GPS coordinates.
Searched docs and google and no luck.
The idea is to set a LAT LNG array of points and display all points across the Highcharts map.

You need to load proj4js before Highmaps, for example from cdnjs like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4-src.js"></script>
Then when creating your series you give each point a lat and a lon, like this:
series: [{
data: [{
name: 'London',
lat: 51.507222,
lon: -0.1275
}]
}]
See this JSFiddle demonstration and this more comprehensive lat/lng documentation.

Related

How to un-normalize geo points in order to plot on leaflet

Leaflet consists of multiple self worlds. General limit of latitude n longitude is -90 to +90 and -180 to +180 respectively. So for a different number of world in map area i receive {lat: 76.12621315046384, lng: 370.70826412409673}, which i normalize to the limit format and send as a param to server in order to receive points based on an algorithm. However the points that i receive are in normalized format already which will plot on the initial first map only, however i would like to plot them on that number of world on map area from which i retrieved longitude as 370.70826412409673.
I tried getting getting pane, scaleZoom, zoomScale, scale, zoom but nothing seem to work in order to get me the world number or anything that helps me de-normalize the geopoints.
You can use the function getBounds() that gives you the coordinates of the two corners of the current view and/or getCenter(). You can then change your longitude to fit this view.
An other solution is to keep the offset between the normalized and "true" coordinates, and add it back to the answer of your algorithm.

how to plot a node on osmnx with known latitude and longtitude

is there anyone know what is the relationship between ['x'], ['y'] and ['lon'] and ['lat']? If I know a node's ['lon'] and ['lat'], how I can plot this node on the street map?
I can use the G.node[22258] find the detail information of a node, like
{
'x':319101.513
'y': 4427916
'osmid':
'ref':
'lon':'-81.11861'
'lat':'39.982066'
}
But I would like to plot a node on the map. I know the latitude and longtitude of this node, but it seems I need to know the 'x' and 'y'.
You can use ox.get_nearest_node to get the node from lat/long.
Use ox.get_nearest_node(G, (39.982066, -81.11861)) to get a nearest node
Use ox.plot_graph_route(G, [ox.get_nearest_node(G, (39.982066, -81.11861))]) to plot the node on map
As far as my knowledge goes, x-y are projected coordinates while lat-long is geographic coordinates expressed in decimal degrees. The projected coordinates are dependent on the projection itself which varies from place to place. What is needed here, I believe, is a transformation of the lat long into the desired projected coordinate system.
Here is a piece of code that does this transformation (from WGS 84 to Spherical Mercator).
While these do not reveal your x and y, I am sure this is the sort of calculation one needs to apply to get their desired result. You may try out other projections relevant to, say the US. For example, I transform to epsg 3112 for Australia. When I do that, I can directly apply euclidian geometry to obtain distances in metres.
Links: https://spatialreference.org/ref/epsg/wgs-84/, https://epsg.io/3857
from pyproj import Proj, transform
inProj = Proj(init='epsg:4326')
outProj = Proj(init='epsg:3857')
x1,y1 = -81.11861,39.982066
x2,y2 = transform(inProj,outProj,x1,y1)
print (x2,y2)
Output:
-9030082.35905815 4863336.501637128

Plot bilinear interpolated gridded data spatially on a map

I am using the following code to plot gridded data on a map over a region but I would like to know how to plot the interpolated data so that I get continuous data plotted over the region and the data does not look gridded. 'lat' and 'lon' are vectors (1x21 and 1x33) containing the latitude and longitude coordinates respectively.
ax = worldmap(latlim, lonlim);
S = shaperead('landareas','UseGeoCoords',true);
surfacem(lat, lon, ans');
geoshow([S.Lat], [S.Lon],'Color','black');
I am seeing a lot of documentation on using interp2 but I am not getting mine to work even when I try to create a meshgrid using lat and lon (cannot attach the data). I do the following with interp2:
LON,LAT] = meshgrid(unique(lon),unique(lat));
interp2(lon, lat, testdata', LON, LAT);
That gives me a result but I then want to plot it over a region without it looking gridded. testdata is a 33x21 matrix. Any ideas? I have seen some examples here on interpolation but I am not sure how to apply it conveniently with the data I have. I am surprised that there is not more information on this or why I am just sucking at finding the answer!
Thanks,

Plot points by Latitude and Longitude in Highmaps

I am trying to plot missing countries on the Highmaps world high resolution map. However it is difficult to get the correct co-ordinates.
It appears this may be difficult because the charts do not correspond with latitude and longitude. For example world high-resolution has 1750 points on the X axis, so half is 875, but GMT is at about 839.
Ideally I am looking for a formula that can be used to convert latitude and longitude to x/y, but do not know how to do this.

Plot lat and lon grid on a world map using Matlab

Can anyone help me how to plot latitude and longitude on a world map using matlab. I have the mapping toolbox and have been trying to use the function geoshow, however I canĀ“t get it right. I plot the world map using plot_google_map:
plot(lon,lat,'.k','MarkerSize',6)
hold on
plot_google_map('maptype','roadmap')
This is the figure I get:
However I am not able to get the latitude and longitude grid on this picture.
I'm not sure is this going to help, but try reversing the order of your plot statements - its possibly that the map plot may be overwriting all the data of the lon and lat data.
Alternatively, if the function allows for it, plot the map as the back layer.