Create .map from .shp - empty map?

Started by moudi, April 13, 2025, 21:01:46

0 Members and 3 Guests are viewing this topic.

moudi

Hi all

I tried to create a custom map from a SHP file following the article here:
https://docs.locusmap.app/doku.php?id=manual:advanced:map_tools:conversion#how_to_convert_shp_file_for_locus
But I only get a blank map in Locus (no errors in the whole conversion).

Could somebody please have a look at it? I spent already quite a while digging in it, but have no clue why it isn't working.  :'(

The article seems a bit outdated, so I had to adopt it a bit.
First of all, the download link for the SHP file is not working anymore, so I downloaded one for switzerland:
https://geodata.ucdavis.edu/gadm/gadm4.1/shp/gadm41_CHE_shp.zip
The conversion to .osm in Merkaartor was working and the generated .osm file seems to be ok to me.
In the .osm file, I moved the boundary on top as the first element.
The tags in the file are a bit different as well. All elements have: <tag k="_ENGTYPE_1_" v="Canton"/>

The versions for Osmosis and the Mapwriter plugin are both outdated in the article.
I tried it both with the mentioned ones (osmosis 0.40.1 / map-writer 0.5.0) and the newest versions (osmosis 0.49.2 / map-writer 0.25.0).
Both run without errors and generated a .map file with identical size (very small with 136KB). See the attached console log.
In my opinien, I expect the problem to be here in the .map file generation. 136KB seems to me very small (empty?).
Also, if I set the osm-tag to enabled="false", the generated .map file has the same size.

I adopted the theme according to the different tag.

I copied both files to the mentioned folders in Locus and Locus was able to open/load the map without error, but showed an empty screen.
To be sure that I'm in the correct region, I checked with the "center map" function in Locus.

I've attached the following files:
- cantons.osm
- tag-mapping-shp.xml
- osmosis.log
- cantons-theme.xml
- cantons.osm.map

Does anybody have an idea what's going wrong here?
Thank you very much
Dominik
  •  

voldapet

Hi Dominik,

conversion of SHP to Mapsforge vector map is overcomplicated and the article is really old...maybe is better to convert data to raster mbtiles (but it depends on area of coverage).
Anyway, before any exploration of the issues - could I ask you what your use case is? Or what data you want to display?

I would also like to note that we are developing another application called Locus GIS which is aimed at more professional use cases and can directly import SHP https://play.google.com/store/apps/details?id=menion.android.locus.gis

Thanks, Petr
  •  

moudi

Hi Petr, thanks for your reply.

I have a dataset with 130'000 pathways (simple lines) with special categorization (e.g. easy/moderate/hard) which I would like to use as an overlay map while navigating. (the dataset is not available for the public, so I can't share it here)

The coverage is quite big with roughly 119'000 km^2. I expect that a raster based map would result in a way too large file. The SHP file itself is 88MB.

Locus GIS looks nice, but I think it's not the right tool for my use case.

My first approach was to create a KML file, but Locus was not able to handle it and crashed. I assume the file was just too big.
If SHP to Mapsforge is that troublesome, are you aware of a better choice? QGIS supports the export to many other vector formats, so I'm not bound to SHP.

Thanks for your help
Dominik
  •