gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.54k stars 823 forks source link

Propose new railway station symbol #3782

Closed wodndb closed 2 years ago

wodndb commented 5 years ago

Bus stop logo looks like bus and taxi logo looks like taxi.

However railway station logo is not.

So I propose new railway station logo like below. (I draw these using Power Point)

train sample

imagico commented 5 years ago

Thanks for your suggestion.

At the moment railway stations and halts are not rendered with a pictorial symbol but with a square marker the meaning of which is meant to derive from context. This is rendered starting at z12 where a pictorial symbol in quite definitely not an option. If it makes sense to use a pictorial symbol at higher zoom level would need to be tested. Currently the same marker is used for railway and tram stops so this would also need to be considered.

In general symbols need to work at native resolution (typically 14 pixel in size) and therefore should be tested in that form. You might want to try out using Inkscape which is the typical tool used for symbol design here.

wodndb commented 5 years ago

@imagico I try to use inkscape for symbol design. And also I'm going to design another rail based transport stop symbol include tram. Thanks.

wodndb commented 5 years ago

How can I test symbol what I designed? I make svg format symbols using Inkscape, and below images are png files preview because github doesn't support svg file.

basic color: Station Logo Station Logo Inversed transport color: Station Logo 2 Station Logo 2 Inversed

jeisenbe commented 5 years ago

@wobndb - there are several ways you can test this new symbol properly.

A) The easy way: make a few different options for symbols to test, and then create a Zip archive. This can be directly uploaded here. You could ask one of the other contributors, like @Adamant36 or me, to make some test renderings for you.

However, this won't let you try different options directly, and it may take a while to get done.

B) The best way, although it requires the most time and work, is to create test renderings with Kosmtik, based on current Openstreetmap data from several different representantive places. This will also allow you to make a Pull Request here in this Github repository to actually change the code.

To do this, you would need to download data onto your computer and set up a test rendering server.

If you use Linux you can do this directly by following the step-by-step instructions in INSTALL.MD

For Mac and PC there is a Docker container option. This is what I use, on my 2012 Macbook.

For this option, I'm pretending that you know nothing about git or the command line, because this was the state of my knowledge a few months ago.

1) download Docker and install it.

2) Next, create a "fork" of this repository.

3) Clone the fork to your system: Open the Terminal application (Mac) or Command Prompt (PC). Change the directory to where you want the Openstreetmap files to go. (For example, create a folder called "osm" under your home directory, then type cd ~/osm/). Then enter git clone https://github.com/Your_User_Name/openstreetmap-carto.git - in my case this would be https://github.com/jeisenbe/openstreetmap-carto.git but you need to enter the actual name for your fork. You may be prompted to download command line tools or similar to use this command. This will make a new directory like ~/osm/openstreetmap-carto/ with all the information in this repository (about 30 or 40 megabytes?)

4) Download a file in the osm.pbf format for your area. Check https://download.geofabrik.de/ and https://download.openstreetmap.fr/extracts/ for options. You might want to pick a smaller province or small country if you are using an old computer with limited RAM and processing power. Alternatively you can download an osm.xml file of a small area directly from openstreetmap.org using the "export" function, or you can download data in JOSM and same as an .osm.pbf file. The name of the file should be changed to data.osm.pbf and it needs to be in the same directory ("folder"), eg '~/osm/openstreetmap-carto'

4) Now you are ready to set up everything on Docker. These next 2 commands will take a long time the first time you use them, and will download up to a Gigabyte of data, but the next time will be much faster.

Enter docker-compose up import in the command line (Terminal or Command Prompt)

This creates the whole Docker container and imports the openstreetmap data from data.osm.pbf into a special rendering database.

Once this is done, make a new tab or window and enter docker-compose up kosmtik - this starts up Kosmtik, the test rendering application. During this process nearly a gigabyte of data will need to be downloaded, but this only happens the first time.

5) View test renderings by opening an internet browser to http://localhost:6789 - or if you know exactly where you want to see, you can enter the zoom level, latitude and longitude like this: http://localhost:6789/openstreetmap-carto/#14/51.5000/-1.0000 - go find a place in your downloaded data that has a railway station.

This will show you how things look currently. But you want to change the icon for railway stations, so let's make a new branch:

6) In a new Command Prompt or Terminal window or tab, enter git checkout -b station-symbols - this creates a new "branch" called station-symbols where you can test different icons, and checks out the new branch.

7) Add your new SVG icons to your new openstreetmap-carto/symbols folder, for example railway_station1.svg and tram_stop1.svg. If you have a few different options, you can number them like railway_station1.svg and railway_station2.svg so you don't lose track.

7) Change the code for the railway station icon. Where is it? Try searching for "station" in the new /openstreetmap-carto folder - you'll find the code you want to change in station.mss:

  [railway = 'station'][zoom >= 12] {
    marker-file: url('symbols/square.svg');

Change marker-file: url('symbols/square.svg'); to marker-file: url('symbols/railway_station.svg');

(We should also change the railway halts and tram stops, but that can wait till later, once you decide if halts should use the same symbol.)

Once you've changed the code in a text editor, save the changes. Then go back to the Terminal (or Command Prompt) and enter: git add symbols/railway_station1.svg Then git commit -a -m 'Change icon for railway stations to railway_station1.svg'

This saves your changes to git, which will make it easy to fix things later and upload the changes to this github repository when you are ready.

8) Check out the test rendering by opening up the browser window to http://localhost:6789/openstreetmap-carto/ again and finding the railway station. Now if you are at the right zoom level, it will show your new icon.

If you don't see the changes, use the reload option, or go back to the command prompt / terminal window where you opened kosmtik (remember docker-compose up kosmtik) and type Ctrl-C to stop it, then use docker-compose up kosmtik to restart the test rendering - sometimes this is needed if you change an icon but don't change the name.

There's an option to "export" a png image from the Kosmtik test rendering, but it's best to take a partial screen shot, in most cases. Remember to name each test rendering with the details, like the zoom leve, the place tested and the name of the svg file and the date, e.g.: z15-kings-cross-railway_station1-2019-5-26

Now you can make more changes, for example, change the icon for [railway = 'tram_stop'] a few lines down, and also consider [railway = 'halt']. You can also do some more editing to the code so that the current square icon is used at lower zoom levels (z12 to z14) but the new icon is used at high zoom levels (>z15), eg:

[railway = 'station'][zoom >= 12] { marker-file: url('symbols/square.svg'); ... [zoom >= 15] { marker-file: url('symbols/railway_station1.svg'); This code will use the current symbol to render z12 to z14, but the new symbol for zoom level 15 and higher.

Remember to use git add symbol/name_of_your_icon.svg when you add a new icon in the code, and then use git commit -a -m '<description of your changes>' to record your work.

If you want compare the test rendering with the current rendering, you can switch branches: git checkout master to go back to the master (original) branch, and then git checkout station-symbols to switch to your railway station symbols testing branch.

It might also help to read: Docker.MD and CONTRIBUTING.md

wodndb commented 5 years ago

@jeisenbe I appreciate your detailed comment! I'm going to set rendering test server based on linux system.

jeisenbe commented 5 years ago

Great! And thank you, even though you probably didn't need the detailed instructions for Docker, since you are using Linux. :-)

If you have time, consider taking a look at some of the other open issues. You might find something interesting to fix.

Herea are a couple of things I wish I had known before making test renderings (Although you may know this already, if you've used git and github):

1) If you want to test several areas from different countries, the easiest option is to download the data in JOSM, and then save the file like stations.osm.xml in your openstreetmap-carto directory (folder). Then to import this for rendering, enter this command into the command line: docker-compose run -e OSM2PGSQL_DATAFILE=stations.osm.xml import (change stations.osm.xml to the actual name of the file. You can use .osm.xml or .osm.pbf files)

2) Sometimes it is much easier to test changes first with fake test data. After you get something that works and looks right, it can be tested on real data. @matthijsmelissen made this file, which I've updated: test.osm.xml.zip

3) Before submitting a PR (pull request), it's helpful to rebase your branch against the upstream master branch:

