Golang simplifying polyline data - go

I am pulling huge geojson datasets with golang, and I am wondering if there is anything like simplify.js for golang, that would reduce the number of points in a polyline while retaining its shape?
https://mourner.github.io/simplify-js/

There is a Go port of simplify-js
https://github.com/yrsh/simplify-go

Related

HealPix / Healpy: Creat healpix map from (MODIS) satellite data

I’m planing to map satellite data from MODIS onto a sphere and I thought Healpix could be the right way to do it. However, I don't know how to go about it:
Does the input map need to be in FITS format or could I read an HDF4 MODIS data file into an array (with python) and then use healpy to map it onto a sphere?
I came across this answer: https://stackoverflow.com/a/50495134/7157742 and hoped that something similar would be possible in my case. Any suggestions?
Yes, you can use a standard numpy array.
You need to map your data into the right HEALPix pixel.
To do so you can get arrays of colatitude theta and longitude phi of your data and then find to which pixel they map to using hp.ang2pix.
Then you can create a 1D array healpy map and work with it.
See an example Jupyter Notebook https://gist.github.com/zonca/680c68c3d60697eb0cb669cf1b41c324

Nearest neighbours

I'm trying to find a lightweight way to find nearby objects in three.js.
I have a bunch of cubes, and I want each cube to be able to determine the nearest cubes to it on demand.
Is there a better way to do this than just iterating through all objects and calculating the distance between them? I know the renderer does something similar to what I want when it sorts to find the order to render with, but I'm not getting too far just trying to read the three.js code.
The renderer is doing the same thing you're describing but you may want to use KDTrees in your case.
Have a look at this example:
http://threejs.org/examples/webgl_nearestneighbour.html

Generating a multipoint topojson file

I am trying to create a map layer using D3 and leaflet for displaying a large number of unique GPS data points. I created it using geoJSON and Leaflet but the performance was poor. I finally got Topojson installed and working, but I cannot get it to produce a Multipoint geometry, only Point geometry which does not shrink the file much. I have passed in a CSV with all the points and used to geoJson file but only get 70,000 point geometries instead of one Multipoint. What am I missing? Do I need to write the Topojson myself? Want to avoid this if possible.
TopoJSON won't help you in this case. To quote the website:
Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs.
As you have no line segments, there's no point in using TopoJSON -- it won't reduce the size of the file.
+1 What Lars said. Your best bet is probably to load the point data as a CSV using d3.csv()instead of a GeoJSON or TopoJSON, as it is much more compact. You can then loop over the data, adding each point to a layer group.
That said, 70,000 is a lot and your map is still probably going to be very slow. You might want to think about using something like PostGIS (or CartoDB for that matter) and request only those points that are visible in a given map state.

"Live" graph d3.js with simulated data

I have created a simple line graph with data from a mySQL database using PHP to return the data in JSON format.
https://gist.github.com/5fc4cd5f41a6ddf2df23
I would like to simulate "live" updating something similar to this example, but less complicated:
http://bl.ocks.org/2657838
I've been searching for examples on how to achieve this simply as new to D3 - to no avail.
I've looked at Mike Bostock's http://bost.ocks.org/mike/path/ path transitions, but not sure how to implement this using json data.
Can anyone help with either an example or some direction on how I could accomplish this?
Doing that kind of line transformations is tricky in SVG because moving large number of points just a little and rerendering the complete line can hurt performance.
For the case when interactivity with each data point is not paramount and the time series can grow to contain arbitrary number of points, consider using Cubism. It is a library based on d3 but meant specially for visualizing time-series data efficiently. To prevent rerendings of SVG, it draws the points on a canvas, allowing for cheap pixel by pixel transitions as new data arrives.

Plotting dots to a map given latitude and longitude

Summary: I need a tool that can put 60m+ points on a map image. I'm trying to show density map and would like to plot a dot for each point (lat/long) on the map.
Hi I'm working on project that requires a density map. I have latitude and longitude and all the tools that I have seen (Ammap, FusionCharts maps, google charts/map) requires either XML or JSON or some other data type with the data points. Problem here is that, I have 60 million + data points and transferring any type of object with that many data point is not feasible.
One solution I can think of is mapping latitude and longitude to pixels of the map image. That requires a lot of time and work. I was wondering if you guys have done something similar and know of tools that can do this for me. It doesn't have to be free.
You'd be much better off creating a heatmap instead of passing all of the individual points to the map, which would get very busy, very quickly.
There are already a few discussions over at GIS.StackExchange about this exact topic. Search the the [heatmap] tag.
Since you mentioned FusionCharts, assuming you can load all of your data into a Google Fusion Table, it looks like you should be able to make a heat map in Google Fusion Tables).

Resources