Merge remote-tracking branch 'origin/master'

This commit is contained in:
artemp 2012-09-26 14:28:46 +01:00
commit be5a2c192f
2 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -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)