-
Notifications
You must be signed in to change notification settings - Fork 10
Adding Label Feature Type
Before adding a new feature you should do some rudimentary research about it on wiki.openstreetmap.org. The OSM wiki provides an overview about different kinds of types of Points of Interest and their required and recommended tags. With all that said please be advised that often those guidelines are not followed and you should use the tools provided to get a better overview about the data (e.g. use metahelper_* function (see below))
- copy the template and rename it.
- follow the todos and fill it to the best of your knowledge
- only fill the where field for now the concrete attributes can be filled out later
- if you need help with the WHERE clause I advise you to use the test.sql and a simple SELECT query to find the best selection for your POIs.
- execute the sql (this should create a metahelper_* class)
psql alpinemaps -U alpine -f yourfile.sql
- create and execute a query with the metahelper function to get an overview of your data
SELECT * from metahelper_<YOUR_POI>(10,10) ORDER BY entries_with_values DESC;
psql alpinemaps -U alpine -f test.sql > your_poi_data.csv
- Analyze the resulting csv file
- add the properties of your choosing to the hstore (field data) and also add them at the final *_tile function
- you also should use COALESCE to combine similar fields together (e.g. the link to the webcam image was distributed between 'contact:webcam', 'image', and 'contact:website')
- finally execute the sql again and add the final *_tile function to the 99_combine.sql (and execute the sql of this file too)
- (optional) add the tile to the config.yaml (since we are using the 99_combine.sql this is not necessary)
- execute the update_docker.sh script so that all the caches are renewed and the new tile data will be send
The icons we are currently using are osm-carto icons (https://github.com/gravitystorm/openstreetmap-carto). Find the desired icon for the type and put the svg into the app/icons/labels/ folder.
Since the repo only provides svg files use the following command to create a png file with similar dimensions and dpi as the other icons:
convert -density 1200 -resize 32x32 -background none peak.svg peak.png
After this go to the nucleus/CMakeLists.txt file and add the new png to the list of map_icons qt resources.
- add the type in the FeatureType enum
- add a new FeatureTXT* struct with the appropriate properties and create the parse and labelText function
- add parser method to feature_types_factory
- add the icon to get_label_icons method
- add properties to FilterDefinitions struct
- e.g. m_*_visible and other attributes
- create QProperties and appropriate getter/setter in the LabelFilter class and write the necessary methods in the cpp file
- add appropriate GUI elements to the qml that manipulate the freshly created QProperties
- add the filters of your choice to the apply_filter method (in a similar fashion to the existing filters)