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

Added query for placename-small from the way table #427

Closed
wants to merge 2 commits into from
Closed

Added query for placename-small from the way table #427

wants to merge 2 commits into from

Conversation

chrisfleming
Copy link
Contributor

Still think there is some work to do on this one, but I'm putting this out there for discussion.

This adds a query via a UNION to the placenames-small

I've have some things that need discussion, I've not included town or city for now a the polygon table does not include the capital column.

Also for now I have excluded landuse, as labels are already added for these, but I think I should make this the other way around.

@matthijsmelissen
Copy link
Collaborator

@chrisfleming I miss in your PR description what you are trying to achieve. I suppose it is something like 'render name of minor places only mapped as polygon'? How will this work with minor places that are mapped as both point and polygon? I don't know if there are many of these?

@pnorman What do you think of this PR?

@chrisfleming
Copy link
Contributor Author

@math1985 Yes - placenames should be rendered from closed ways as well as nodes. I was hoping to get some feedback, on this overall. There are some issues around this, I've not quite worked out how to link to them.

I came across this when I did some work to define area's for various suburbs to help nominatim get the right area rather than going to the correct node. But we now have nodes and area's. At the moment names are drawn from the area, but on some of the other renders such as the opencyclemap clearly both are rendered so we have duplicate names.

originally I had planned on removing the nodes, but the other option might be to write the SQL so that we can remove possible duplicates.

@chrisfleming
Copy link
Contributor Author

This would fix #103

@Rovastar
Copy link
Contributor

I think @pnormal is working on something very similar with this in the last few hours he submitted this pull request for review.

#538

@pnorman
Copy link
Collaborator

pnorman commented May 20, 2014

I'm probably going to reimplement like I did #538, but the SQL as written isn't ideal

(SELECT way,place,name
    FROM planet_osm_point
    WHERE place IN ('suburb','village','hamlet','neighbourhood','locality','isolated_dwelling','farm') 
      AND name IS NOT NULL  
  UNION 
  SELECT way,place,name
    FROM planet_osm_polygon
    WHERE place IN ('suburb','village','hamlet','neighbourhood','locality','isolated_dwelling', 'farm') 
      AND landuse IS NULL AND name IS NOT NULL) as placenames_small

Doing a UNION instead of UNION ALL forces an entirely unnecessary deduplication

A name IS NOT NULL is probably unnecessary, 1.8% of 2.4M points have null name. 20% of polygons have null name, but only 140k of those so I doubt there's need to filter.

I'm skeptical about landuse IS NULL check. Is it for performance, or to exclude something?

@matthijsmelissen
Copy link
Collaborator

As @pnorman has made more progress with this issue in #538, I will close the issue here.

@matthijsmelissen
Copy link
Collaborator

@chrisfleming Thank you for your effort though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants