pass
elif h == 'osm':
assert_equal(res['osm_type'], row[h][0])
- assert_equal(res['osm_id'], row[h][1:])
+ assert_equal(res['osm_id'], int(row[h][1:]))
elif h == 'centroid':
x, y = row[h].split(' ')
assert_almost_equal(float(y), float(res['lat']))
self.result = geojson_results_to_json_results(self.result)
def parse_geocodejson(self):
- return self.parse_geojson()
+ self.parse_geojson()
+ if self.result is not None:
+ self.result = [r['geocoding'] for r in self.result]
def parse_html(self):
content, errors = tidy_document(self.page,
self.result = geojson_results_to_json_results(self.result[0])
def parse_geocodejson(self):
- return self.parse_geojson()
+ self.parse_geojson()
+ if self.result is not None:
+ self.result = [r['geocoding'] for r in self.result]
def parse_xml(self):
et = ET.fromstring(self.page)
"""
cmd = ['/usr/bin/env', 'php']
cmd.append(os.path.join(context.nominatim.build_dir, 'utils', 'query.php'))
- cmd.extend(['--search', query])
+ if query:
+ cmd.extend(['--search', query])
# add more parameters in table form
if context.table:
for h in context.table.headings:
if fmt == 'json ':
outfmt = 'json'
+ elif fmt == 'jsonv2 ':
+ outfmt = 'json'
elif fmt == 'geojson ':
outfmt = 'geojson'
+ elif fmt == 'geocodejson ':
+ outfmt = 'geocodejson'
else:
outfmt = 'xml'