From ac63df507a532dd5b0e690ad9e04ac1fc7e3151b Mon Sep 17 00:00:00 2001 From: Ahlzen Date: Sat, 7 Jul 2012 17:37:25 -0400 Subject: [PATCH] Added or improved rendering of many NHD features. Based on Kevin Kenny's TopOSM-NY work, this adds improved rendering of several features in NHD: - Labels on area-based linear features (such as larger rivers) - Foreshores - Submerged rocks - Submerged streams - Inundation areas - Hazard zones - Special use zones - Rapids - Dams - Non-earthen shores - Water wells - Springs - Sinks - Rises - Gaging stations - Water tunnels The style files are also a bit cleaner by using entities from include/nhdfcodes.inc, rather than specifying NHD FCODEs directly. --- .gitignore | 3 +- README.md | 4 +- custom-symbols/gaging-station.svg | 97 ++++++++ include/nhd.inc.templ | 367 +++++++++++++++++++++--------- include/nhdfcodes.inc.templ | 51 +++++ templates/features.xml.templ | 247 +++++++++++++------- 6 files changed, 573 insertions(+), 196 deletions(-) create mode 100644 custom-symbols/gaging-station.svg create mode 100644 include/nhdfcodes.inc.templ diff --git a/.gitignore b/.gitignore index 35ff231..01da23b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ include/*.inc *.pyc errors.log geodata -tile \ No newline at end of file +tile +temp \ No newline at end of file diff --git a/README.md b/README.md index f18a985..1f7c9f5 100644 --- a/README.md +++ b/README.md @@ -131,8 +131,6 @@ To render a PDF, use renderToPdf() in toposm.py ## Credits ## -Created by Lars Ahlzen (lars@ahlzen.com), with contributions from Ian Dees (hosting, -rendering and troubleshooting), Phil Gold, Kevin Kenny (patches and style improvements), -Yves Cainaud (legend), Richard Weait (shield graphics) and others. +Created by Lars Ahlzen (lars@ahlzen.com), with contributions from Ian Dees (hosting, rendering and troubleshooting), Phil Gold (patches and style improvements), Kevin Kenny (improved NHD rendering, misc patches), Yves Cainaud (legend), Richard Weait (shield graphics) and others. License: GPLv2 diff --git a/custom-symbols/gaging-station.svg b/custom-symbols/gaging-station.svg new file mode 100644 index 0000000..537ada8 --- /dev/null +++ b/custom-symbols/gaging-station.svg @@ -0,0 +1,97 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/include/nhd.inc.templ b/include/nhd.inc.templ index 1318d34..be22214 100644 --- a/include/nhd.inc.templ +++ b/include/nhd.inc.templ @@ -1,166 +1,325 @@ + - - + + + - - - - - + + + + diff --git a/include/nhdfcodes.inc.templ b/include/nhdfcodes.inc.templ new file mode 100644 index 0000000..934fdb3 --- /dev/null +++ b/include/nhdfcodes.inc.templ @@ -0,0 +1,51 @@ + + + + + + + + + + + + diff --git a/templates/features.xml.templ b/templates/features.xml.templ index d8a42a5..653ca1a 100644 --- a/templates/features.xml.templ +++ b/templates/features.xml.templ @@ -2,23 +2,25 @@ + - - - - - - - - - - - - - - - %utils; - %colors; + + + + + + + + + + + + + + + %utils; + %colors; + %nhdfcodes; ]> @@ -236,83 +238,141 @@ - - - water-outline-lowzoom - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm as size FROM ${NHD_TABLE_PREFIX}_area_major) AS nhdarea - - - - water-outline-lowzoom - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm as size FROM ${NHD_TABLE_PREFIX}_waterbody_major) AS nhdwaterbody - - - - water-outline-lowzoom - - &dbsettings; &extents; - (SELECT way, fcode, ftype, lengthkm as size FROM ${NHD_TABLE_PREFIX}_flowline_major) AS nhdarea - - - - water-fill-lowzoom - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm as size FROM ${NHD_TABLE_PREFIX}_area_major) AS nhdarea - - - - water-fill-lowzoom - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm as size FROM ${NHD_TABLE_PREFIX}_waterbody_major) AS nhdwaterbody - - + - - - water-outline - playas - wetlands - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm FROM ${NHD_TABLE_PREFIX}_waterbody) AS nhdwaterbody - - - - water-outline - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm FROM ${NHD_TABLE_PREFIX}_area) AS nhdarea - - - - water-outline - - &dbsettings; &extents; - (SELECT way, fcode, ftype, lengthkm FROM ${NHD_TABLE_PREFIX}_flowline) AS nhdflowline - + + + + nhd-flowline-lowzoom + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, lengthkm AS size + FROM ${NHD_TABLE_PREFIX}_flowline_major + WHERE fcode = 55800) AS areafeature + + - - water-fill - ice - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm FROM ${NHD_TABLE_PREFIX}_waterbody) AS nhdwaterbody - + + nhd-flowline + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, lengthkm AS size + FROM ${NHD_TABLE_PREFIX}_flowline + WHERE fcode = 55800) AS areafeature + + - - water-fill - - &dbsettings; &extents; - (SELECT way, fcode, ftype, areasqkm FROM ${NHD_TABLE_PREFIX}_area) AS nhdarea - + + + + nhd-water-fill-lowzoom + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_area_major + UNION + SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_waterbody_major) AS areafeature + + + + + nhd-water-fill + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_area + UNION + SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_waterbody) AS areafeature + + + + + + + nhd-water-outline-lowzoom + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_area_major + UNION + SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_waterbody_major) AS areafeature + + + + + nhd-water-outline + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_area + UNION + SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_waterbody) AS areafeature + + + + + + + nhd-nonwater-fill + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, areasqkm AS size + FROM ${NHD_TABLE_PREFIX}_area + WHERE fcode IN ( 34300, 34305, 34306, 36400, 37300, + 43100, 45400, 45403, 45500, 46100 ) + ORDER BY size DESC) AS areafeature + + + + + + nhd-flowline-lowzoom + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, lengthkm AS size + FROM ${NHD_TABLE_PREFIX}_flowline_major + WHERE fcode <> 55800) AS linefeature + + + + + nhd-flowline + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, lengthkm AS size + FROM ${NHD_TABLE_PREFIX}_flowline + WHERE fcode <> 55800) AS linefeature + + + + + + nhd-nonwater-line + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name, lengthkm AS size + FROM ${NHD_TABLE_PREFIX}_line) AS linefeature + + + nature-areas @@ -351,6 +411,17 @@ + + nhd-point + + &dbsettings; &extents; + + (SELECT way, fcode, gnis_name FROM ${NHD_TABLE_PREFIX}_point) + AS pointfeature + + + + buildings