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 power to landuse, landuse-labels #186

Closed
5 tasks done
nvkelso opened this issue Sep 10, 2015 · 13 comments
Closed
5 tasks done

Add power to landuse, landuse-labels #186

nvkelso opened this issue Sep 10, 2015 · 13 comments
Assignees

Comments

@nvkelso
Copy link
Member

nvkelso commented Sep 10, 2015

We're missing polygons and labels for large power generating stations.

https://taginfo.openstreetmap.org/keys/power?filter=relations#values

These three values seem to be the useful ones:

  • plant
  • generator
  • substation

For these 2 deprecated values, let's recast them into substation landuse kind.

  • station
  • sub_station

Places to change:

And maybe somewhere else, do we need new indexes? @rmarianski for comment.

@rmarianski
Copy link
Member

do we need new indexes?

Doesn't look like we'll need new indexes, but the mz_calculate_is_landuse function will need to start accepting the power tag.

@nvkelso nvkelso modified the milestone: Compilation 2.0 Sep 10, 2015
@zerebubuth zerebubuth self-assigned this Sep 11, 2015
@zerebubuth
Copy link
Member

@nvkelso, what's an appropriate order for power "landuse" polygons? the same as commercial / hospital / etc... (2)?

@rmarianski, for folding in the station/sub_station values - you'd prefer that done in Python rather than the SQL, right?

@rmarianski
Copy link
Member

for folding in the station/sub_station values - you'd prefer that done in Python rather than the SQL, right?

If it's just a coalesce, then I think doing it in sql is fine, and some of the existing queries do it there too. If the logic is more complex though, imho it's easier to maintain in python.

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

Are we exporting the calculated landuse sort key now? That should have been included in last the road intercut work, but I don't see it.

@zerebubuth
Copy link
Member

If it's just a coalesce, then I think doing it in sql is fine, and some of the existing queries do it there too. If the logic is more complex though, imho it's easier to maintain in python.

Sadly not, it would be CASE WHEN ... END, so I'll do it in Python. The only downside to that is that if we end up having more than one value "station" then we'll have lost the link back to the "power" key. But we can cross that bridge when we get to it.

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

@nvkelso, what's an appropriate order for power "landuse" polygons? the same as commercial / hospital / etc... (2)?

In this section:
https://github.com/mapzen/TileStache/blob/integration-1/TileStache/Goodies/VecTiles/transform.py#L688-L717

We generally default to 1 except for features we know need to stack on top of another larger landuse. If you look at the Presideo in San Francisco you'll see both a golf course and a cemetery inside of the large park. So park gets 1 and golf_course and cemetery both get sort order of 2.

For power variants of landuse, can we assume they are always at the bottom of the stacking order? I think generally speaking maybe, but it seems like something like a substation wouldn't be cut out of an enclosing landuse like park or urban.

@zerebubuth
Copy link
Member

For power variants of landuse, can we assume they are always at the bottom of the stacking order? I think generally speaking maybe, but it seems like something like a substation wouldn't be cut out of an enclosing landuse like park or urban.

Sounds like you think this would be appropriate:

plant: 1
generator: 1
substation: 2

?

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

In that direction, yeah. Expanding on this thread, something like this is probably more right:

kind    orig    new alpha_sort_orig alpha_sort_new
    'aerodrome' 2   4   1   1
    'apron' 3   5   2   2
    'cemetery'  2   4   3   3
    'commercial'    2   4   4   4
    'conservation'  1   2   5   5
    'farm'  1   3   6   6
    'farmland'  1   3   7   7
    'forest'    1   3   8   8
    'generator'     3   29  9
    'golf_course'   2   4   9   10
    'hospital'  2   4   10  11
    'nature_reserve'    1   2   11  12
    'park'  1   2   12  13
    'parking'   2   4   13  14
    'pedestrian'    2   4   14  15
    'place_of_worship'  2   4   15  16
    'plant'     3   28  17
    'playground'    2   4   16  18
    'railway'   2   4   17  19
    'recreation_ground' 1   4   18  20
    'residential'   1   1   19  21
    'retail'    2   4   20  22
    'runway'    3   5   21  23
    'rural' 1   1   22  24
    'school'    2   4   23  25
    'stadium'   1   3   24  26
    'substation'        4   30  27
    'university'    2   4   25  28
    'urban' 1   1   26  29
    'zoo'   2   4   27  30

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

I'm seeing features like 'meadow' in the road intercut landuse_kind values, what do things default to if they aren't listed in the sort function?

@zerebubuth
Copy link
Member

I'm not sure that's hooked up correctly anyway. And it won't work at all if you're not seeing an 'order' element on the "landuse" polygons... I think this should go in as a separate issue.

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

Something like: tilezen/TileStache@6624ec9

@zerebubuth
Copy link
Member

Before:

power_landuse_before

After #199:

power_landuse_after

Using this in the scene.yaml:

    landuse:
        data: { source: osm }
        draw:
            polygons:
                order: 1
                color: '#aaffaa'
        power:
          filter: { kind: [plant, generator, substation] }
          draw:
            polygons:
              order: 2
              color: '#801010'

@nvkelso
Copy link
Member Author

nvkelso commented Sep 11, 2015

All related PR have been merged.

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

3 participants