Components
The components affect are all aspects of the system that deal with the map domain, the parsing, rendering and editing of map components.
The java code that deals with openstreetmap and allows to edit has hard coded constants that limit how the app can be used.
Proposal
The proposal is to strip out all the code that contains hard coded resources like "restaurant" and attributes like "Internet" and put them into a datafile the defines what the resources are , what attributes they support and how to render them. The app will then read that definition file in an be able to be extended for more types of data easily. The duplication of code will be reduced.
Code Review
The java code has a lot of copy and past of string tags that could be consolidated like this.
The list of tags to support does not need to be in the java code and can be read from a property file in this location https://github.com/CityZenApp/Android-Development/blob/master/CityZenApp/app/src/main/java/com/cityzen/cityzen/ApplicationConstants.java
There are switches based on the tags that would be better represented as property files like this one https://github.com/CityZenApp/Android-Development/blob/master/CityZenApp/app/src/main/java/com/cityzen/cityzen/Adapters/ParcelablePoiListAdapter.java
this code is duplicated here leading to higher maintenance costs:
https://github.com/CityZenApp/Android-Development/blob/master/CityZenApp/app/src/main/java/com/cityzen/cityzen/Adapters/PlaceListAdapter.java
This lookup can have internet could also be put into a resource file, or some other description of the types of data outside of the code.
https://github.com/CityZenApp/Android-Development/blob/master/CityZenApp/app/src/main/java/com/cityzen/cityzen/Fragments/EditPoiFragment.java
It is also duplicated here:
https://github.com/CityZenApp/Android-Development/blob/master/CityZenApp/app/src/main/java/com/cityzen/cityzen/Fragments/CreatePoiFragment.java#L464
Mockups / Examples
See the website here http://visualtags.hotosm.org/collection/3 with the xml file give
<group name="Food+Drinks" icon="presets/restaurant.png">
<item name="Restaurant" icon="presets/restaurant.png" type="node,relation">
<link href="http://wiki.openstreetmap.org/wiki/Tag:amenity=restaurant"/>
<label text="Edit Restaurant"/>
<key key="amenity" value="restaurant"/>
<text key="name" text="Name"/>
<space/>
<text key="operator" text="Operator"/>
<multiselect key="cuisine" text="Cuisine" values="italian;chinese;pizza;burger;greek;german;indian;regional;kebab;turkish;asian;thai;mexican;japanese;french;sandwich;sushi"/>
<check key="microbrewery" text="Microbrewery" default="off"/>
<text key="opening_hours" text="Opening Hours"/>
<combo key="stars" text="Stars" values="1,2,3,4,5,6,7"/>
<space/>
<combo key="internet_access" text="Internet access" values="yes,wlan,wired,terminal,no"/>
<space/>
Something like the yaml file here could be used to describe the tags and attributes of them
https://github.com/sozialhelden/wheelmap-open-source/blob/master/spec/fixtures/node_types.yml
or this yaml
https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/mapping.yaml
This file is for presets of an editor
https://github.com/dittaeva/vespucci/blob/master/assets/preset.xml
Here is a more formal definition of the pois
https://github.com/iocast/poiservice/blob/master/resources/osm_skos4.xml
This is another list of tags and values
https://github.com/jsydow/tracebook/blob/master/TraceBook/res/raw/tags_en.xml
Here is a chart I worked on in the past
https://github.com/h4ck3rm1k3/FOSM-Api/blob/master/OSM-API-Proxy/rdf/OSM_Open_Map_Features_Spreadsheet-Wiki%20OSM%20Features%20Chart-1.csv
Benefits
The benefits are that you can abstractly define new POIs or reuse existing datasets and make your program more flexible and usable.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @h4ck3rm1k3st33m I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit