Splitter r95 - improved command line handling, tile naming based on location

I've finally found the time to clean up and check in a couple of changes to the splitter that have been in the pipeline for a while: - Improved command line handling. Now provides usage instructions, error messages when invalid parameters are specified, and it is easier to maintain the code. - Tiles can be named based on the area they cover. To use this, download one of the cities files from http://download.geonames.org/export/dump/ and point to it with --geonames-file=cities<xxx>.zip. The splitter will then try to name each tile sensibly based on the biggest city in the tile. No doubt this logic can be improved in the future but it's hopefully still quite useful as it stands. There is one compatibility issue that I know of with the new command line parsing code. Builds prior to r95 supported both --mapid and --mapname for specifying the map ID. The new code doesn't support multiple names for the same parameter so only --mapid will work now. If you are using --mapname in any scripts/tools, please change this to use --mapid. Or alternatively, if that's problematic then please complain and I'll consider adding support for --mapname back in. Sorry for any inconvenience this change might cause you. Chris

Hi Chris,
- Tiles can be named based on the area they cover. To use this, download one of the cities files from http://download.geonames.org/export/dump/ and point to it with --geonames-file=cities<xxx>.zip. The splitter will then try to name each tile sensibly based on the biggest city in the tile. No doubt this logic can be improved in the future but it's hopefully still quite useful as it stands.
I tried this but it failed: Error opening or reading file java.io.IOException: Unable to find a file inside /home/markb/OSM/GB.zip that starts with /home/markb/OSM/GB java.io.IOException: Unable to find a file inside /home/markb/OSM/GB.zip that starts with /home/markb/OSM/GB I guess it needs to strip the pathname from the zip file name? Cheers, Mark

Ah yeah, it's not very clever I'm afraid, that looks like a bug :( I'll fix it later this afternoon, but in the meantime it looks like you'll have to put the zip file in the current directory (or hack the code yourself). Another thing, I'd recommend against using anything other than the cities*.zip files for now. I don't currently take into account the record type in the file, so I'm not sure what'll happen if the file contains anything other than city entries. It's on the todo list! Chris MB> Hi Chris, MB>
- Tiles can be named based on the area they cover. To use this, download one of the cities files from http://download.geonames.org/export/dump/ and point to it with --geonames-file=cities<xxx>.zip. The splitter will then try to name each tile sensibly based on the biggest city in the tile. No doubt this logic can be improved in the future but it's hopefully still quite useful as it stands.
MB> I tried this but it failed: MB> MB> Error opening or reading file java.io.IOException: Unable to find a MB> file inside /home/markb/OSM/GB.zip that starts with MB> /home/markb/OSM/GB MB> MB> java.io.IOException: Unable to find a file inside MB> /home/markb/OSM/GB.zip that starts with /home/markb/OSM/GB MB> MB> I guess it needs to strip the pathname from the zip file name? MB> MB> Cheers, MB> MB> Mark MB>

Hi Chris,
Ah yeah, it's not very clever I'm afraid, that looks like a bug :( I'll fix it later this afternoon, but in the meantime it looks like you'll have to put the zip file in the current directory (or hack the code yourself).
No problem.
Another thing, I'd recommend against using anything other than the cities*.zip files for now. I don't currently take into account the record type in the file, so I'm not sure what'll happen if the file contains anything other than city entries. It's on the todo list!
Ooops, silly me. I just grabbed the first file that looked interesting. I should have read your email more carefully. So, I have just split the GB (with cities1000.zip) and I get: mapname: 63240001 description: GB-Plymouth input-file: 63240001.osm.gz mapname: 63240002 description: GB-Bristol input-file: 63240002.osm.gz mapname: 63240003 description: GB-Cardiff input-file: 63240003.osm.gz mapname: 63240004 description: GB-Swindon input-file: 63240004.osm.gz mapname: 63240005 description: GB-Birmingham input-file: 63240005.osm.gz mapname: 63240006 description: GB-Portsmouth input-file: 63240006.osm.gz mapname: 63240007 description: GB-Reading input-file: 63240007.osm.gz mapname: 63240008 description: GB-London input-file: 63240008.osm.gz mapname: 63240009 description: GB-Southend-on-Sea input-file: 63240009.osm.gz mapname: 63240010 description: GB-Luton input-file: 63240010.osm.gz mapname: 63240011 description: GB-Leicester input-file: 63240011.osm.gz mapname: 63240012 description: GB-Cambridge input-file: 63240012.osm.gz mapname: 63240013 description: GB-Norwich input-file: 63240013.osm.gz mapname: 63240014 description: GB-Blackpool input-file: 63240014.osm.gz mapname: 63240015 description: GB-Stoke-on-Trent input-file: 63240015.osm.gz mapname: 63240016 description: GB-Liverpool input-file: 63240016.osm.gz mapname: 63240017 description: GB-Sheffield input-file: 63240017.osm.gz mapname: 63240018 description: GB-Leeds input-file: 63240018.osm.gz mapname: 63240019 description: GB-Kingston upon Hull input-file: 63240019.osm.gz mapname: 63240020 description: GB-Glasgow input-file: 63240020.osm.gz mapname: 63240021 description: GB-Newcastle upon Tyne input-file: 63240021.osm.gz mapname: 63240022 description: GB-Aberdeen input-file: 63240022.osm.gz That's great. Many thanks for the new capability. Cheers, Mark

Hi Mark MB> Ooops, silly me. I just grabbed the first file that looked MB> interesting. I should have read your email more carefully. Well I probably should have pointed out that gotcha explicitly in my original email. It's easy enough for me to fix but I've been thinking about building in better support for other GeoNames feature codes from those files too (http://www.geonames.org/export/codes.html) which means the code will need revisiting anyway. MB> So, I have just split the GB (with cities1000.zip) and I get: MB> MB> mapname: 63240001 MB> description: GB-Plymouth MB> input-file: 63240001.osm.gz ... MB> description: GB-Aberdeen MB> input-file: 63240022.osm.gz MB> That's great. MB> MB> Many thanks for the new capability. No problem, I'm glad to hear you're happy with the results. I've just checked in a fix for the path bug you found too, r96. Chris
participants (2)
-
Chris Miller
-
Mark Burton