whosonfirst / go-whosonfirst-pip-v2

An in-memory point-in-polygon (reverse geocoding) package for GeoJSON data, principally Who's On First data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

extras=geometry does not work

HIRANO-Satoshi opened this issue · comments

This issue is related to #16.

I need local names (e.g. name:jpn_x_preferred) and geometry of a point so that I can render the place using geometry coordinates in a map. How do I get both?

./bin/wof-pip-server -allow-extras -allow-geojson -mode sqlite -port 8300 ~/whosonfirst-data-sqlite/whosonfirst-data-latest.db

format=geojson&extras=name:jpn_x_preferred returns geometry but not :jpn_x_preferred.

curl 'http://localhost:8300?format=geojson&latitude=36.1&longitude=140.08&extras=name:jpn_x_preferred' | python -mjson.tool

format=json&extras=name:jpn_x_preferred,geometry returns name:jpn_x_preferred but not geometry.

curl 'http://localhost:8300?format=json&latitude=36.1&longitude=140.08&extras=name:jpn_x_preferred,geometry' | python -mjson.tool

format=geojson&extras=wof:name:jpn_x_preferred returns geometry but not wof:name:jpn_x_preferred.

curl 'http://localhost:8300?format=geojson&latitude=36.1&longitude=140.08&extras=wof:name:jpn_x_preferred' | python -mjson.tool

I think returning geometry data for the getByLatLon method is not a very good idea because the method is called often from a client and the geometry data is relatively large.

The geometry data could be cached and reused in the client. So, ideally, the pip-server could have a method that returns geoJSON data with geometry for a given id.

I should use format=geojson. Thanks.