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

add intermittent water flag #721

Merged
merged 7 commits into from
Apr 19, 2016
Merged

add intermittent water flag #721

merged 7 commits into from
Apr 19, 2016

Conversation

nvkelso
Copy link
Member

@nvkelso nvkelso commented Apr 15, 2016

Connects to: #668.

  • add intermittent to water selections
  • [doc] add intermittent note to water layer
  • [test] add tests for intermittent water

Don't believe a migration is necessary.

@nvkelso nvkelso added this to the v0.10.0 milestone Apr 15, 2016
@zerebubuth
Copy link
Member

Would it be possible to use the YAML for this?

@nvkelso
Copy link
Member Author

nvkelso commented Apr 15, 2016

Yes and no. The intermittent value could be present on almost any water features type, so seemed easier to include it at the query level instead.

If we were to do YAML setup, something like this on every one?

    output:
      {kind: stream}
      intermittent: {col: intermittent}

@zerebubuth
Copy link
Member

Where there's a set of common features, I've been using the globals section to make an anchor which then gets pulled into each relevant output. This is just one output, so that may or may not be worth it.

The curly braces around the kind aren't needed:

    output:
      kind: stream
      intermittent: {col: tags->intermittent}

I think intermittent is not a full column, so likely to find it in the tags.

@nvkelso
Copy link
Member Author

nvkelso commented Apr 15, 2016

Nice, thanks for the globals tip! I'll rewrite and update the PR.

@nvkelso nvkelso assigned nvkelso and unassigned zerebubuth Apr 15, 2016
@nvkelso
Copy link
Member Author

nvkelso commented Apr 19, 2016

@zerebubuth I've updated to the YAML syntax, but I get a few errors :(

I've pushed my latest to this branch. Note you recommended intermittent: {col: tags->intermittent} but in my DB it's a top-level attribute so I've done intermittent: {col: intermittent} instead.

  1. When updating the functions, using $ python create-sql-functions.py | psql osm, I get errors:
CREATE FUNCTION
ERROR:  parameter name "intermittent" used more than once
ERROR:  parameter name "intermittent" used more than once
CREATE FUNCTION
  1. Similarly, tiles now 500 for the tests:
127.0.0.1 - - [19/Apr/2016 00:49:11] "GET /water/16/12368/26272.json HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/nvkelso/git-repos/tileserver/tileserver/__init__.py", line 188, in __call__
    response = self.handle_request(request)
  File "/Users/nvkelso/git-repos/tileserver/tileserver/__init__.py", line 275, in handle_request
    feature_data_all = self.data_fetcher(coord, self.layer_config.all_layers)
  File "/Library/Python/2.7/site-packages/tilequeue/query.py", line 195, in __call__
    raise async_exception
ProgrammingError: function mz_calculate_output_water_(unknown, unknown, text, text, text, text, text, text, text, text, unknown, hstore) does not exist
LINE 1: SELECT mz_calculate_output_water_(
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT mz_calculate_output_water_(
        NULL,
        NULL,
        row."amenity",
        row."intermittent",
        row."landuse",
        row."leisure",
        row."name",
        row."natural",
        row."place",
        row."waterway",
        NULL,
        row.tags)
CONTEXT:  PL/pgSQL function mz_calculate_output_water(planet_osm_polygon) line 5 at RETURN

@nvkelso nvkelso assigned zerebubuth and unassigned nvkelso Apr 19, 2016
@zerebubuth
Copy link
Member

The issue was that you were including the intermittent column in water_standard_properties_osm in filters which had table: ne set. Since features come from only one table, it's not possible to mix properties from one table with another. And, at the moment, the code isn't sophisticated enough to be able to detect that and issue a more appropriate warning.

I fixed that for you in 5e6947b and also merged master, which resolved issues for me with master having some changes to TileStache which weren't reflected in this branch.

@zerebubuth zerebubuth assigned nvkelso and unassigned zerebubuth Apr 19, 2016
@nvkelso
Copy link
Member Author

nvkelso commented Apr 19, 2016

Verified all tests pass, merging. Thanks for the corrections :)

@nvkelso nvkelso merged commit b33e2bf into master Apr 19, 2016
@nvkelso nvkelso deleted the nvkelso/intermittent-water branch April 19, 2016 20:37
@nvkelso nvkelso removed the in review label Apr 19, 2016
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

Successfully merging this pull request may close these issues.

2 participants