mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
be5a2c192f
@ -665,7 +665,9 @@ void csv_datasource::parse_csv(T & stream,
|
||||
}
|
||||
}
|
||||
|
||||
// now, add all values as attributes
|
||||
// now, add attributes, skipping any WKT or JSON fiels
|
||||
if ((has_wkt_field) && (i == wkt_idx)) continue;
|
||||
if ((has_json_field) && (i == json_idx)) continue;
|
||||
/* First we detect likely strings, then try parsing likely numbers,
|
||||
finally falling back to string type
|
||||
* We intentionally do not try to detect boolean or null types
|
||||
|
||||
@ -137,9 +137,9 @@ if 'csv' in mapnik.DatasourceCache.plugin_names():
|
||||
|
||||
def test_wkt_field(**kwargs):
|
||||
ds = get_csv_ds('wkt.csv')
|
||||
eq_(len(ds.fields()),2)
|
||||
eq_(ds.fields(),['type','WKT'])
|
||||
eq_(ds.field_types(),['str','str'])
|
||||
eq_(len(ds.fields()),1)
|
||||
eq_(ds.fields(),['type'])
|
||||
eq_(ds.field_types(),['str'])
|
||||
fs = ds.all_features()
|
||||
eq_(len(fs[0].geometries()),1)
|
||||
eq_(fs[0].geometries()[0].type(),mapnik.DataGeometryType.Point)
|
||||
@ -396,9 +396,9 @@ if 'csv' in mapnik.DatasourceCache.plugin_names():
|
||||
eq_(feat['Name'],u"Winthrop, WA")
|
||||
|
||||
def validate_geojson_datasource(ds):
|
||||
eq_(len(ds.fields()),2)
|
||||
eq_(ds.fields(),['type','GeoJSON'])
|
||||
eq_(ds.field_types(),['str','str'])
|
||||
eq_(len(ds.fields()),1)
|
||||
eq_(ds.fields(),['type'])
|
||||
eq_(ds.field_types(),['str'])
|
||||
fs = ds.all_features()
|
||||
eq_(len(fs[0].geometries()),1)
|
||||
eq_(fs[0].geometries()[0].type(),mapnik.DataGeometryType.Point)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user