libgd-gis 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +78 -31
- data/examples/america-peaks.rb +42 -0
- data/examples/asia-peaks.rb +42 -0
- data/examples/av_ramirez.rb +34 -0
- data/examples/europe-peaks.rb +42 -0
- data/examples/heladerias.json +47 -0
- data/examples/heladerias.rb +40 -0
- data/examples/ice-cream.jpg +0 -0
- data/examples/ice-cream.png +0 -0
- data/examples/montanas.rb +118 -0
- data/examples/output/america.png +0 -0
- data/examples/output/asia.png +0 -0
- data/examples/output/europe.png +0 -0
- data/examples/output/heladerias_parana.png +0 -0
- data/examples/output/museos_parana.png +0 -0
- data/examples/output/world_peaks-s.png +0 -0
- data/examples/output/world_peaks.png +0 -0
- data/examples/parana_museos.rb +49 -0
- data/examples/peak.png +0 -0
- data/examples/picks.json +50 -0
- data/examples/street/1.osm +207517 -0
- data/examples/street/av-ramirez.osm +207517 -0
- data/examples/street/av-ramirez.png +0 -0
- data/examples/street/av_ramirez-0.1346843780815251.png +0 -0
- data/examples/street/av_ramirez-3.png +0 -0
- data/examples/street/av_ramirez.png +0 -0
- data/examples/street/av_ramirez.rb +46 -0
- data/examples/street/avramirez.geojson +9 -0
- data/examples/street/dot.png +0 -0
- data/examples/street/download.sh +18 -0
- data/examples/street/draw.rb +46 -0
- data/examples/street/fonts/DejaVu Fonts License.txt +97 -0
- data/examples/street/fonts/DejaVuSans-Bold.ttf +0 -0
- data/examples/street/fonts/DejaVuSans-BoldOblique.ttf +0 -0
- data/examples/street/fonts/DejaVuSans-ExtraLight.ttf +0 -0
- data/examples/street/fonts/DejaVuSans-Oblique.ttf +0 -0
- data/examples/street/fonts/DejaVuSans.ttf +0 -0
- data/examples/street/fonts/DejaVuSansCondensed-Bold.ttf +0 -0
- data/examples/street/fonts/DejaVuSansCondensed-BoldOblique.ttf +0 -0
- data/examples/street/fonts/DejaVuSansCondensed-Oblique.ttf +0 -0
- data/examples/street/fonts/DejaVuSansCondensed.ttf +0 -0
- data/examples/street/map.osm +9158 -0
- data/examples/street/mark.png +0 -0
- data/examples/street/parana.json +100 -0
- data/examples/street/parana.rb +30 -0
- data/examples/street/parana_areas.png +0 -0
- data/examples/street/query.overpass +8 -0
- data/examples/street/ramirez.geojson +355 -0
- data/examples/street/ramirez_big.geojson +9959 -0
- data/examples/street/ramirez_full.geojson +76 -0
- data/examples/street/ramirez_full.png +0 -0
- data/examples/street/ramirez_gis.png +0 -0
- data/examples/street/ramirez_osm.png +0 -0
- data/examples/street/ramirez_osm_full.png +0 -0
- data/examples/street/ramirez_polyline.png +0 -0
- data/examples/street/ramirez_road.png +0 -0
- data/examples/street/test_carto_dark.png +0 -0
- data/examples/street/test_osm_fr.png +0 -0
- data/examples/street/test_polygon.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10874_19433.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10874_19434.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10874_19435.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10874_19436.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10875_19433.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10875_19434.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10875_19435.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10875_19436.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10876_19433.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10876_19434.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10876_19435.png +0 -0
- data/examples/street/tmp/tiles/carto_dark_15_10876_19436.png +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10874_19433.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10874_19434.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10874_19435.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10874_19436.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10875_19433.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10875_19434.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10875_19435.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10875_19436.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10876_19433.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10876_19434.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10876_19435.jpg +0 -0
- data/examples/street/tmp/tiles/esri_satellite_15_10876_19436.jpg +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10874_19433.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10874_19434.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10874_19435.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10874_19436.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10875_19433.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10875_19434.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10875_19435.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10875_19436.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10876_19433.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10876_19434.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10876_19435.png +0 -0
- data/examples/street/tmp/tiles/osm_fr_15_10876_19436.png +0 -0
- data/examples/tmp/tiles/15_10871_19430.png +0 -0
- data/examples/tmp/tiles/15_10871_19431.png +0 -0
- data/examples/tmp/tiles/15_10871_19432.png +0 -0
- data/examples/tmp/tiles/15_10871_19433.png +0 -0
- data/examples/tmp/tiles/15_10871_19434.png +0 -0
- data/examples/tmp/tiles/15_10871_19435.png +0 -0
- data/examples/tmp/tiles/15_10872_19430.png +0 -0
- data/examples/tmp/tiles/15_10872_19431.png +0 -0
- data/examples/tmp/tiles/15_10872_19432.png +0 -0
- data/examples/tmp/tiles/15_10872_19433.png +0 -0
- data/examples/tmp/tiles/15_10872_19434.png +0 -0
- data/examples/tmp/tiles/15_10872_19435.png +0 -0
- data/examples/tmp/tiles/15_10873_19430.png +0 -0
- data/examples/tmp/tiles/15_10873_19431.png +0 -0
- data/examples/tmp/tiles/15_10873_19432.png +0 -0
- data/examples/tmp/tiles/15_10873_19433.png +0 -0
- data/examples/tmp/tiles/15_10873_19434.png +0 -0
- data/examples/tmp/tiles/15_10873_19435.png +0 -0
- data/examples/tmp/tiles/15_10874_19430.png +0 -0
- data/examples/tmp/tiles/15_10874_19431.png +0 -0
- data/examples/tmp/tiles/15_10874_19432.png +0 -0
- data/examples/tmp/tiles/15_10874_19433.png +0 -0
- data/examples/tmp/tiles/15_10874_19434.png +0 -0
- data/examples/tmp/tiles/15_10874_19435.png +0 -0
- data/examples/tmp/tiles/15_10875_19430.png +0 -0
- data/examples/tmp/tiles/15_10875_19431.png +0 -0
- data/examples/tmp/tiles/15_10875_19432.png +0 -0
- data/examples/tmp/tiles/15_10875_19433.png +0 -0
- data/examples/tmp/tiles/15_10875_19434.png +0 -0
- data/examples/tmp/tiles/15_10875_19435.png +0 -0
- data/examples/tmp/tiles/15_10876_19430.png +0 -0
- data/examples/tmp/tiles/15_10876_19431.png +0 -0
- data/examples/tmp/tiles/15_10876_19432.png +0 -0
- data/examples/tmp/tiles/15_10876_19433.png +0 -0
- data/examples/tmp/tiles/15_10876_19434.png +0 -0
- data/examples/tmp/tiles/15_10876_19435.png +0 -0
- data/examples/tmp/tiles/15_10877_19430.png +0 -0
- data/examples/tmp/tiles/15_10877_19431.png +0 -0
- data/examples/tmp/tiles/15_10877_19432.png +0 -0
- data/examples/tmp/tiles/15_10877_19433.png +0 -0
- data/examples/tmp/tiles/15_10877_19434.png +0 -0
- data/examples/tmp/tiles/15_10877_19435.png +0 -0
- data/examples/tmp/tiles/4_0_0.png +0 -0
- data/examples/tmp/tiles/4_0_1.png +0 -0
- data/examples/tmp/tiles/4_0_10.png +0 -0
- data/examples/tmp/tiles/4_0_11.png +0 -0
- data/examples/tmp/tiles/4_0_12.png +0 -0
- data/examples/tmp/tiles/4_0_13.png +0 -0
- data/examples/tmp/tiles/4_0_14.png +0 -0
- data/examples/tmp/tiles/4_0_15.png +0 -0
- data/examples/tmp/tiles/4_0_2.png +0 -0
- data/examples/tmp/tiles/4_0_3.png +0 -0
- data/examples/tmp/tiles/4_0_4.png +0 -0
- data/examples/tmp/tiles/4_0_5.png +0 -0
- data/examples/tmp/tiles/4_0_6.png +0 -0
- data/examples/tmp/tiles/4_0_7.png +0 -0
- data/examples/tmp/tiles/4_0_8.png +0 -0
- data/examples/tmp/tiles/4_0_9.png +0 -0
- data/examples/tmp/tiles/4_10_0.png +0 -0
- data/examples/tmp/tiles/4_10_1.png +0 -0
- data/examples/tmp/tiles/4_10_10.png +0 -0
- data/examples/tmp/tiles/4_10_11.png +0 -0
- data/examples/tmp/tiles/4_10_12.png +0 -0
- data/examples/tmp/tiles/4_10_13.png +0 -0
- data/examples/tmp/tiles/4_10_14.png +0 -0
- data/examples/tmp/tiles/4_10_15.png +0 -0
- data/examples/tmp/tiles/4_10_2.png +0 -0
- data/examples/tmp/tiles/4_10_3.png +0 -0
- data/examples/tmp/tiles/4_10_4.png +0 -0
- data/examples/tmp/tiles/4_10_5.png +0 -0
- data/examples/tmp/tiles/4_10_6.png +0 -0
- data/examples/tmp/tiles/4_10_7.png +0 -0
- data/examples/tmp/tiles/4_10_8.png +0 -0
- data/examples/tmp/tiles/4_10_9.png +0 -0
- data/examples/tmp/tiles/4_11_0.png +0 -0
- data/examples/tmp/tiles/4_11_1.png +0 -0
- data/examples/tmp/tiles/4_11_10.png +0 -0
- data/examples/tmp/tiles/4_11_11.png +0 -0
- data/examples/tmp/tiles/4_11_12.png +0 -0
- data/examples/tmp/tiles/4_11_13.png +0 -0
- data/examples/tmp/tiles/4_11_14.png +0 -0
- data/examples/tmp/tiles/4_11_15.png +0 -0
- data/examples/tmp/tiles/4_11_2.png +0 -0
- data/examples/tmp/tiles/4_11_3.png +0 -0
- data/examples/tmp/tiles/4_11_4.png +0 -0
- data/examples/tmp/tiles/4_11_5.png +0 -0
- data/examples/tmp/tiles/4_11_6.png +0 -0
- data/examples/tmp/tiles/4_11_7.png +0 -0
- data/examples/tmp/tiles/4_11_8.png +0 -0
- data/examples/tmp/tiles/4_11_9.png +0 -0
- data/examples/tmp/tiles/4_12_0.png +0 -0
- data/examples/tmp/tiles/4_12_1.png +0 -0
- data/examples/tmp/tiles/4_12_10.png +0 -0
- data/examples/tmp/tiles/4_12_11.png +0 -0
- data/examples/tmp/tiles/4_12_12.png +0 -0
- data/examples/tmp/tiles/4_12_13.png +0 -0
- data/examples/tmp/tiles/4_12_14.png +0 -0
- data/examples/tmp/tiles/4_12_15.png +0 -0
- data/examples/tmp/tiles/4_12_2.png +0 -0
- data/examples/tmp/tiles/4_12_3.png +0 -0
- data/examples/tmp/tiles/4_12_4.png +0 -0
- data/examples/tmp/tiles/4_12_5.png +0 -0
- data/examples/tmp/tiles/4_12_6.png +0 -0
- data/examples/tmp/tiles/4_12_7.png +0 -0
- data/examples/tmp/tiles/4_12_8.png +0 -0
- data/examples/tmp/tiles/4_12_9.png +0 -0
- data/examples/tmp/tiles/4_13_0.png +0 -0
- data/examples/tmp/tiles/4_13_1.png +0 -0
- data/examples/tmp/tiles/4_13_10.png +0 -0
- data/examples/tmp/tiles/4_13_11.png +0 -0
- data/examples/tmp/tiles/4_13_12.png +0 -0
- data/examples/tmp/tiles/4_13_13.png +0 -0
- data/examples/tmp/tiles/4_13_14.png +0 -0
- data/examples/tmp/tiles/4_13_15.png +0 -0
- data/examples/tmp/tiles/4_13_2.png +0 -0
- data/examples/tmp/tiles/4_13_3.png +0 -0
- data/examples/tmp/tiles/4_13_4.png +0 -0
- data/examples/tmp/tiles/4_13_5.png +0 -0
- data/examples/tmp/tiles/4_13_6.png +0 -0
- data/examples/tmp/tiles/4_13_7.png +0 -0
- data/examples/tmp/tiles/4_13_8.png +0 -0
- data/examples/tmp/tiles/4_13_9.png +0 -0
- data/examples/tmp/tiles/4_14_0.png +0 -0
- data/examples/tmp/tiles/4_14_1.png +0 -0
- data/examples/tmp/tiles/4_14_10.png +0 -0
- data/examples/tmp/tiles/4_14_11.png +0 -0
- data/examples/tmp/tiles/4_14_12.png +0 -0
- data/examples/tmp/tiles/4_14_13.png +0 -0
- data/examples/tmp/tiles/4_14_14.png +0 -0
- data/examples/tmp/tiles/4_14_15.png +0 -0
- data/examples/tmp/tiles/4_14_2.png +0 -0
- data/examples/tmp/tiles/4_14_3.png +0 -0
- data/examples/tmp/tiles/4_14_4.png +0 -0
- data/examples/tmp/tiles/4_14_5.png +0 -0
- data/examples/tmp/tiles/4_14_6.png +0 -0
- data/examples/tmp/tiles/4_14_7.png +0 -0
- data/examples/tmp/tiles/4_14_8.png +0 -0
- data/examples/tmp/tiles/4_14_9.png +0 -0
- data/examples/tmp/tiles/4_15_0.png +0 -0
- data/examples/tmp/tiles/4_15_1.png +0 -0
- data/examples/tmp/tiles/4_15_10.png +0 -0
- data/examples/tmp/tiles/4_15_11.png +0 -0
- data/examples/tmp/tiles/4_15_12.png +0 -0
- data/examples/tmp/tiles/4_15_13.png +0 -0
- data/examples/tmp/tiles/4_15_14.png +0 -0
- data/examples/tmp/tiles/4_15_15.png +0 -0
- data/examples/tmp/tiles/4_15_2.png +0 -0
- data/examples/tmp/tiles/4_15_3.png +0 -0
- data/examples/tmp/tiles/4_15_4.png +0 -0
- data/examples/tmp/tiles/4_15_5.png +0 -0
- data/examples/tmp/tiles/4_15_6.png +0 -0
- data/examples/tmp/tiles/4_15_7.png +0 -0
- data/examples/tmp/tiles/4_15_8.png +0 -0
- data/examples/tmp/tiles/4_15_9.png +0 -0
- data/examples/tmp/tiles/4_1_0.png +0 -0
- data/examples/tmp/tiles/4_1_1.png +0 -0
- data/examples/tmp/tiles/4_1_10.png +0 -0
- data/examples/tmp/tiles/4_1_11.png +0 -0
- data/examples/tmp/tiles/4_1_12.png +0 -0
- data/examples/tmp/tiles/4_1_13.png +0 -0
- data/examples/tmp/tiles/4_1_14.png +0 -0
- data/examples/tmp/tiles/4_1_15.png +0 -0
- data/examples/tmp/tiles/4_1_2.png +0 -0
- data/examples/tmp/tiles/4_1_3.png +0 -0
- data/examples/tmp/tiles/4_1_4.png +0 -0
- data/examples/tmp/tiles/4_1_5.png +0 -0
- data/examples/tmp/tiles/4_1_6.png +0 -0
- data/examples/tmp/tiles/4_1_7.png +0 -0
- data/examples/tmp/tiles/4_1_8.png +0 -0
- data/examples/tmp/tiles/4_1_9.png +0 -0
- data/examples/tmp/tiles/4_2_0.png +0 -0
- data/examples/tmp/tiles/4_2_1.png +0 -0
- data/examples/tmp/tiles/4_2_10.png +0 -0
- data/examples/tmp/tiles/4_2_11.png +0 -0
- data/examples/tmp/tiles/4_2_12.png +0 -0
- data/examples/tmp/tiles/4_2_13.png +0 -0
- data/examples/tmp/tiles/4_2_14.png +0 -0
- data/examples/tmp/tiles/4_2_15.png +0 -0
- data/examples/tmp/tiles/4_2_2.png +0 -0
- data/examples/tmp/tiles/4_2_3.png +0 -0
- data/examples/tmp/tiles/4_2_4.png +0 -0
- data/examples/tmp/tiles/4_2_5.png +0 -0
- data/examples/tmp/tiles/4_2_6.png +0 -0
- data/examples/tmp/tiles/4_2_7.png +0 -0
- data/examples/tmp/tiles/4_2_8.png +0 -0
- data/examples/tmp/tiles/4_2_9.png +0 -0
- data/examples/tmp/tiles/4_3_0.png +0 -0
- data/examples/tmp/tiles/4_3_1.png +0 -0
- data/examples/tmp/tiles/4_3_10.png +0 -0
- data/examples/tmp/tiles/4_3_11.png +0 -0
- data/examples/tmp/tiles/4_3_12.png +0 -0
- data/examples/tmp/tiles/4_3_13.png +0 -0
- data/examples/tmp/tiles/4_3_14.png +0 -0
- data/examples/tmp/tiles/4_3_15.png +0 -0
- data/examples/tmp/tiles/4_3_2.png +0 -0
- data/examples/tmp/tiles/4_3_3.png +0 -0
- data/examples/tmp/tiles/4_3_4.png +0 -0
- data/examples/tmp/tiles/4_3_5.png +0 -0
- data/examples/tmp/tiles/4_3_6.png +0 -0
- data/examples/tmp/tiles/4_3_7.png +0 -0
- data/examples/tmp/tiles/4_3_8.png +0 -0
- data/examples/tmp/tiles/4_3_9.png +0 -0
- data/examples/tmp/tiles/4_4_0.png +0 -0
- data/examples/tmp/tiles/4_4_1.png +0 -0
- data/examples/tmp/tiles/4_4_10.png +0 -0
- data/examples/tmp/tiles/4_4_11.png +0 -0
- data/examples/tmp/tiles/4_4_12.png +0 -0
- data/examples/tmp/tiles/4_4_13.png +0 -0
- data/examples/tmp/tiles/4_4_14.png +0 -0
- data/examples/tmp/tiles/4_4_15.png +0 -0
- data/examples/tmp/tiles/4_4_2.png +0 -0
- data/examples/tmp/tiles/4_4_3.png +0 -0
- data/examples/tmp/tiles/4_4_4.png +0 -0
- data/examples/tmp/tiles/4_4_5.png +0 -0
- data/examples/tmp/tiles/4_4_6.png +0 -0
- data/examples/tmp/tiles/4_4_7.png +0 -0
- data/examples/tmp/tiles/4_4_8.png +0 -0
- data/examples/tmp/tiles/4_4_9.png +0 -0
- data/examples/tmp/tiles/4_5_0.png +0 -0
- data/examples/tmp/tiles/4_5_1.png +0 -0
- data/examples/tmp/tiles/4_5_10.png +0 -0
- data/examples/tmp/tiles/4_5_11.png +0 -0
- data/examples/tmp/tiles/4_5_12.png +0 -0
- data/examples/tmp/tiles/4_5_13.png +0 -0
- data/examples/tmp/tiles/4_5_14.png +0 -0
- data/examples/tmp/tiles/4_5_15.png +0 -0
- data/examples/tmp/tiles/4_5_2.png +0 -0
- data/examples/tmp/tiles/4_5_3.png +0 -0
- data/examples/tmp/tiles/4_5_4.png +0 -0
- data/examples/tmp/tiles/4_5_5.png +0 -0
- data/examples/tmp/tiles/4_5_6.png +0 -0
- data/examples/tmp/tiles/4_5_7.png +0 -0
- data/examples/tmp/tiles/4_5_8.png +0 -0
- data/examples/tmp/tiles/4_5_9.png +0 -0
- data/examples/tmp/tiles/4_6_0.png +0 -0
- data/examples/tmp/tiles/4_6_1.png +0 -0
- data/examples/tmp/tiles/4_6_10.png +0 -0
- data/examples/tmp/tiles/4_6_11.png +0 -0
- data/examples/tmp/tiles/4_6_12.png +0 -0
- data/examples/tmp/tiles/4_6_13.png +0 -0
- data/examples/tmp/tiles/4_6_14.png +0 -0
- data/examples/tmp/tiles/4_6_15.png +0 -0
- data/examples/tmp/tiles/4_6_2.png +0 -0
- data/examples/tmp/tiles/4_6_3.png +0 -0
- data/examples/tmp/tiles/4_6_4.png +0 -0
- data/examples/tmp/tiles/4_6_5.png +0 -0
- data/examples/tmp/tiles/4_6_6.png +0 -0
- data/examples/tmp/tiles/4_6_7.png +0 -0
- data/examples/tmp/tiles/4_6_8.png +0 -0
- data/examples/tmp/tiles/4_6_9.png +0 -0
- data/examples/tmp/tiles/4_7_0.png +0 -0
- data/examples/tmp/tiles/4_7_1.png +0 -0
- data/examples/tmp/tiles/4_7_10.png +0 -0
- data/examples/tmp/tiles/4_7_11.png +0 -0
- data/examples/tmp/tiles/4_7_12.png +0 -0
- data/examples/tmp/tiles/4_7_13.png +0 -0
- data/examples/tmp/tiles/4_7_14.png +0 -0
- data/examples/tmp/tiles/4_7_15.png +0 -0
- data/examples/tmp/tiles/4_7_2.png +0 -0
- data/examples/tmp/tiles/4_7_3.png +0 -0
- data/examples/tmp/tiles/4_7_4.png +0 -0
- data/examples/tmp/tiles/4_7_5.png +0 -0
- data/examples/tmp/tiles/4_7_6.png +0 -0
- data/examples/tmp/tiles/4_7_7.png +0 -0
- data/examples/tmp/tiles/4_7_8.png +0 -0
- data/examples/tmp/tiles/4_7_9.png +0 -0
- data/examples/tmp/tiles/4_8_0.png +0 -0
- data/examples/tmp/tiles/4_8_1.png +0 -0
- data/examples/tmp/tiles/4_8_10.png +0 -0
- data/examples/tmp/tiles/4_8_11.png +0 -0
- data/examples/tmp/tiles/4_8_12.png +0 -0
- data/examples/tmp/tiles/4_8_13.png +0 -0
- data/examples/tmp/tiles/4_8_14.png +0 -0
- data/examples/tmp/tiles/4_8_15.png +0 -0
- data/examples/tmp/tiles/4_8_2.png +0 -0
- data/examples/tmp/tiles/4_8_3.png +0 -0
- data/examples/tmp/tiles/4_8_4.png +0 -0
- data/examples/tmp/tiles/4_8_5.png +0 -0
- data/examples/tmp/tiles/4_8_6.png +0 -0
- data/examples/tmp/tiles/4_8_7.png +0 -0
- data/examples/tmp/tiles/4_8_8.png +0 -0
- data/examples/tmp/tiles/4_8_9.png +0 -0
- data/examples/tmp/tiles/4_9_0.png +0 -0
- data/examples/tmp/tiles/4_9_1.png +0 -0
- data/examples/tmp/tiles/4_9_10.png +0 -0
- data/examples/tmp/tiles/4_9_11.png +0 -0
- data/examples/tmp/tiles/4_9_12.png +0 -0
- data/examples/tmp/tiles/4_9_13.png +0 -0
- data/examples/tmp/tiles/4_9_14.png +0 -0
- data/examples/tmp/tiles/4_9_15.png +0 -0
- data/examples/tmp/tiles/4_9_2.png +0 -0
- data/examples/tmp/tiles/4_9_3.png +0 -0
- data/examples/tmp/tiles/4_9_4.png +0 -0
- data/examples/tmp/tiles/4_9_5.png +0 -0
- data/examples/tmp/tiles/4_9_6.png +0 -0
- data/examples/tmp/tiles/4_9_7.png +0 -0
- data/examples/tmp/tiles/4_9_8.png +0 -0
- data/examples/tmp/tiles/4_9_9.png +0 -0
- data/lib/gd/gis/basemap.rb +123 -6
- data/lib/gd/gis/geometry.rb +40 -0
- data/lib/gd/gis/layer_lines.rb +36 -0
- data/lib/gd/gis/layer_points.rb +60 -4
- data/lib/gd/gis/layer_polygons.rb +38 -0
- data/lib/gd/gis/map.rb +69 -29
- data/lib/gd/gis/projection.rb +14 -0
- metadata +406 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dac7c14a782d59e332c74f826519a41213c5a4fea689006ae57b01d2d6f531db
|
|
4
|
+
data.tar.gz: 88d652bbcc7e56955f9cba7330a101759086e3561135b18a93b83254045a0c78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c05ccb3f3f703229d999c6e2a0ce0d3f851a80ea5891ca3b6cb02b8b22d68a5ec38de5f10a9b1684ab92f1a5d71c4d9fd00a48101e578bac50cb91725c58e07e
|
|
7
|
+
data.tar.gz: 55e24d58d3ccf204de44fbf642ab7dcd377cd0a4ae9ce50e68d66766a70c1298d0f27c13d7ce503158c7e263ebaa6628d7f2d74e89bce7e97e24ef39806268fa
|
data/README.md
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
the
|
|
1
|
+
# LibGD-GIS
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://rubystacknews.com/2026/01/07/ruby-can-now-draw-maps-and-i-started-with-ice-cream/">
|
|
5
|
+
<img src="https://img.shields.io/badge/RubyStackNews-CC342D?style=for-the-badge&logo=ruby&logoColor=white" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://x.com/ruby_stack_news">
|
|
8
|
+
<img src="https://img.shields.io/badge/Twitter%20@RubyStackNews-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://www.linkedin.com/in/germ%C3%A1n-silva-56a12622/">
|
|
11
|
+
<img src="https://img.shields.io/badge/Germán%20Silva-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" />
|
|
12
|
+
</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://rubygems.org/gems/libgd-gis">
|
|
17
|
+
<img src="https://img.shields.io/badge/RubyGems-libgd--gis-CC342D?style=for-the-badge&logo=rubygems&logoColor=white" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/ggerman/libgd-gis">
|
|
20
|
+
<img src="https://img.shields.io/badge/GitHub-libgd--gis-181717?style=for-the-badge&logo=github&logoColor=white" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/ggerman/ruby-libgd">
|
|
23
|
+
<img src="https://img.shields.io/badge/Engine-ruby--libgd-CC342D?style=for-the-badge&logo=ruby&logoColor=white" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="right">
|
|
28
|
+
<img src="docs/images/logo-gis.png" width="160" />
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
| Examples | Examples | Examples |
|
|
33
|
+
| :----: | :----: | :--: |
|
|
34
|
+
| <img src="docs/examples/america.png" height="250"> | <img src="docs/examples/argentina_museum.png" height="250"> | <img src="docs/examples/museos_parana.png" height="250"> |
|
|
35
|
+
| <img src="docs/examples/asia.png" height="250"> | <img src="docs/examples/europe.png" height="250"> | <img src="docs/examples/icecream_parana.png" height="250"> |
|
|
36
|
+
| <img src="docs/examples/argentina_cities.png" height="250"> | <img src="docs/examples/tanzania_hydro.png" height="250"> | |
|
|
9
37
|
|
|
10
38
|
---
|
|
11
39
|
|
|
12
|
-
##
|
|
40
|
+
## A geospatial raster engine for Ruby.
|
|
13
41
|
|
|
14
|
-
|
|
42
|
+
libgd-gis allows Ruby to render real maps, GeoJSON layers, vector features, and geospatial tiles using a native raster backend powered by **libgd**.
|
|
15
43
|
|
|
16
|
-
|
|
44
|
+
It restores something Ruby lost over time:
|
|
45
|
+
the ability to generate **maps, tiles, and GIS-grade visualizations natively**, without relying on external tools like QGIS, Mapnik, ImageMagick, or Mapbox.
|
|
17
46
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
No
|
|
21
|
-
|
|
47
|
+
Built on top of **ruby-libgd**, this project turns Ruby into a **map rendering engine**, capable of producing spatial graphics, tiled maps, and geospatial outputs directly inside Ruby processes.
|
|
48
|
+
|
|
49
|
+
- No external renderers.
|
|
50
|
+
- No shelling out.
|
|
51
|
+
- Just Ruby, raster, and GIS.
|
|
22
52
|
|
|
23
53
|
---
|
|
24
54
|
|
|
@@ -75,29 +105,46 @@ Render hydroelectric plants from a GeoJSON file:
|
|
|
75
105
|
require "json"
|
|
76
106
|
require "gd/gis"
|
|
77
107
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
lats = plants.map { |f| f["geometry"]["coordinates"][1] }
|
|
83
|
-
|
|
84
|
-
bbox = [lons.min, lats.min, lons.max, lats.max]
|
|
108
|
+
# ---------------------------
|
|
109
|
+
# Bounding box mundial
|
|
110
|
+
# ---------------------------
|
|
111
|
+
AMERICA = [-170, -60, -30, 75]
|
|
85
112
|
|
|
113
|
+
# ---------------------------
|
|
114
|
+
# Crear mapa
|
|
115
|
+
# ---------------------------
|
|
86
116
|
map = GD::GIS::Map.new(
|
|
87
|
-
bbox:
|
|
88
|
-
zoom:
|
|
117
|
+
bbox: AMERICA,
|
|
118
|
+
zoom: 4,
|
|
89
119
|
basemap: :carto_light
|
|
90
120
|
)
|
|
91
121
|
|
|
122
|
+
# Cargar datos
|
|
123
|
+
# ---------------------------
|
|
124
|
+
peaks = JSON.parse(File.read("picks.json"))
|
|
125
|
+
|
|
126
|
+
# ---------------------------
|
|
127
|
+
# Agregar capa de puntos
|
|
128
|
+
# ---------------------------
|
|
92
129
|
map.add_points(
|
|
93
|
-
|
|
94
|
-
lon: ->(
|
|
95
|
-
lat: ->(
|
|
96
|
-
icon: "
|
|
130
|
+
peaks,
|
|
131
|
+
lon: ->(p) { p["longitude"] },
|
|
132
|
+
lat: ->(p) { p["latitude"] },
|
|
133
|
+
icon: "peak.png",
|
|
134
|
+
label: ->(p) { p["name"] },
|
|
135
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
136
|
+
size: 10,
|
|
137
|
+
color: [0,0,0]
|
|
97
138
|
)
|
|
98
139
|
|
|
140
|
+
# ---------------------------
|
|
141
|
+
# Renderizar y guardar
|
|
142
|
+
# ---------------------------
|
|
99
143
|
map.render
|
|
100
|
-
map.save("
|
|
144
|
+
map.save("output/america.png")
|
|
145
|
+
|
|
146
|
+
puts "Saved output/america.png"
|
|
147
|
+
|
|
101
148
|
```
|
|
102
149
|
|
|
103
150
|
---
|
|
@@ -122,6 +169,6 @@ MIT
|
|
|
122
169
|
|
|
123
170
|
## Author
|
|
124
171
|
|
|
125
|
-
Germán Silva
|
|
126
|
-
https://github.com/ggerman
|
|
172
|
+
Germán Silva
|
|
173
|
+
https://github.com/ggerman
|
|
127
174
|
https://rubystacknews.com
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# ---------------------------
|
|
5
|
+
# Bounding box mundial
|
|
6
|
+
# ---------------------------
|
|
7
|
+
AMERICA = [-170, -60, -30, 75]
|
|
8
|
+
|
|
9
|
+
# ---------------------------
|
|
10
|
+
# Crear mapa
|
|
11
|
+
# ---------------------------
|
|
12
|
+
map = GD::GIS::Map.new(
|
|
13
|
+
bbox: AMERICA,
|
|
14
|
+
zoom: 4,
|
|
15
|
+
basemap: :carto_light
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Cargar datos
|
|
19
|
+
# ---------------------------
|
|
20
|
+
peaks = JSON.parse(File.read("picks.json"))
|
|
21
|
+
|
|
22
|
+
# ---------------------------
|
|
23
|
+
# Agregar capa de puntos
|
|
24
|
+
# ---------------------------
|
|
25
|
+
map.add_points(
|
|
26
|
+
peaks,
|
|
27
|
+
lon: ->(p) { p["longitude"] },
|
|
28
|
+
lat: ->(p) { p["latitude"] },
|
|
29
|
+
icon: "peak.png",
|
|
30
|
+
label: ->(p) { p["name"] },
|
|
31
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
32
|
+
size: 10,
|
|
33
|
+
color: [0,0,0]
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# ---------------------------
|
|
37
|
+
# Renderizar y guardar
|
|
38
|
+
# ---------------------------
|
|
39
|
+
map.render
|
|
40
|
+
map.save("output/america.png")
|
|
41
|
+
|
|
42
|
+
puts "Saved output/america.png"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# ---------------------------
|
|
5
|
+
# Bounding box mundial
|
|
6
|
+
# ---------------------------
|
|
7
|
+
ASIA = [25.0, -10.0, 150.0, 60.0]
|
|
8
|
+
|
|
9
|
+
# ---------------------------
|
|
10
|
+
# Crear mapa
|
|
11
|
+
# ---------------------------
|
|
12
|
+
map = GD::GIS::Map.new(
|
|
13
|
+
bbox: ASIA,
|
|
14
|
+
zoom: 4,
|
|
15
|
+
basemap: :carto_light
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Cargar datos
|
|
19
|
+
# ---------------------------
|
|
20
|
+
peaks = JSON.parse(File.read("picks.json"))
|
|
21
|
+
|
|
22
|
+
# ---------------------------
|
|
23
|
+
# Agregar capa de puntos
|
|
24
|
+
# ---------------------------
|
|
25
|
+
map.add_points(
|
|
26
|
+
peaks,
|
|
27
|
+
lon: ->(p) { p["longitude"] },
|
|
28
|
+
lat: ->(p) { p["latitude"] },
|
|
29
|
+
icon: "peak.png",
|
|
30
|
+
label: ->(p) { p["name"] },
|
|
31
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
32
|
+
size: 10,
|
|
33
|
+
color: [0,0,0]
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# ---------------------------
|
|
37
|
+
# Renderizar y guardar
|
|
38
|
+
# ---------------------------
|
|
39
|
+
map.render
|
|
40
|
+
map.save("output/asia.png")
|
|
41
|
+
|
|
42
|
+
puts "Saved output/asia.png"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
BBOX = [-60.556640625, -31.8402326679, -60.46875, -31.6907818061]
|
|
5
|
+
|
|
6
|
+
map = GD::GIS::Map.new(
|
|
7
|
+
bbox: BBOX,
|
|
8
|
+
zoom: 14,
|
|
9
|
+
basemap: :carto_light
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
geo = JSON.parse(File.read("ramirez_full.geojson"))
|
|
13
|
+
features = geo["features"]
|
|
14
|
+
|
|
15
|
+
# Dibujar Av. Ramírez como polilínea
|
|
16
|
+
map.add_lines(
|
|
17
|
+
features,
|
|
18
|
+
stroke: [255, 0, 0, 140], # rojo semitransparente
|
|
19
|
+
width: 4
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Etiqueta
|
|
23
|
+
map.add_points(
|
|
24
|
+
[{lon: -60.5205, lat: -31.76, name: "Av. Ramírez"}],
|
|
25
|
+
lon: ->(p){p[:lon]},
|
|
26
|
+
lat: ->(p){p[:lat]},
|
|
27
|
+
label: ->(p){p[:name]},
|
|
28
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
29
|
+
size: 18,
|
|
30
|
+
color: [0,0,0,160]
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
map.render
|
|
34
|
+
map.save("ramirez_polyline.png")
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# ---------------------------
|
|
5
|
+
# Bounding box mundial
|
|
6
|
+
# ---------------------------
|
|
7
|
+
EUROPE = [-15.0, 34.0, 40.0, 72.0]
|
|
8
|
+
|
|
9
|
+
# ---------------------------
|
|
10
|
+
# Crear mapa
|
|
11
|
+
# ---------------------------
|
|
12
|
+
map = GD::GIS::Map.new(
|
|
13
|
+
bbox: EUROPE,
|
|
14
|
+
zoom: 4,
|
|
15
|
+
basemap: :carto_light
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Cargar datos
|
|
19
|
+
# ---------------------------
|
|
20
|
+
peaks = JSON.parse(File.read("picks.json"))
|
|
21
|
+
|
|
22
|
+
# ---------------------------
|
|
23
|
+
# Agregar capa de puntos
|
|
24
|
+
# ---------------------------
|
|
25
|
+
map.add_points(
|
|
26
|
+
peaks,
|
|
27
|
+
lon: ->(p) { p["longitude"] },
|
|
28
|
+
lat: ->(p) { p["latitude"] },
|
|
29
|
+
icon: "peak.png",
|
|
30
|
+
label: ->(p) { p["name"] },
|
|
31
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
32
|
+
size: 10,
|
|
33
|
+
color: [0,0,0]
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# ---------------------------
|
|
37
|
+
# Renderizar y guardar
|
|
38
|
+
# ---------------------------
|
|
39
|
+
map.render
|
|
40
|
+
map.save("output/europe.png")
|
|
41
|
+
|
|
42
|
+
puts "Saved output/europe.png"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "Heladería Gallet",
|
|
4
|
+
"lat": -31.7332,
|
|
5
|
+
"lon": -60.5221
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "Freddo",
|
|
9
|
+
"lat": -31.7401,
|
|
10
|
+
"lon": -60.5289
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "La Italiana Helados Artesanales",
|
|
14
|
+
"lat": -31.7365,
|
|
15
|
+
"lon": -60.5247
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Heladería San Remo",
|
|
19
|
+
"lat": -31.7389,
|
|
20
|
+
"lon": -60.5263
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Heladería del Puerto",
|
|
24
|
+
"lat": -31.7450,
|
|
25
|
+
"lon": -60.5310
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Mamma Mia Helados",
|
|
29
|
+
"lat": -31.7310,
|
|
30
|
+
"lon": -60.5190
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Grido Helado",
|
|
34
|
+
"lat": -31.7375,
|
|
35
|
+
"lon": -60.5235
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Cremolati",
|
|
39
|
+
"lat": -31.7410,
|
|
40
|
+
"lon": -60.5270
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Bahilo Helados Artesanales",
|
|
44
|
+
"lat": -31.7345,
|
|
45
|
+
"lon": -60.5230
|
|
46
|
+
}
|
|
47
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# --------------------------------
|
|
5
|
+
# Paraná, Entre Ríos
|
|
6
|
+
# --------------------------------
|
|
7
|
+
CITY = [-60.56, -31.76, -60.50, -31.71]
|
|
8
|
+
|
|
9
|
+
map = GD::GIS::Map.new(
|
|
10
|
+
bbox: CITY,
|
|
11
|
+
zoom: 15,
|
|
12
|
+
basemap: :carto_light
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
# --------------------------------
|
|
16
|
+
# Cargar datos
|
|
17
|
+
# --------------------------------
|
|
18
|
+
shops = JSON.parse(File.read("heladerias.json"))
|
|
19
|
+
|
|
20
|
+
# --------------------------------
|
|
21
|
+
# Capa de heladerías
|
|
22
|
+
# --------------------------------
|
|
23
|
+
map.add_points(
|
|
24
|
+
shops,
|
|
25
|
+
lon: ->(s) { s["lon"] },
|
|
26
|
+
lat: ->(s) { s["lat"] },
|
|
27
|
+
icon: "ice-cream.png",
|
|
28
|
+
label: ->(s) { s["name"] },
|
|
29
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
30
|
+
size: 11,
|
|
31
|
+
color: [40,40,40]
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# --------------------------------
|
|
35
|
+
# Render
|
|
36
|
+
# --------------------------------
|
|
37
|
+
map.render
|
|
38
|
+
map.save("output/heladerias_parana.png")
|
|
39
|
+
|
|
40
|
+
puts "Saved output/heladerias_parana.png"
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
require "net/http"
|
|
2
|
+
require "uri"
|
|
3
|
+
require "fileutils"
|
|
4
|
+
require "json"
|
|
5
|
+
require "gd"
|
|
6
|
+
|
|
7
|
+
# =========================
|
|
8
|
+
# Parámetros
|
|
9
|
+
# =========================
|
|
10
|
+
ZOOM = 4
|
|
11
|
+
TILE_SIZE = 256
|
|
12
|
+
|
|
13
|
+
X_MIN = 0
|
|
14
|
+
Y_MIN = 0
|
|
15
|
+
X_MAX = (2 ** ZOOM) - 1
|
|
16
|
+
Y_MAX = (2 ** ZOOM) - 1
|
|
17
|
+
|
|
18
|
+
COLS = X_MAX - X_MIN + 1
|
|
19
|
+
ROWS = Y_MAX - Y_MIN + 1
|
|
20
|
+
|
|
21
|
+
WIDTH = COLS * TILE_SIZE
|
|
22
|
+
HEIGHT = ROWS * TILE_SIZE
|
|
23
|
+
|
|
24
|
+
FONT = "./fonts/DejaVuSans-Bold.ttf"
|
|
25
|
+
|
|
26
|
+
FileUtils.mkdir_p("tmp/tiles")
|
|
27
|
+
FileUtils.mkdir_p("output")
|
|
28
|
+
|
|
29
|
+
# =========================
|
|
30
|
+
# Web Mercator helpers
|
|
31
|
+
# =========================
|
|
32
|
+
def lon2px(lon, z)
|
|
33
|
+
((lon + 180.0) / 360.0 * (256 * 2**z))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def lat2px(lat, z)
|
|
37
|
+
rad = lat * Math::PI / 180
|
|
38
|
+
((1 - Math.log(Math.tan(rad) + 1 / Math.cos(rad)) / Math::PI) / 2 * (256 * 2**z))
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# =========================
|
|
42
|
+
# Descargar tile
|
|
43
|
+
# =========================
|
|
44
|
+
def fetch_tile(z, x, y)
|
|
45
|
+
path = "tmp/tiles/#{z}_#{x}_#{y}.png"
|
|
46
|
+
return path if File.exist?(path)
|
|
47
|
+
|
|
48
|
+
url = URI("https://basemaps.cartocdn.com/light_all/#{z}/#{x}/#{y}.png")
|
|
49
|
+
puts "Downloading #{url}"
|
|
50
|
+
|
|
51
|
+
Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
|
|
52
|
+
req = Net::HTTP::Get.new(url)
|
|
53
|
+
req["User-Agent"] = "ruby-libgd-gis"
|
|
54
|
+
res = http.request(req)
|
|
55
|
+
raise "Tile failed #{z}/#{x}/#{y}" unless res.code == "200"
|
|
56
|
+
File.binwrite(path, res.body)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
path
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# =========================
|
|
63
|
+
# Construir mapa base
|
|
64
|
+
# =========================
|
|
65
|
+
puts "Building world map #{WIDTH}x#{HEIGHT}..."
|
|
66
|
+
|
|
67
|
+
map = GD::Image.new(WIDTH, HEIGHT)
|
|
68
|
+
|
|
69
|
+
(X_MIN..X_MAX).each_with_index do |x, cx|
|
|
70
|
+
(Y_MIN..Y_MAX).each_with_index do |y, cy|
|
|
71
|
+
tile = GD::Image.open(fetch_tile(ZOOM, x, y))
|
|
72
|
+
map.copy(tile, cx * TILE_SIZE, cy * TILE_SIZE, 0, 0, TILE_SIZE, TILE_SIZE)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# =========================
|
|
77
|
+
# Cargar picos
|
|
78
|
+
# =========================
|
|
79
|
+
peaks = JSON.parse(File.read("picks.json"))
|
|
80
|
+
|
|
81
|
+
red = GD::Color.rgb(220, 40, 40)
|
|
82
|
+
black = GD::Color.rgb(0, 0, 0)
|
|
83
|
+
|
|
84
|
+
# =========================
|
|
85
|
+
# Dibujar picos
|
|
86
|
+
# =========================
|
|
87
|
+
puts "Plotting peaks..."
|
|
88
|
+
|
|
89
|
+
peaks.each do |p|
|
|
90
|
+
lon = p["longitude"]
|
|
91
|
+
lat = p["latitude"]
|
|
92
|
+
name = p["name"]
|
|
93
|
+
|
|
94
|
+
px = lon2px(lon, ZOOM)
|
|
95
|
+
py = lat2px(lat, ZOOM)
|
|
96
|
+
|
|
97
|
+
x = px.to_i
|
|
98
|
+
y = py.to_i
|
|
99
|
+
|
|
100
|
+
# Marcador
|
|
101
|
+
map.filled_circle(x, y, 7, red)
|
|
102
|
+
|
|
103
|
+
# Texto con FreeType
|
|
104
|
+
map.text(
|
|
105
|
+
name,
|
|
106
|
+
x: x + 10,
|
|
107
|
+
y: y - 5,
|
|
108
|
+
size: 10,
|
|
109
|
+
color: black,
|
|
110
|
+
font: FONT
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# =========================
|
|
115
|
+
# Guardar
|
|
116
|
+
# =========================
|
|
117
|
+
map.save("output/world_peaks.png")
|
|
118
|
+
puts "Saved output/world_peaks.png"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require "csv"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# --------------------------------
|
|
5
|
+
# Paraná, Entre Ríos
|
|
6
|
+
# --------------------------------
|
|
7
|
+
CITY = [-60.56, -31.76, -60.50, -31.71]
|
|
8
|
+
|
|
9
|
+
map = GD::GIS::Map.new(
|
|
10
|
+
bbox: CITY,
|
|
11
|
+
zoom: 15,
|
|
12
|
+
basemap: :carto_light
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
# --------------------------------
|
|
16
|
+
# Cargar CSV oficial
|
|
17
|
+
# --------------------------------
|
|
18
|
+
rows = CSV.read("museos_datosabiertos.csv", headers: true)
|
|
19
|
+
|
|
20
|
+
# Filtrar solo museos de Paraná
|
|
21
|
+
museos = rows.select do |r|
|
|
22
|
+
r["localidad"]&.downcase == "paraná" &&
|
|
23
|
+
r["Latitud"] &&
|
|
24
|
+
r["Longitud"]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
puts "Museos cargados: #{museos.size}"
|
|
28
|
+
|
|
29
|
+
# --------------------------------
|
|
30
|
+
# Capa de museos
|
|
31
|
+
# --------------------------------
|
|
32
|
+
map.add_points(
|
|
33
|
+
museos,
|
|
34
|
+
lon: ->(m) { m["Longitud"].to_f },
|
|
35
|
+
lat: ->(m) { m["Latitud"].to_f },
|
|
36
|
+
icon: "museos.png", # tu icono
|
|
37
|
+
label: ->(m) { m["nombre"] },
|
|
38
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
39
|
+
size: 11,
|
|
40
|
+
color: [40, 40, 40]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# --------------------------------
|
|
44
|
+
# Render
|
|
45
|
+
# --------------------------------
|
|
46
|
+
map.render
|
|
47
|
+
map.save("output/museos_parana.png")
|
|
48
|
+
|
|
49
|
+
puts "Saved output/museos_parana.png"
|
data/examples/peak.png
ADDED
|
Binary file
|
data/examples/picks.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{"name": "Mount Everest", "elevation_m": 8849, "latitude": 27.9881, "longitude": 86.9250, "country": "Nepal/China"},
|
|
3
|
+
{"name": "K2", "elevation_m": 8611, "latitude": 35.8825, "longitude": 76.5133, "country": "Pakistan/China"},
|
|
4
|
+
{"name": "Kangchenjunga", "elevation_m": 8586, "latitude": 27.7025, "longitude": 88.1475, "country": "Nepal/India"},
|
|
5
|
+
{"name": "Lhotse", "elevation_m": 8516, "latitude": 27.9617, "longitude": 86.9333, "country": "Nepal/China"},
|
|
6
|
+
{"name": "Makalu", "elevation_m": 8485, "latitude": 27.8867, "longitude": 87.0867, "country": "Nepal/China"},
|
|
7
|
+
{"name": "Cho Oyu", "elevation_m": 8188, "latitude": 28.0942, "longitude": 86.6608, "country": "Nepal/China"},
|
|
8
|
+
{"name": "Dhaulagiri I", "elevation_m": 8167, "latitude": 28.6967, "longitude": 83.4867, "country": "Nepal"},
|
|
9
|
+
{"name": "Manaslu", "elevation_m": 8163, "latitude": 28.5497, "longitude": 84.5617, "country": "Nepal"},
|
|
10
|
+
{"name": "Nanga Parbat", "elevation_m": 8126, "latitude": 35.2375, "longitude": 74.5892, "country": "Pakistan"},
|
|
11
|
+
{"name": "Annapurna I", "elevation_m": 8091, "latitude": 28.5961, "longitude": 83.8203, "country": "Nepal"},
|
|
12
|
+
{"name": "Gasherbrum I", "elevation_m": 8080, "latitude": 35.7211, "longitude": 76.6764, "country": "Pakistan/China"},
|
|
13
|
+
{"name": "Broad Peak", "elevation_m": 8051, "latitude": 35.8128, "longitude": 76.5647, "country": "Pakistan/China"},
|
|
14
|
+
{"name": "Gasherbrum II", "elevation_m": 8035, "latitude": 35.7533, "longitude": 76.6333, "country": "Pakistan/China"},
|
|
15
|
+
{"name": "Shishapangma", "elevation_m": 8027, "latitude": 28.3486, "longitude": 85.7781, "country": "China"},
|
|
16
|
+
{"name": "Aconcagua", "elevation_m": 6961, "latitude": -32.6532, "longitude": -70.0109, "country": "Argentina"},
|
|
17
|
+
{"name": "Ojos del Salado", "elevation_m": 6893, "latitude": -27.1192, "longitude": -68.5422, "country": "Chile/Argentina"},
|
|
18
|
+
{"name": "Monte Pissis", "elevation_m": 6795, "latitude": -27.7500, "longitude": -68.7700, "country": "Argentina"},
|
|
19
|
+
{"name": "Huascarán", "elevation_m": 6768, "latitude": -9.1211, "longitude": -77.6153, "country": "Peru"},
|
|
20
|
+
{"name": "Cerro Bonete", "elevation_m": 6759, "latitude": -28.5400, "longitude": -67.7300, "country": "Argentina"},
|
|
21
|
+
{"name": "Volcán Llullaillaco", "elevation_m": 6739, "latitude": -24.7214, "longitude": -68.5328, "country": "Chile/Argentina"},
|
|
22
|
+
{"name": "Chimborazo", "elevation_m": 6263, "latitude": -1.4690, "longitude": -78.8170, "country": "Ecuador"},
|
|
23
|
+
{"name": "Denali", "elevation_m": 6190, "latitude": 63.0692, "longitude": -151.0070, "country": "United States"},
|
|
24
|
+
{"name": "Mount Logan", "elevation_m": 5959, "latitude": 60.5639, "longitude": -140.3964, "country": "Canada"},
|
|
25
|
+
{"name": "Pico de Orizaba", "elevation_m": 5636, "latitude": 19.0300, "longitude": -97.2667, "country": "Mexico"},
|
|
26
|
+
{"name": "Sierra Nevada de Santa Marta", "elevation_m": 5700, "latitude": 10.8500, "longitude": -73.5000, "country": "Colombia"},
|
|
27
|
+
{"name": "Volcán Nevado del Huila", "elevation_m": 5364, "latitude": 2.9428, "longitude": -76.0267, "country": "Colombia"},
|
|
28
|
+
{"name": "Volcán Tajumulco", "elevation_m": 4203, "latitude": 15.0333, "longitude": -91.9000, "country": "Guatemala"},
|
|
29
|
+
{"name": "Pico Duarte", "elevation_m": 3098, "latitude": 19.0833, "longitude": -70.7667, "country": "Dominican Republic"},
|
|
30
|
+
{"name": "Cerro El Pital", "elevation_m": 2730, "latitude": 14.2956, "longitude": -88.3075, "country": "El Salvador/Honduras"},
|
|
31
|
+
{"name": "Mount Vinson", "elevation_m": 4892, "latitude": -78.5250, "longitude": -85.6167, "country": "Antarctica"},
|
|
32
|
+
{"name": "Mount Kilimanjaro", "elevation_m": 5895, "latitude": -3.0674, "longitude": 37.3556, "country": "Tanzania"},
|
|
33
|
+
{"name": "Mount Kenya", "elevation_m": 5199, "latitude": -0.1517, "longitude": 37.3081, "country": "Kenya"},
|
|
34
|
+
{"name": "Mount Stanley", "elevation_m": 5109, "latitude": 0.3322, "longitude": 29.8739, "country": "Uganda/Democratic Republic of the Congo"},
|
|
35
|
+
{"name": "Mount Elbrus", "elevation_m": 5642, "latitude": 43.3547, "longitude": 42.4483, "country": "Russia"},
|
|
36
|
+
{"name": "Mont Blanc", "elevation_m": 4810, "latitude": 45.8326, "longitude": 6.8652, "country": "France/Italy"},
|
|
37
|
+
{"name": "Mount Etna", "elevation_m": 3357, "latitude": 37.7510, "longitude": 14.9937, "country": "Italy"},
|
|
38
|
+
{"name": "Mount Olympus", "elevation_m": 2917, "latitude": 40.0833, "longitude": 22.3333, "country": "Greece"},
|
|
39
|
+
{"name": "Mount Ararat", "elevation_m": 5137, "latitude": 39.7022, "longitude": 44.2931, "country": "Turkey"},
|
|
40
|
+
{"name": "Mount Damavand", "elevation_m": 5610, "latitude": 35.9522, "longitude": 52.1083, "country": "Iran"},
|
|
41
|
+
{"name": "Jabal An-Nabi Shu'ayb", "elevation_m": 3666, "latitude": 15.4900, "longitude": 44.0583, "country": "Yemen"},
|
|
42
|
+
{"name": "Jabal al-Lawz", "elevation_m": 2543, "latitude": 29.5833, "longitude": 38.6333, "country": "Saudi Arabia"},
|
|
43
|
+
{"name": "Mount Fuji", "elevation_m": 3776, "latitude": 35.3606, "longitude": 138.7274, "country": "Japan"},
|
|
44
|
+
{"name": "Mount Apo", "elevation_m": 2954, "latitude": 7.1031, "longitude": 125.2333, "country": "Philippines"},
|
|
45
|
+
{"name": "Gunung Puncak Jaya", "elevation_m": 4884, "latitude": -4.0825, "longitude": 137.1517, "country": "Indonesia"},
|
|
46
|
+
{"name": "Gunung Rinjani", "elevation_m": 3726, "latitude": -8.4083, "longitude": 116.4736, "country": "Indonesia"},
|
|
47
|
+
{"name": "Mount Kosciuszko", "elevation_m": 2228, "latitude": -36.4567, "longitude": 148.2622, "country": "Australia"},
|
|
48
|
+
{"name": "Mount Wilhelm", "elevation_m": 4509, "latitude": -5.7900, "longitude": 144.8700, "country": "Papua New Guinea"},
|
|
49
|
+
{"name": "Mount Cook (Aoraki)", "elevation_m": 3724, "latitude": -43.5942, "longitude": 170.1419, "country": "New Zealand"}
|
|
50
|
+
]
|