1st time only: git remote add upstream git://github.com/gravitystorm/openstreetmap-carto.git

To rebase, run: git fetch upstream Then git rebase upstream/master

If you've made lots of commits, you might want to clean up the history with an interactive rebase by "squashing" the commits that you didn't end up using (eg testing other icons or rendering styles that you later rejected):

git rebase -i upstream/master

Then you can push your branch, and you will be given an URL to open which will start a PR:

git push --set-upstream origin name-of-your-branch

But, don't use git rebase after you have already opened a pull request from the branch.

4) When opening a Pull Request, you will usually need to show a couple of test images as examples, and it's helpful to have a link to the location in the current openstreetmap.org rendering. Because of this, it's important to label your test rendering files carefully, if you make more than a couple.

5) Many of the maintainers (the users with the "collaborator" label next to their user name) here have a rather direct communication style. You may find that the criticism and comments are too direct or impolite, but remember that many of the maintainers are not writing in their first language and are used to a different way of communicating.

Adamant36 commented 5 years ago

Id be happy to test render any icons. So feel free to ping me if need be.

jeisenbe commented 5 years ago

@wodndb - there is now an updated list of 10 issues that would be worth trying for a first or second PR:

https://github.com/gravitystorm/openstreetmap-carto/labels/good%20first%20issue

wodndb commented 5 years ago

@jeisenbe Good issues.

Now I installed linux on my notebook.

And also I installed tools for setting rendering server and cloned this repository.

I'm going to test rendering server this weekend.

jeisenbe commented 5 years ago

Great! For Linux I don't have much experience, but @ircama made this tutorial which might be helpful: https://ircama.github.io/osm-carto-tutorials/ - it was last updated a year ago, so I think it should be mostly correct.

Adamant36 commented 5 years ago

I'm pretty knowledgeable about how to get things running etc in Linux thanks to like a month worth of mistakes when I first got started with the whole thing. So feel free to ask if you having questions or problems. Since I might know something about it.

wodndb commented 5 years ago

Maybe docker is easier than Linux.

I installed postGIS and download sample pbf file from Geofabrick. And now I'm install a lot of things for setting tile map server on linux.

@jeisenbe tutorial is very nice.

wodndb commented 5 years ago

I failed to run rendering server on linux, So I will try to use Docker.

psql: could not connect to server: Connection refused

I removed and reinstall postgresql, but error couldn't be fixed.

I can't use Docker on Windows because Docker Desktop support only Windows Pro or Enterprise.

So.. I think Docker on Linux is best choice now for testing server.

wodndb commented 5 years ago

Unfortunately, my desktop can't run docker tool box that can't support some AMD CPU.

I try to format my notebook and reinstall linux for rendering server.

jeisenbe commented 5 years ago

@wodndb were you able to get things working?

wodndb commented 5 years ago

@jaisenbe Not yet.. I'm following tutorial for setting rendering server. But my progress is too slow because I'm not good at linux system and my computer environment is not good to run server. I added additional RAM and harddisk to my desktop for rendering server. And I reinstall ubuntu and change ubuntu locale from KR to GB. There were several trials and errors to set environment for server.

If I fail to set server based on ubuntu virtual machine, I will buy windows pro to test docker

Adamant36 commented 5 years ago

I'm still willing to test render the icons if need be.

wodndb commented 5 years ago

liechtenstein I finally set rendering server on Ubuntu... : )

jeisenbe commented 4 years ago

@wodndb do you need help making the test renderings?

Adamant36 commented 4 years ago

@wodndb, can you create a Gist with your svg icons?

imagico commented 2 years ago

Closing this as no concrete suggestion has come out of this until now.

A concrete proposal with sample renderings would still be welcome - but would need to show benefits that outweigh the additional noise and use of space in the map.