Skip to content

Commit

Permalink
use railways from osm
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Dec 19, 2010
1 parent 0905f57 commit d05bf6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions mapgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ v.clean input=roadsmall_line3 output=roadsmall_line tool=snap,break,rmdupl thres
g.remove vect=roadsmall_line1,roadsmall_line2,roadsmall_line3
v.out.ogr input=roadsmall_line type=line dsn=$DEST_PATH/roadsmall_line.shp

g.remove vect=railway_line,railway_line1,railway_line2,railway_line3
v.in.ogr -t dsn=$CONVERTED_PATH layer=railway_line output=railway_line1
v.build.polylines input=railway_line1 output=railway_line2
v.generalize input=railway_line2 output=railway_line3 method=douglas threshold=0.002
v.clean input=railway_line3 output=railway_line tool=snap,break,rmdupl thres=0.002
g.remove vect=railway_line1,railway_line2,railway_line3
v.out.ogr input=railway_line type=line dsn=$DEST_PATH/railway_line.shp

echo "================================================================================"
echo "Finished postprocessing. Processed shapefiles are in directory $DEST_PATH"
echo "================================================================================"
6 changes: 1 addition & 5 deletions osm2shp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,11 @@ void parser<Handler>::parse(std::istream& in) {
char buf[64*1024];
while (!in.eof()) {
in.read(buf, sizeof (buf));
int len = in.gcount();

if (!XML_Parse(parser_, buf, len, 0)) {
if (!XML_Parse(parser_, buf, in.gcount(), 0)) {
throw parse_error(XML_ErrorString(XML_GetErrorCode(parser_)),
XML_GetCurrentLineNumber(parser_));
}
}

XML_Parse(parser_, 0, 0, 1);
}

Expand Down Expand Up @@ -543,7 +540,6 @@ handler::handler(const std::string& base)
add_layer("citymedium_point", "place", "town");
add_layer("citymedium_point", "place", "suburb");
add_layer("citysmall_point", "place", "village");
add_layer("water_line", "waterway", "stream");
add_layer("water_line", "waterway", "river");
add_layer("water_line", "waterway", "canal");
add_layer("water_area", "natural", "water");
Expand Down

0 comments on commit d05bf6f

Please sign in to comment.