This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
manual:advanced:map_tools:conversion [2015/05/15 06:43] – created mstupka | manual:advanced:map_tools:conversion [2023/06/27 14:40] (current) – [Convert SHP file to KML] mstupka | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- | ---- | ||
- | <WRAP todo round center 60%>This page is obsolete and will be reworked soon</ | + | ===== How to create a sqlitedb file with Mapc2mapc |
- | ===== How create a sqlitedb file with Maps2mapc | + | <WRAP center round important > |
+ | Mapc2mapc is not a product of Asamm Software so we do not take any responsibility for changes in its usage. This article is for general information only. | ||
+ | </ | ||
==== Basic information ==== | ==== Basic information ==== | ||
- | * Locus currently | + | * Locus Map currently |
- | * Firstly, suggest | + | * Firstly |
+ | |||
+ | * In case you are satisfied we suggest | ||
+ | Locus Map Classic user gets 10% discount of this product. [[http:// | ||
- | * In case you'll be satisfied, I suggest to buy full version by **Buy** button on bottom of manual page. Thanks to this, you'll get 10% discount of this product | ||
* **MAPC2MAPC: | * **MAPC2MAPC: | ||
- | ==== Additional | + | ==== Additional |
- | * [[manual: | + | * [[manual:advanced: |
- | * [[manual: | + | * [[manual:advanced: |
Line 27: | Line 30: | ||
http:// | http:// | ||
http:// | http:// | ||
+ | |||
+ | ====== Various ====== | ||
+ | |||
+ | ---- | ||
+ | ===== How to convert Netherlands Top25raster ===== | ||
+ | |||
+ | The Netherlands kartographic service PDOK offers topographic map Top25raster for free. These maps are provided in geotiff format in local coordinate system. Locus Map is not able to handle geotiff format, therefore it is necessary to convert these data manually. | ||
+ | |||
+ | <WRAP round info> | ||
+ | |||
+ | ==== Download data ==== | ||
+ | |||
+ | * Whole Netherland is divided into sections – download a section which is suitable for you | ||
+ | * Download page: https:// | ||
+ | |||
+ | ==== Use GDAL for transformation ==== | ||
+ | |||
+ | === Install GDAL === | ||
+ | |||
+ | * For purpose of this tutorial download gdal http:// | ||
+ | * Download gdal-110-1600-core.msi installer | ||
+ | |||
+ | === Transform downloaded geotiff === | ||
+ | |||
+ | * Open command line (CMD) and go to the GDAL installation folder | ||
+ | * Transform downloaded geotiff into WGS84 system | ||
+ | |||
+ | set GDAL_DATA=.\gdal-data | ||
+ | gdalwarp -t_srs EPSG:4326 44a-top25raster-2010.tif | ||
+ | |||
+ | === Use Mapc2Mapc to generate map in a Locus-supported format === | ||
+ | |||
+ | * Download and install Mapc2Mapc http:// | ||
+ | * Start Mapc2mapc and set the location of gdal_translate | ||
+ | * Edit > Locate > GDAL_translate | ||
+ | * Open transformed geotiff | ||
+ | * File > Load Calibrated map | ||
+ | * Export file for Locus | ||
+ | * File > Write map for Mobile devices | ||
+ | * Choose Locus/RMAPS sqlitedb | ||
+ | * Set zoom levels | ||
+ | * optional: check Make tile margins transparent | ||
+ | * Press OK and confirm all zoom levels that will be generated | ||
+ | |||
+ | === Import map into Locus Map === | ||
+ | |||
+ | * Copy generated sqlitedb map into your device folder Locus/ | ||
+ | * Start Locus Map | ||
+ | |||
+ | === Red crosses === | ||
+ | |||
+ | * The demo version of Mapc2mapc will add random red crosses over the map. This is limitation of free/demo version | ||
+ | |||
+ | {{: | ||
+ | ===== How To Convert Shp File For Locus ===== | ||
+ | |||
+ | ==== Basic information ==== | ||
+ | |||
+ | Locus Map basically does not support SHP files at this moment. On the other hand there are some possibilities how to convert SHP to a different format that can be imported into Locus Map. | ||
+ | |||
+ | ==== Convert SHP file to KML ==== | ||
+ | |||
+ | Probably the easiest way of converting SHP file which is fully supported by Locus. Unfortunately there is a limitation in size of KML file. The **limit** for Locus Map is about **5000 – 10000 points** depending on your device. | ||
+ | |||
+ | * Download free tool Shp2kml | ||
+ | * Unzip and run shp2kml.exe | ||
+ | * Select the file for conversion on the first screen | ||
+ | {{ : | ||
+ | * Define color of lines/ | ||
+ | {{ : | ||
+ | * Skip balloon definition screen | ||
+ | * Define name of layers and description on the last screen | ||
+ | {{ : | ||
+ | |||
+ | * Create KML file | ||
+ | * Copy created KML file into Locus/ | ||
+ | * Run Locus Map and go to the [[manual: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ==== Convert SHP to Mapsforge format ==== | ||
+ | |||
+ | In this example we expect that shp file for converting is very simple. Unfortunately converting is little bit tricky and requires a specific approach for particular SHP files. So it is not possible to say that this example could be used for every SHP file. | ||
+ | |||
+ | For this example we use free shp data (Czech Republic boundaries ) download-able at [[http:// | ||
+ | |||
+ | === SHP file to OSM format === | ||
+ | |||
+ | There are lots of possibilities how to do it - see [[http:// | ||
+ | |||
+ | * Download Merkaartor [[http:// | ||
+ | * Run it and open SHP file for converting | ||
+ | * Export OSM: File > Export > OSM (XML) | ||
+ | * Note: Merkaartor place'' | ||
+ | |||
+ | <code xml cze_adm.osm> | ||
+ | <?xml version=" | ||
+ | <osm generator=" | ||
+ | < | ||
+ | <node version=" | ||
+ | ... | ||
+ | ... | ||
+ | ... | ||
+ | |||
+ | </ | ||
+ | |||
+ | === Mapsforge map writer plugin === | ||
+ | |||
+ | == Osmosis == | ||
+ | * Download and install osmosis 0.40.1 [[http:// | ||
+ | * Note: there are newer versions of Osmosis but the Map writer plugin does not work properly with them | ||
+ | * More details about Osmosis [[http:// | ||
+ | | ||
+ | == Map writer plugin == | ||
+ | * Download Mapwriter plugin [[http:// | ||
+ | * Copy downloaded plugin into Osmosis folder | ||
+ | * More about installing Map writer plugin: [[https:// | ||
+ | |||
+ | == Define custom tags for generation of map file == | ||
+ | * Map writer plugin uses a XML file (tag-mapping.xml) that contains pairs of known tags for generation. | ||
+ | * Use Merkaartor or arbitrary GIS/DBF viewer and decide which SHP attributes you want to export to the map file. | ||
+ | * For this example we create '' | ||
+ | {{ : | ||
+ | <code xml tag-mapping-shp.xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xsi: | ||
+ | profile-name=" | ||
+ | |||
+ | <!-- CZE_ADM_2 --> | ||
+ | < | ||
+ | <osm-tag key=" | ||
+ | <osm-tag key=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | == Generate map file == | ||
+ | |||
+ | * Run generation | ||
+ | < | ||
+ | bin\osmosis.bat --read-xml cze_adm.osm --mapfile-writer file=cze_adm.osm.map type=ram tag-conf-file=tag-mapping-shp.xml bbox-enlargement=0 | ||
+ | </ | ||
+ | * More information about generation and Mapwriter plugin [[https:// | ||
+ | |||
+ | == Create vector theme for rendering == | ||
+ | * We’ve generated vector map and in next step we need to define appearance of geometry. Appearance is defined via theme XML. | ||
+ | * You can edit any free theme for Locus or create new one which will be created especially for your SHP file. | ||
+ | * Create theme xml (in our case '' | ||
+ | |||
+ | <code xml cze_adm_theme.xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xsi: | ||
+ | locus-extended=" | ||
+ | |||
+ | <!-- Render Boundaries --> | ||
+ | | ||
+ | <rule e=" | ||
+ | <line stroke="# | ||
+ | </ | ||
+ | <rule e=" | ||
+ | <line stroke="# | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | == Copy map and theme to the device == | ||
+ | * Copy vector map file '' | ||
+ | * Copy theme xml into folder '' | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ |