[OSM-dev] osm.xml: r16190 mocks up XML parser/Mapnik?
Jan-Benedict Glaw
jbglaw at lug-owl.de
Thu Jul 30 16:31:22 BST 2009
Hi!
I updated my local osm.xml copy some these days from SVN. Since then,
no highways were drawn. I tracked it down to two bugs.
The first one is that the SQL is kind of incomplete:
@@ -6990,7 +6990,14 @@
<Parameter name="user">postgres</Parameter>
<Parameter name="dbname">osm</Parameter>
<Parameter name="table">
- (select * from planet_osm_line order by z_order) as roads
+ (select way,highway,aeroway,railway,layer,horse,bicycle,foot,bridge
+ from planet_osm_line
+ where (highway is not null
+ or aeroway in ('runway','taxiway')
+ or railway in ('light_rail','subway'))
+ and bridge not in ('no','false','0')
+ order by z_order
+ ) as roads
The last "and bridge not in (...)" should be guarded with a NULL check
for bridge:
and (bridge is null or bridge not in ('no','false','0'))
This was checked by manually issueing the SQL to psql, which now
outputted a lot more:)
The second bug is more subtle. The newly introduced whitespace
seems, parsed in XML context, to result in something that Mapnik
parses wrongly. From looking at SQL traces, the offender seems to be
that Mapnik (0.5) correctly parses the source table name, creating
this diff (comparison of PostgreSQL log files):
--- Multi-line SQL version
+++ Single-line SQL version
-LOG: statement: select f_geometry_column,srid,type from geometry_columns where f_table_name='planet_osm_line
- '
+LOG: statement: select f_geometry_column,srid,type from geometry_columns where f_table_name='planet_osm_line'
(I see the same for 'planet_osm_polygon', 'planet_osm_roads', ...))
Linking against Mapnik 0.6 resulted in about an empty image (only
background, no SQL statements triggered, no C++ish exception...) I'll
try to look into that soon. So it would probably be nice to not place
a table name to the end of a line for some time...
MfG, JBG
--
Jan-Benedict Glaw jbglaw at lug-owl.de +49-172-7608481
Signature of: Friends are relatives you make for yourself.
the second :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20090730/3a0fdb2e/attachment.pgp>
More information about the dev
mailing list