vonvikken / svg-maps Goto Github PK
View Code? Open in Web Editor NEWRuby scripts used to create SVG maps from OpenStreetMap data
License: Apache License 2.0
Ruby scripts used to create SVG maps from OpenStreetMap data
License: Apache License 2.0
Remove relative paths from code:
svg-maps/lib/dataset_builder.rb
Line 71 in 72f40f1
svg-maps/lib/dataset_builder.rb
Line 112 in 72f40f1
svg-maps/lib/dataset_builder.rb
Line 130 in 72f40f1
svg-maps/lib/dataset_builder.rb
Line 170 in 72f40f1
svg-maps/lib/dataset_builder.rb
Line 178 in 72f40f1
Add the following text: <!-- Data extracted from OpenStreetMap - https://www.openstreetmap.org/copyright -->
to the generated SVG files.
Use CSS to define map style.
Use Logger facility instead of puts
.
Obtain a map of a given province, with boundaries of the internal comuni and of the neighbouring administrative entities.
For example arguments and return values.
When specifying one or more foreign nations, the application crashes with the following traceback:
Traceback (most recent call last):
6: from /home/vonvikken/svg-maps/prova.rb:35:in `<main>'
5: from /home/vonvikken/svg-maps/lib/svg_builder.rb:40:in `build_svg'
4: from /home/vonvikken/svg-maps/lib/svg_builder.rb:70:in `add_info_to_svg'
3: from /home/vonvikken/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/lib/nokogiri/xml/node_set.rb:237:in `each'
2: from /home/vonvikken/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/lib/nokogiri/xml/node_set.rb:237:in `upto'
1: from /home/vonvikken/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/lib/nokogiri/xml/node_set.rb:238:in `block in each'
/home/vonvikken/svg-maps/lib/svg_builder.rb:73:in `block in add_info_to_svg': undefined method `[]' for nil:NilClass (NoMethodError)
This happens because the foreign nations dataset currently have id
instead of @id
for the the ID field, so in the following line:
svg-maps/lib/metadata_reader.rb
Line 32 in cbcc1fe
p['@id']
returns nil
, hence the error.This method should have the same effect of -C
option, but using an existing province map instead of the -p
parameter for input.
It should be useful for specifying working directories or command line parameters (e.g. for the reprojection commands).
The maps should be copied in a folder with the same name of the province and each one should have its own comune highlighted.
Related to #13.
Hovering mouse cursor over a map feature displays its name.
rake
or nokogiri
are not downloaded automatically.data/out
not created automatically.Add the option to highlight a given comune in the map, provided its name or other code (e.g. ISTAT). The CSS style interest
is already defined.
Script for downloading regions should be able to select only some of them (e.g. to resume a partial download).
The maps should show the coastal lagunas of Venezia (Veneto) and Grado (Friuli-Venezia Giulia), plus the two lagunas of Orbetello (Toscana) and Valli di Comacchio (Emilia-Romagna).
Those lakes should have a tooltip text on hover.
Depends on #20, since manually downloading every dataset is too boring!
-l
or --lakes
flag)Write a wiki page about the procedures and complete the Readme.
Each file can reach up to a couple of MiB in size. Provide the option to simplify the generated polygons (via the MapShaper -simplify
option) and thus reduce the output size.
Dataset filenames are currently based on full region/country names, often including spaces and/or hyphens. Short names based on the corresponding codes used by the CLI should be used instead.
Add script to automate the following command:
mapshaper -i file.geojson -each 'admin_level=admin_level.toString();id=id.toString()' -o out.geojson
for each of the foreign country datasets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.