2011-06-19 19:06:35 +02:00
|
|
|
1. Find and install perl Geo-ShapeFile-2.52
|
|
|
|
cd Geo-ShapeFile-2.52/
|
|
|
|
sudo perl Makefile.PL
|
|
|
|
make
|
|
|
|
make test
|
2011-06-19 22:54:53 +02:00
|
|
|
USE smothness = 2
|
2011-06-20 23:14:01 +02:00
|
|
|
|
|
|
|
I. Make all 5 files
|
|
|
|
II. Merge them
|
|
|
|
III. Run Index Creator
|
|
|
|
|
|
|
|
I
|
2011-06-19 22:54:53 +02:00
|
|
|
-------------
|
|
|
|
Coastlines
|
|
|
|
1. Locate and run shp2osm.pl.
|
2011-06-19 19:06:35 +02:00
|
|
|
Example (replacing tags): perl ./shp2osm.pl 10m-coastline/10m_coastline.shp | sed 's/FeatureCla/natural/g;s/Coastline/coastline/g' > 10m_coastline.osm
|
2011-06-19 22:54:53 +02:00
|
|
|
2. Fix manually all 180 degrees breaks (simply divide islands into 2 islands and add connect line on 180 degree) and make Antarctica cycled.
|
|
|
|
3. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename.
|
|
|
|
- Open JOSM -
|
|
|
|
4. !Fix manually Caspey Sea !
|
|
|
|
5. ! Check 2 ShriLanka islands (2 coastlines on one place)
|
2011-06-19 19:06:35 +02:00
|
|
|
6. ! Check North America for bug!
|
2011-06-20 23:14:01 +02:00
|
|
|
// 7. Run Index Creator.
|
2011-06-19 22:54:53 +02:00
|
|
|
|
|
|
|
-------------------------
|
|
|
|
admin level
|
|
|
|
Example (replacing tags):
|
|
|
|
1. perl ./shp2osm.pl 10m-admin-0-countries/10m_admin_0_countries.shp | sed 's/FeatureCla/admin_level/g;s/Adm-0 country/0/g;s/NAME/name/g' > 10m_admin_level.osm
|
|
|
|
2. Open in JOSM and remove or fix antarctica
|
|
|
|
3. Run net.osmand.osm.util.FixAdminLevel0 from DataExtractionosm.jar with arg0=filename.
|
|
|
|
To create country tag="place" value="country"
|
|
|
|
4. Open in Josm and simply save
|
2011-06-20 23:14:01 +02:00
|
|
|
// 5. Run Index Creator
|
2011-06-19 22:54:53 +02:00
|
|
|
|
|
|
|
-------------------------
|
|
|
|
cities/towns
|
|
|
|
Example (replacing tags):
|
|
|
|
1. python ogr2osm/ogr2osm.py 10m-populated-places/10m_populated_places.shp
|
|
|
|
Creates 10m_populated_places.osm
|
2011-06-20 01:32:38 +02:00
|
|
|
2. less 10m_populated_places.osm | sed 's/MEGACITY/place/g;s/v="1"/v="city"/g;s/v="0"/v="town"/g;s/NAME/name/g' > 10m_populated_places_out.osm
|
2011-06-20 23:14:01 +02:00
|
|
|
// 3. Run IndexCreator
|
2011-06-19 22:54:53 +02:00
|
|
|
|
2011-06-20 01:32:38 +02:00
|
|
|
-------------------------
|
|
|
|
lakes
|
|
|
|
Example (replacing tags):
|
|
|
|
1. perl ./shp2osm.pl 10m-lakes/10m_lakes.shp | sed 's/FeatureCla/natural/g;s/Lake/lake/g;s/Reservoir/water/g;s/Name1/name/g' > 10m_lakes.osm
|
|
|
|
Creates 10m_lakes.osm
|
|
|
|
2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename.
|
|
|
|
3. Open in Josm and simply save
|
2011-06-20 23:14:01 +02:00
|
|
|
// 4. Run IndexCreator
|
2011-06-20 01:32:38 +02:00
|
|
|
|
|
|
|
-------------------------
|
|
|
|
rivers
|
|
|
|
Example (replacing tags):
|
|
|
|
1. perl ./shp2osm.pl 10m-rivers-lake-centerlines/10m_rivers_lake_centerlines.shp | sed 's/FeatureCla/waterway/g;s/River/river/g;s/Name/name/g' > 10m_rivers.osm
|
|
|
|
Creates 10m_lakes.osm
|
|
|
|
2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename.
|
|
|
|
3. Open in Josm and simply save
|
2011-06-20 23:14:01 +02:00
|
|
|
// 4. Run IndexCreator
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
II Merging
|
|
|
|
BASH :
|
|
|
|
echo "<?xml version='1.0' encoding='UTF-8'?>" > basemap_1.osm;
|
|
|
|
echo "<osm version='0.6' generator='JOSM'>" >> basemap_1.osm;
|
|
|
|
|
|
|
|
cat 10m_coastline_out.osm | sed -r "s/'-([0-9]*)'/'-\11'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
cat 10m_admin_level_out.osm | sed -r "s/'-([0-9]*)'/'-\12'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
cat 10m_populated_places_out.osm | xmllint --format - | sed -r 's/"-([0-9]*)"/"-\13"/' | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
cat 10m_rivers.osm | sed -r "s/'-([0-9]*)'/'-\14'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
cat 10m_lakes_out.osm | sed -r "s/'-([0-9]*)'/'-\15'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
echo '</osm>' >> basemap_1.osm;
|
|
|
|
|
|
|
|
TEST :
|
|
|
|
echo "<?xml version='1.0' encoding='UTF-8'?>" > basemap_1.osm;
|
|
|
|
echo "<osm version='0.6' generator='JOSM'>" >> basemap_1.osm;
|
|
|
|
|
|
|
|
|
|
|
|
echo '</osm>' >> basemap_1.osm;
|
|
|
|
cat 10m_rivers.osm | sed -r "s/'-([0-9]*)'/'-\14'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
|
|
|
|
|
|
|
|
READY : basemap_1.osm [1-3, 4-5,6-7].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|