@@ -16,14 +16,16 @@ Feature: Creating linestring features from way
1616 { column = 'sgeom', type = 'linestring', projection = 4326 },
1717 { column = 'mgeom', type = 'multilinestring', projection = 4326 },
1818 { column = 'xgeom', type = 'multilinestring', projection = 4326 },
19+ { column = 'npoints', type = 'int' },
1920 })
2021
2122 function osm2pgsql.process_way(object)
2223 if object.tags.highway == 'motorway' then
2324 lines:insert({
2425 sgeom = object:as_linestring(),
2526 mgeom = object:as_multilinestring(),
26- xgeom = object:as_linestring()
27+ xgeom = object:as_linestring(),
28+ npoints = object:as_linestring():n_points(),
2729 })
2830 end
2931 end
@@ -32,9 +34,9 @@ Feature: Creating linestring features from way
3234 When running osm2pgsql flex
3335
3436 Then table osm2pgsql_test_lines contains exactly
35- | way_id | sgeom !geo | mgeom !geo | xgeom !geo |
36- | 20 | 1 , 2 , 3 | [ 1 , 2 , 3 ] | [ 1 , 2 , 3 ] |
37- | 21 | 4 , 5 | [ 4 , 5 ] | [ 4 , 5 ] |
37+ | way_id | sgeom !geo | mgeom !geo | xgeom !geo | npoints |
38+ | 20 | 1 , 2 , 3 | [ 1 , 2 , 3 ] | [ 1 , 2 , 3 ] | 3 |
39+ | 21 | 4 , 5 | [ 4 , 5 ] | [ 4 , 5 ] | 2 |
3840
3941 Scenario :
4042 Given the grid
0 commit comments