sembruk / osm2xmap Goto Github PK
View Code? Open in Web Editor NEWConverter from OpenStreetMap data format to OpenOrienteering Mapper format.
License: GNU General Public License v3.0
Converter from OpenStreetMap data format to OpenOrienteering Mapper format.
License: GNU General Public License v3.0
Example of synthetic input, based on real causing data error:
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.4.0 (30408 thorn-03.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<bounds minlat="50.0530600" minlon="19.8482400" maxlat="50.0545200" maxlon="19.8524600"/>
<node id="447039358" visible="true" version="1" changeset="1926268" timestamp="2009-07-24T16:08:01Z" user="sledzik1984" uid="58785" lat="50.0541494" lon="19.8488857"/>
<way id="38042707" visible="true" version="4" changeset="31621045" timestamp="2015-05-31T22:38:07Z" user="dziabaducha" uid="775276">
<nd ref="447039358"/>
<nd ref="447039360"/>
<tag k="highway" v="ą"/>
</way>
</osm>
to compare, following input differing by replacing "ą" with "footway" is not causing crash:
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.4.0 (30408 thorn-03.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<bounds minlat="50.0530600" minlon="19.8482400" maxlat="50.0545200" maxlon="19.8524600"/>
<node id="447039358" visible="true" version="1" changeset="1926268" timestamp="2009-07-24T16:08:01Z" user="sledzik1984" uid="58785" lat="50.0541494" lon="19.8488857"/>
<way id="38042707" visible="true" version="4" changeset="31621045" timestamp="2015-05-31T22:38:07Z" user="dziabaducha" uid="775276">
<nd ref="447039358"/>
<nd ref="447039360"/>
<tag k="highway" v="footway"/>
</way>
</osm>
results in
./osm2xmap -i zoo.osm -s ISSOM_5000.omap
Using files:
* input OSM file - zoo.osm
* output XMAP file - ./out.xmap
* symbol set XMAP file - ISSOM_5000.omap
* rules file - ./rules.xml
Segmentation fault (core dumped)
Given that letters like żółćęśąźńŻÓŁĆĘŚĄŹŃ are appearing typically only in tag name that is not rendered in orienteering maps potential band-aid is to process input file and remove UTF-8 letters (obviously, proper solution would allow processing data also with letters beyond ASCII).
Note that such letters may also appear in user field.
Use *.mrules format for osm2xmap, as CRT for DXF2xmap.
About format syntaxis
Rules samples
Additionally look on this
input, output, log, symbols file: https://gist.github.com/matkoniecz/f810739963a248602e37475965fa91c6
Data obtained from http://www.openstreetmap.org/export#map=19/50.05379/19.85035
I generated file that can not be opened by Mapper:
Cannot open file:
/home/mateusz/Desktop/tmp/osm2xmap/bin/out.xmap
Error at line 1 column 40: Invalid file format version.
Some are visible after running the compiled program but even then what is "symbol set XMAP file" and how one may get it is unclear...
I just tried to create a map of Charles Sturt University campus in Bathurst, NSW, Australia (T: -33.4255, B: -33.4357, L: 149.5545, R: 149.5686) and the map came out approx 120 degrees rotated. The calculated grivatation was 4 lines long. Looking at the code it looks like grivatation is never set / initialized.
Running 2.0 windows release on a 32 bit windows machine.
I tried this on a 64bit windows machine and it worked OK.
I am not sure is it something fixable or just something that should be mentioned in installation instructions, but at this moment after successful installation of libroxml:
sudo make install
[ 22%] Built target roxml-dynamic
[ 45%] Built target roxml-static
[ 47%] Built target roxml-tool
[ 70%] Built target roxml_test
[ 72%] Built target roxml.mem
[ 75%] Built target roxml.perf
[ 91%] Built target roxml_test_tiny
[ 95%] Built target roxml.tiny.unitC
[100%] Built target roxml.unitC
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/lib/libroxml.so.2
-- Up-to-date: /usr/local/lib/libroxml.so.2.3.0
-- Up-to-date: /usr/local/lib/libroxml.so
-- Up-to-date: /usr/local/lib/libroxml.a
-- Up-to-date: /usr/local/bin/roxml
-- Up-to-date: /usr/local/include/roxml.h
and compilation
make
Compiled coordsTransform.cpp successfully!
Compiled main.cpp successfully!
Compiled osm.cpp successfully!
Compiled rules.cpp successfully!
Compiled timer.cpp successfully!
Compiled xmap.cpp successfully!
Compiled xml.cpp successfully!
Linking complete!
it is not working:
./bin/osm2xmap: error while loading shared libraries: libroxml.so.2.3.0: cannot open shared object file: No such file or directory
Apparently libroxml and this program have cooperation problems.
Un Ubuntu 14.10 libroxml install itself in places not detected by this program. Copying compiled libroxml to /usr/lib allowed to pass cannot open shared object file
error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.