Could you update this answer : It seems net.osmand.data.index.IndexBatchCreator no more exists in 2023 versions
I noticed that the software increased from 2014 to 2023 from a size of 24MB to 189MB. What are the reasons for such great growth when the software of 2014 made it possible to do everything that the software of 2023?
OsmAndMapCreator contains essentially all the functions that OsmAnd also contains, such as routing, rendering, and additionally map creation, so it is also at least as big as OsmAnd.
As the size of OsmAnd increased, so did OsmAndMapCreator.
I had already seen this page which is very succinct and refers to the code for more detail, code which I had briefly browsed and seen among other things a “generate-obf-files-in-batch” option which I tested ( keeping the same structure for the XML file as in previous versions) but without success (file generated but empty). I also tested by launching “utilities.sh generate-poi” but then the question arises of knowing where to put the OSM sources and where the OBF destinations arrive.
In short, a lot of questions for a simple OSM to OBF conversion of POI.
Examining all the code (if I can grasp all the mysteries) is not an option for me
Thank you for your reply. This allows me to run the commands without being in the fog because the example taken in the documentation (OsmAndMapCreator/utilities.sh generate-poi albania_europe.pbf --chars-build-poi-nameindex=3) was not very explicit (was ‘albania_europe.pbf’ a source or a destination?).
However my tests are still not conclusive:
I took a simple OSM test.osm file (which generates an OBF without problem with the previous version of osmandmapcreator) below
The command produces an empty 54 byte file. For greater safety, I took another test2.osm file with the same structure of almost 200 points and this produced a file of 55 bytes, all with no error announced.
I specify that the file is indeed UTF8 and I tested with LF and CR+LF line endings which gives the same result.
I don’t think it’s the OSM file generator that is the cause since the generated files work very well with the previous version.
A curiosity also exists: the generated OBF file sees the first letter of its name transformed into capital letter (?)
Thank you in advance for any information that could resolve this issue.
PS: java version is
openjdk 188.8.131.52 2023-08-24
OpenJDK Runtime Environment (build 184.108.40.206+1-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 220.127.116.11+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
Hum… I don’t see what connection there could be with the type of rendering. And there’s no rendering_types.xml file in osmandmapcreator (only .jar files and only in root .bat and .sh files with one batch.xml file) ??
PS : there’s only in the batch.xml file a line renderingTypesFile=“” both the same for the old and new version…
PS2 : And the same file without tag user_defined give the same bad result…
lib/OsmAnd-java-master-snapshot.jar contains the rendering_types.xml.
An external rendering_types.xml can be specified using the --rendering-types= parameter: Create Offline Raster & Vector Maps | OsmAnd
Only types that are defined in the rendering_types.xml are included in the OBF file.
OK ! It’s plausible. I have not modified the rendering_types.xml but it is possible that the default version has been modified making the two versions incompatible… However, this does not explain why if I provide it with the same file without the lines with the ’ tag’ ‘user_defined’, I still don’t have any results (?)
And how then can we create a map with a particular ‘tag’? By modifying the rendering_types.xml file and provide it to the conversion tool?
PS: If I translate this ‘user_defined’ OSM file with old version of osmandmapcreator and give it to the actual version of osmand (with his default rendering_types I have not modified), I can see POI “User defined” with all names and tags …
For example, this line could be added to the user_defined_other category: <poi_type name="my_custom_poi" tag="user_defined" value="344" no_edit="true"/>
<poi_category name="user_defined_other" default_tag="amenity" no_edit="true" excluded_poi_additional_category="fee,payment_type,wheelchair_accessibility,internet_access_type,opening_hours">
<!-- Add additional combination for UK postcode POI files-->
<poi_type name="user_defined_other_postcode" tag="user_defined_other" value="postcode" no_edit="true"/>
<poi_type name="my_custom_poi" tag="user_defined" value="344" no_edit="true"/>
Generate the OBF using the modified poi_types.xml: OsmAndMapCreator/utilities.sh generate-poi ~/Downloads/test.osm --poi-types=/home/user/Downloads/poi_types.xml
The OBF can now be inspected with the OAMC inspector: OsmAndMapCreator/inspector.sh -vpoi ~/osmand/Test.obf
The user-defined POIs should be listed:
Binary index Test.obf version = 2 edition = Fri Nov 03 12:00:00 CET 2023
1 Poi data Test - 398 bytes
Bounds (left top - right bottom) : 4.8071, 45.3947 NE - 4.8292, 45.3815 NE
user_defined_other: my_custom_poi DT0810027 Lat 45.381466 Lon 4.829194 osmid=-1
user_defined_other: my_custom_poi DT0810047 Lat 45.38161 Lon 4.8220644 osmid=-2
user_defined_other: my_custom_poi PC0810023 Lat 45.394737 Lon 4.807087 osmid=-3
I begin to understand :
The old procedure allowed (thanks to batch.xml) to generate any OBF with the possibility of generating routing or not, the same for POI, Map…etc.
The new procedure (utilities.sh) seems to only be able to generate POIs (generate-poi) or OBFs (generate-obf but what it contents?) so it is logical that the POIs are “framed” according to the existing types and therefore that, if we provides an OSM for which no POI type matches, it generates an empty file.
But then, how can we generate an OBF in which we don’t want any routing, just in order to have a map?
The advantage of the old procedure was that it allowed you to generate a map with “user_defined” POIs in a single command.
I will first try to generate these POIs with the method you suggest for the new version.
Thanks again for this information.
PS: I see there’s an “generate-map” option : can we chain commands in one line like utilities.sh generate-map generate-poi osmfile.osm --poi-types=./my_poi_types.xml ?