Can you advise me how to convert coordinates to GPS in Delphi XE3? Algorithm or free library?
<gml:Point gml:id="P.86019161010.PAR.646151807"
srsName="EPSG:5514">
<gml:pos>1099208.98 479473.69</gml:pos>
</gml:Point>
I tried Googling, but I don't want to be a geography pro, I just want to display the results in GoogleMap or Mapy.cz
Related
I want to simulate real-time in Unity using GPS data (Latitude / Longitude/ Altitude) of the aircraft moving in another flight simulator. In this way, the aircraft in Unity, should act the same as the aircraft in the other simulator.
As is known, Unity uses the xyz coordinate system. I have studied many examples to transform these two different types of data into one another. But in all of them, problems occur in coordinate transformations and aircrafts move differently. However, I still do not understand how to do it.
Is there an easy formula for realizing this transformation?
Here are a few examples of instant data I receive from the simulator:
<GPS>
<Lat>21.325352</Lat>
<Long>-157.929607</Long>
<Al>885.512322</Al>
</GPS>
<GPS>
<Lat>21.325356</Lat>
<Long>-157.929555</Long>
<Al>886.829367</Al>
</GPS>
<GPS>
<Lat>21.325357</Lat>
<Long>-157.929540</Long>
<Al>887.487356</Al>
</GPS>
I saw several places where OSM data is converted to MVT (mapbox vector tiles) for simple rendering.
Those include:
OSRM which provides MVT based image of the route for rendering
OpenMapTiles which enables downloading of OSM maps in MVT format
GeoServer which can import OSM and export MVT
Is there a simple tool to convert OSM data to MVT locally?
I have my own data in OSM format that I want to convert to MVT and store locally, without rendering to a map image.
The mapbox/awesome-vector-tiles repository at GitHub has a long list of Mapbox Vector Tile implementations. This is the list as of today:
Parsers & Generators
vector-tile-js - Parses vector tiles with JavaScript.
mapnik-vector-tile - C++ vector tile read/write implementation on top of Mapnik.
mbtiles-cpp - C++ library for decoding of mbtiles and vector data into function callbacks.
vector-tile-py - Python tool to convert a Mapnik vector tile to GeoJSON
node-mapnik - Node.js API for vector tiles which depends on mapnik-vector-tile
vector-tile-cs - Parses vector tiles with C# (native C# implementation, no dependencies).
mapbox-vector-tile-cs - Parses vector tiles with C# (uses protobuf-net).
tilelive-bridge - Implements Tilelive API for creating vector tiles from traditional Mapnik datasources in Node.js.
tilelive-vector - Implements Tilelive API for reading vector tiles and rendering to image tiles in Node.js.
mapbox-vector-tile is a Python package for vector tile encoding maintained by Mapzen. (It is used in Mapzen's vector tile service).
geojson-vt - Slice GeoJSON into vector tiles on the fly in the browser.
java-vector-tile - A java encoder and decoder for vector tiles.
mapbox-vector-tile-java - Encode and decode v2.1 Mapbox Vector Tiles. Convert JTS Geometry to and from MVT features, including simple user data support. Utility functions for converting world coordinates to MVT coordinates and clipping to a tile envelope.
cached-vector-tile - An alternative implementation of the vector-tile-js interface, backed by plain JS objects/arrays rather than parsed-on-demand protobuf data. Trades away memory efficiency for faster feature.loadGeometry() calls.
tilegrinder - A helper library for applying a data altering function on each vector tile in an MBTiles, using the native protobuf wrapper for de- and encoding, recompressing the results and storing them either in an MBTiles or as single files.
SwiftVectorTiles - A Swift encoder for vector tiles according to the Mapbox vector tile spec.
Clients
Mapbox GL Native - C++/OpenGL vector maps library with native SDKs for Android, iOS, Node.js, macOS, and Qt
Mapbox GL JS - JavaScript/WebGL vector maps library.
OpenLayers 3 - JavaScript vector & raster library.
WhirlyGlobe/Maply - Objective C code that is able to read and render vector tiles(and style with mapnik xml) on iOS devices.
Leaflet.MapboxVectorTile is able to read PBF MapboxVectorTiles from a REST endpoint and render them as a TileLayer on a Leaflet Map. Use this option if you want to utilize vector tiles on a standard Leaflet web map without needing WebGL.
CARTO Mobile SDK - C++ maps library focused on offline features, for iOS, Android, Windows Phone and Xamarin with bindings for Java, Objective-C and C#. Based on Nutiteq Maps SDK, but open source and uses CartoCSS.
Mapzen Tangram - JavaScript library for rendering 2D & 3D maps live in a web browser with WebGL, supports MVT, GeoJSON, TopoJSON
Mapzen Tangram-es - C++ library for rendering 2D and 3D maps using OpenGL ES 2 with custom styling and interactions
mapbox-gl-leaflet - Create Mapbox GL layers in Leaflet
react-native-mapbox-gl - Render Mapbox GL maps from React applications
hoverboard - Render vector tiles on canvas with Leaflet 0.7.x (supports GeoJSON, TopoJSON, and protobuf)
Leaflet.VectorGrid - Display gridded vector data (sliced GeoJSON, TopoJSON or Mapbox Vector Tiles) in Leaflet 1.0.0
ArcGIS API for JavaScript - Draw vector tile layers as part of your web map. Rendering done via mapbox-gl-js integration.
mapscii - A Vector Tile to Braille and ASCII renderer for xterm-compatible terminals
Applications / Command line tools
Mapbox Studio - Desktop design studio for both creating vector tiles from raw geodata and for rendering them on-the-fly into image tiles. Internally uses tilelive.js modules to handle vector tiles (see tilelive-bridge and tilelive-vector)
kosmtik - Design maps with CartoCSS and Mapnik.
ArcGIS Pro - Generate vector tiles from maps authored in ArcGIS Pro or imported from ArcMap.
MVT Styler - map style editor for vector tiles.
Maputnik - A visual style editor for the Mapbox GL style specification.
CLI Utilities
Datamaps C application that can be used to create vector tiles and store them in an mbtiles. See the render-vector command.
tilemaker - Command line tool to produce vector tiles directly from an .osm.pbf extract without an intermediate database.
vector-tiles-producer Command line tool in C++ to creates vector tiles for a given area at chosen zoom levels using a Mapnik XML.
tippecanoe - Build vector tilesets from large collections of GeoJSON features.
vt-geojson - decodes vector tiles to GeoJSON FeatureCollections
tl - An alternate command line interface to tilelive
tileshrink - Reduce the layer extent and simplify the resulting geometries of all vector tiles in an MBTiles
tiler - Command line tool for converting GeoJSON, Shapefiles or PostGIS layer to raw Vector Tiles (or MBTiles)
geojson2mvt - npm package for building a static vector tile tree for given xyz bounds from a geojson file (uses vt-geojson)
Mapbox GL JS Plugins
gl-draw - Adds support for drawing and editing features on Mapbox GL JS maps
Servers
tessera - Supports serving and rendering vector tiles. Uses the same core libraries as Mapbox Studio.
tilestrata - with tilestrata-vt, it can generate Mapnik Vector Tiles; with tilestrata-postgismvt, it can serve Mapbox Vector Tiles from a PostGIS db
SpatialServer (PGRestAPI) - A multi-purpose GeoSpatial NodeJS web server created at SpatialDev that not only serves MBTiles stuffed with vector tiles, it can also cut vector tiles on the fly from a PostGIS database.
Utilery Server to generate vector tiles from PostGIS queries. Python based
tileserver Mapzen Vector Tile Service.
TileStache added support for Mapbox Vector tiles via .pbf extension requests.
Kartotherian Wikipedia tile server with Tilerator backend tile pre-generator
ArcGIS Online - Supports serving vector tiles and rendering in the mapping application powered by the ArcGIS API for JavaScript
Portal for ArcGIS - Supports serving vector tiles and rendering in the mapping application powered by the ArcGIS API for JavaScript
tilesplash - A light and quick nodejs webserver for serving topojson or mapbox vector tiles from a postgis backend
go-vtile-example - An example server written in Go
Tegola - A MVT server written in pure Go that supports serving tiles from a PostGIS data provider.
t-rex - MVT server in a single executable written in Rust. Serves tiles from PostGIS supporting custom tile grids.
Low-level utilities
mapbox-gl-function - Mapbox GL style function evaluator
mapbox-gl-filter-simplify - Simplifies and complexifies filters in Mapbox GL Styles
vt-pbf serialize JavaScript objects representing vector tiles into binary Protocol Buffer encodings of vector tiles
Articles
Vector tiles remixed - guide to using tilemaker to generating vector tiles
Specific thing with MVT is that this is tiled and multi-resolution (zoom-based) display-optimized, more like "rendered" map for visual fast rendering and styling, it is not your typical geodata format really. For example it does not have geographical coordinates in it, it has "pixel space" coordinates in tiles for your vector objects. This makes 'simple conversion' from/to geodata quite tricky, and very typical conversion solution is a strange one - use use map server or service with your data and then scrape tiles from it. For tile scraping the best tool seems to be tilelive-copy.
However, closest what you may want from the long list above would be tippecanoe which converts GeoJSON to MVT (in a mbtiles file). If your data is in .osm format, then you need to convert it to geojson; but there are other tools for it, for example ogr2ogr. Be aware that OSM files include many data layers and the structure is quite specific, so you need to find well-working configurations for all conversion steps.
After some long time search, here is my conclusion at the very moment:
gdal should be useful with ogr2ogr cli tool converter. Theorically, it is able to convert from osm to mvt (geojson step should not be mandatory).
tippecanoe does a quiet equivalent thing, from geojson to mvt (ogr2ogr or osmium can help to convert from .osm to .geojson)
But the devil is in details: you need to be explicit on what data go on what mvt layer (water, roads, buildings, etc...).
I've not found a convenient "all-in-one" tool able to convert osm building or building parts polygons and relations into mvt buildings layer, and so on... It looks like each team (mapbox and co) keeps it secretely behind API services with API key system.
Mapbox provides a kindle of map tiles--mapbox.mapbox-terrain-v2 which is stored in pbf format and saved in mvt suffix. The height data is represented by contour (line).
I want to generate terrain with satellite texture and this height data in Unity3D. How could I convert this pbf data to a height map(a pixel for a height value)?
There is an example
https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.jpg?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg
And the mvt file
https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.mvt?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg
And the document of Mapbox:
https://www.mapbox.com/vector-tiles/mapbox-terrain/
https://www.mapbox.com/vector-tiles/specification/
MapBox have buid a Unity3d package: MapBox-Unity-SDK
SDK here : https://www.mapbox.com/unity/
Just click download.
This is an asset you can open in Unity directly.
Launch Unity3d, goto Menu>Assets>ImportPackage>CustomPackage
and select your downloaded file.
It will unpack some files and the folders, you will find into some exemples scene files to help you.
The current vector terrain layer isn't designed to be turned into a heightmap: we've processed terrain into elevation contours and lines, so turning those back into raw data would be difficult (much like doing the opposite: we do a lot of processing because it would also be difficult to transfer raw data and derive visual data).
A new and improved vector terrain model that supports your usecase is on the way, but we've also introduced RGB terrain, which was actually designed specifically to address cases like Unity - decoding the RGB-encoded elevation tiles tends to be much simpler in software.
I plan to get the x-y coordinated reading from an optical mouse. Basically, I want the readout to be something like this but instead of using a Wiimote, I'll be using a standard USB mouse.
I have found quite a good example - [http://www.synbio.org.uk/component/content/article/46-instrumentation-news/1234-interfacing-an-optical-mouse-sensor-to-your-arduino.html]
but sadly it runs on C++ and needs a bridging hardware called Arduino. Though however, it PRINTS out the coordinate rather than putting it into a 'real-time' graphical plot.
I would love if MATLAB can read off the coordinates from the mouse and plot a 'real-time' graph of the coordinates.
Thanks :)
If you have a DLL or DLLs for communicating with your mouse you should be able to persuade Matlab to use it or them. Look at the documentation for loadlibrary.
(Of course, if you are using Linux or Mac OS X replace 'DLL' with 'shared library'.)
Is there a way to create a heat map in google earth, so areas with higher values (of some specified parameter, such as population) appear as hotspots?
This seems possible.
For instance, take a look at those few links :
Disclaimer : I've tried none of those
HeatMapAPI.com
And an example
But I'm not sure how you'd do it ; seems related to .NET and a dll in some way... so might not be as nice as it seems...
Density Mapping in Google Maps with HeatMapAPI
Heat Maps for Google Maps - (a.k.a GeoIQ mashup)
Using Google Maps to Produce Heat Maps
You've got a couple of links in those articles too ; some might be interesting too.
My colleague developed an open source java program that will generate 3D heat maps (KML) files for Google Earth from simply formatted XML data files. It may be of use. The entire project code is up at https://github.com/Noblis/OSAT You can ignore the bulk of what's there, and focus on GUIMain and the supporting files. There's sample files and documentation. I'd call it about a 0.5 version - it works, we used it in our studies, but there's some rough edges. It was done for transportation accessibility studies, but you can change the parameters you're graphing to anything you want, run from command line, whatever.
You can use the vertical axis to either view the same parameter as is used for the color OR use it to map an entirely different variable.
Here's two screen shots so you can see what it does:
tool interface:
example 3D output:
You can create polygons in a KML file and set the color of them. You can also make the polygons 3D, with height perhaps representing temperature.
There is also http://www.openheatmap.com, which offers free heatmaps on top of OpenStreetMap from a CSV upload.
Try free API heat maps. A really interesting implementation : http://en.tixik.com/tools/heatmaps
HeatmapTool.com can take a CSV file of coordinates and intensity values to generate heat map tiles for Google Maps.