Code Monkey home page Code Monkey logo

svg-maps's People

Contributors

vonvikken avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

svg-maps's Issues

Create SVG map from GeoJSON data

  • Extract metadata from GeoJson.
  • Convert the GeoJSON file to SVG.
  • Remove unwanted elements from SVG.
  • Add relevant info and metadata to SVG.

Enhance usability

  • Use script for downloading states datasets.
  • Use a menu/wizard for initial configuration.
  • #28

Application crashes when including foreign nations

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:

feats.map { |feat| feat['properties'] }.each { |p| a_p << [p['@id'], p] }

the code p['@id'] returns nil, hence the error.

Add config file

It should be useful for specifying working directories or command line parameters (e.g. for the reprojection commands).

Several usability bugs

  • Dependencies such rake or nokogiri are not downloaded automatically.
  • Directory data/out not created automatically.

Add coastal lagoons

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).

Add major lakes to SVG maps

Those lakes should have a tooltip text on hover.

Depends on #20, since manually downloading every dataset is too boring!

  • Script to download datasets.
  • Add lakes to maps (optionally with the -l or --lakes flag).

Add options to simplify the map polygons

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.

Simplify dataset filenames

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 fix script for foreign countries datasets

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.