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

Nautical spritesheet #1

Open
PetersonGIS opened this issue Jan 18, 2018 · 4 comments
Open

Nautical spritesheet #1

PetersonGIS opened this issue Jan 18, 2018 · 4 comments
Assignees

Comments

@PetersonGIS
Copy link
Collaborator

PetersonGIS commented Jan 18, 2018

Source Icons

Sea charts are icon-heavy, with much of the usefulness of the chart embedded as information in these icons as shapes and colors. The 224 SVG files found here will be the foundation for our spritesheet to house these icons.

Process

A custom exporter for Mapbox GL is used with TexturePacker software to export to the desired format. This makes it easy to recreate and/or add on to the spritesheet as needed.

Issues

  • Colors. Mapbox GL does not yet support on-the-fly SVG color assignments. The icon set we have does not contain all the colors needed. These will have to be manually generated from the existing set and then added to the spritesheet. The spritesheet will be quite large. Only one spritesheet per map style is allowed.
  • Names. Consideration as to the name of each icon needs to be made up-front so as to make sure the names match what is in the data. For example, the main name of the icon should be the same as the "type" column in the database and a color name should also be appended so that can be fetched in the style code as a variable as well. Once the database is put together this bullet can be fleshed out with real examples.
  • Stacked icons. Some of the icons in the sea charts are combinations of icons. For example, the icon in the upper left of this example appears to be made up of Spar.svg and Top_lsol.svg. This needs to be looked into further and could be outside the scope of a proof-of-concept map since stacking behavior could be difficult to implement in Mapbox GL such that it produces a consistent visual quality throughtout the map.
    stackedicon
@PetersonGIS PetersonGIS self-assigned this Jan 18, 2018
@PetersonGIS
Copy link
Collaborator Author

PetersonGIS commented Jan 31, 2018

The spritesheet names use underscores. For example, green_red_green.
The database uses semicolons instead. For example, green;red;green.

Styling is easiest when sprite names match the database so one or the other will need to change to match eventually.

Use sql replace in the config.toml?

@PetersonGIS
Copy link
Collaborator Author

PetersonGIS commented Jan 31, 2018

Also need to replace ", " with "_"
And replace" " with "_"in the shape column.

@erictheise
Copy link
Member

Keep 'em coming, @PetersonGIS, these are great.

@PetersonGIS
Copy link
Collaborator Author

We can do the replacement in the config.toml like this:
`
[[providers.layers]]

name = "beacon_cardinal"
geometry_fieldname = "geometry"
id_fieldname = "osm_id"
sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, type, name, category, REPLACE(colour, ';', '_') as colour2, colour_pattern, construction, elevation, height, reflectivity, shape, daymark_category, daymark_colour, daymark_colour_pattern, daymark_shape, topmark_category, topmark_colour, topmark_colour_pattern, topmark_shape FROM osm_beacon_cardinal WHERE geometry && !BBOX!"`

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

2 participants