@@ -27,7 +27,7 @@ def test_geojson_init():
2727 def test_geojson_properties ():
2828 ds = mapnik .Datasource (type = 'geojson' ,file = '../data/json/escaped.geojson' )
2929 f = ds .features_at_point (ds .envelope ().center ()).features [0 ]
30- eq_ (len (ds .fields ()),9 )
30+ eq_ (len (ds .fields ()),7 )
3131 desc = ds .describe ()
3232 eq_ (desc ['geometry_type' ],mapnik .DataGeometryType .Point )
3333
@@ -39,16 +39,10 @@ def test_geojson_properties():
3939 eq_ (f ['boolean' ], True )
4040 eq_ (f ['NOM_FR' ], u'Qu\xe9 bec' )
4141 eq_ (f ['NOM_FR' ], u'Québec' )
42- eq_ (f ['array' ], u'[[[1],["deux"]],[["\\ u0442\\ u0440\\ u0438","four","\\ u4e94"]]]' )
43- array = json .loads (f ['array' ])
44- eq_ (array ,[[[1 ], [u'deux' ]], [[u'\u0442 \u0440 \u0438 ' , u'four' , u'\u4e94 ' ]]])
45- eq_ (f ['object' ], u'{"value":{"type":"\\ u041c\\ u0430pni\\ u043a","array":[3,0,"x"]}}' )
46- object = json .loads (f ['object' ])
47- eq_ (object ,{u'value' : {u'array' : [3 , 0 , u'x' ], u'type' : u'\u041c \u0430 pni\u043a ' }})
4842
4943 ds = mapnik .Datasource (type = 'geojson' ,file = '../data/json/escaped.geojson' )
5044 f = ds .all_features ()[0 ]
51- eq_ (len (ds .fields ()),9 )
45+ eq_ (len (ds .fields ()),7 )
5246
5347 desc = ds .describe ()
5448 eq_ (desc ['geometry_type' ],mapnik .DataGeometryType .Point )
@@ -61,17 +55,10 @@ def test_geojson_properties():
6155 eq_ (f ['boolean' ], True )
6256 eq_ (f ['NOM_FR' ], u'Qu\xe9 bec' )
6357 eq_ (f ['NOM_FR' ], u'Québec' )
64- eq_ (f ['array' ], u'[[[1],["deux"]],[["\\ u0442\\ u0440\\ u0438","four","\\ u4e94"]]]' )
65- array = json .loads (f ['array' ])
66- eq_ (array ,[[[1 ], [u'deux' ]], [[u'\u0442 \u0440 \u0438 ' , u'four' , u'\u4e94 ' ]]])
67- eq_ (f ['object' ], u'{"value":{"type":"\\ u041c\\ u0430pni\\ u043a","array":[3,0,"x"]}}' )
68- object = json .loads (f ['object' ])
69- eq_ (object ,{u'value' : {u'array' : [3 , 0 , u'x' ], u'type' : u'\u041c \u0430 pni\u043a ' }})
70-
7158 def test_large_geojson_properties ():
7259 ds = mapnik .Datasource (type = 'geojson' ,file = '../data/json/escaped.geojson' ,cache_features = False )
7360 f = ds .features_at_point (ds .envelope ().center ()).features [0 ]
74- eq_ (len (ds .fields ()),9 )
61+ eq_ (len (ds .fields ()),7 )
7562 desc = ds .describe ()
7663 eq_ (desc ['geometry_type' ],mapnik .DataGeometryType .Point )
7764
@@ -83,16 +70,10 @@ def test_large_geojson_properties():
8370 eq_ (f ['boolean' ], True )
8471 eq_ (f ['NOM_FR' ], u'Qu\xe9 bec' )
8572 eq_ (f ['NOM_FR' ], u'Québec' )
86- eq_ (f ['array' ], u'[[[1],["deux"]],[["\\ u0442\\ u0440\\ u0438","four","\\ u4e94"]]]' )
87- array = json .loads (f ['array' ])
88- eq_ (array ,[[[1 ], [u'deux' ]], [[u'\u0442 \u0440 \u0438 ' , u'four' , u'\u4e94 ' ]]])
89- eq_ (f ['object' ], u'{"value":{"type":"\\ u041c\\ u0430pni\\ u043a","array":[3,0,"x"]}}' )
90- object = json .loads (f ['object' ])
91- eq_ (object ,{u'value' : {u'array' : [3 , 0 , u'x' ], u'type' : u'\u041c \u0430 pni\u043a ' }})
9273
9374 ds = mapnik .Datasource (type = 'geojson' ,file = '../data/json/escaped.geojson' )
9475 f = ds .all_features ()[0 ]
95- eq_ (len (ds .fields ()),9 )
76+ eq_ (len (ds .fields ()),7 )
9677
9778 desc = ds .describe ()
9879 eq_ (desc ['geometry_type' ],mapnik .DataGeometryType .Point )
@@ -105,12 +86,6 @@ def test_large_geojson_properties():
10586 eq_ (f ['boolean' ], True )
10687 eq_ (f ['NOM_FR' ], u'Qu\xe9 bec' )
10788 eq_ (f ['NOM_FR' ], u'Québec' )
108- eq_ (f ['array' ], u'[[[1],["deux"]],[["\\ u0442\\ u0440\\ u0438","four","\\ u4e94"]]]' )
109- array = json .loads (f ['array' ])
110- eq_ (array ,[[[1 ], [u'deux' ]], [[u'\u0442 \u0440 \u0438 ' , u'four' , u'\u4e94 ' ]]])
111- eq_ (f ['object' ], u'{"value":{"type":"\\ u041c\\ u0430pni\\ u043a","array":[3,0,"x"]}}' )
112- object = json .loads (f ['object' ])
113- eq_ (object ,{u'value' : {u'array' : [3 , 0 , u'x' ], u'type' : u'\u041c \u0430 pni\u043a ' }})
11489
11590 def test_geojson_from_in_memory_string ():
11691 # will silently fail since it is a geometry and needs to be a featurecollection.
@@ -126,7 +101,7 @@ def test_geojson_from_in_memory_string():
126101# @raises(RuntimeError)
127102 def test_that_nonexistant_query_field_throws (** kwargs ):
128103 ds = mapnik .Datasource (type = 'geojson' ,file = '../data/json/escaped.geojson' )
129- eq_ (len (ds .fields ()),9 )
104+ eq_ (len (ds .fields ()),7 )
130105 # TODO - this sorting is messed up
131106 #eq_(ds.fields(),['name', 'int', 'double', 'description', 'boolean', 'NOM_FR'])
132107 #eq_(ds.field_types(),['str', 'int', 'float', 'str', 'bool', 'str'])
0 commit comments