Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make __id__ column optional (it's required now) #217

Open
pnorman opened this issue Jun 10, 2017 · 1 comment
Open

Make __id__ column optional (it's required now) #217

pnorman opened this issue Jun 10, 2017 · 1 comment

Comments

@pnorman
Copy link
Contributor

pnorman commented Jun 10, 2017

When I try to serve data without an __id__ column I get the error

192.168.1.2 - - [09/Jun/2017 21:10:14] "GET /all/0/0/0.json HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/pnorman/osm/tilezen/tileserver/tileserver/__init__.py", line 148, in __call__
    response = self.handle_request(request)
  File "/home/pnorman/osm/tilezen/tileserver/tileserver/__init__.py", line 232, in handle_request
    self.post_process_data,
  File "/home/pnorman/osm/tilezen/tileserver/env/lib/python2.7/site-packages/tilequeue/process.py", line 243, in process_coord_no_format
    feature_id = row.pop('__id__')
KeyError: '__id__'

To get around this I added the column 0::bigint AS __id__, but I shouldn't need to do this. Not all data sources have meaningful IDs, or you might not want to include them in the output.

My queries file is

all:
  - water
layers:
  water:
    template: water.jinja2
    start_zoom: 0
    geometry_types: [Polygon]

and water.jinja2 is

SELECT
    {% filter geometry %}{{ bounds['polygon']|bbox_padded_intersection('way') }}{% endfilter %} AS __geometry__,
    0::bigint AS __id__
  FROM ne_ocean
  WHERE {{ bounds['polygon']|bbox_filter('way',3857) }}
@nvkelso
Copy link
Member

nvkelso commented Jun 10, 2017 via email

@nvkelso nvkelso changed the title __id__ column required Make __id__ column optional (it's required now) Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants