libgd-gis 0.1.2 → 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/{a-world_peaks.rb → america-peaks.rb} +4 -4
- 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/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/parana_museos.rb +49 -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/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/7_27_43.png +0 -0
- data/examples/tmp/tiles/7_27_44.png +0 -0
- data/examples/tmp/tiles/7_27_45.png +0 -0
- data/examples/tmp/tiles/7_27_46.png +0 -0
- data/examples/tmp/tiles/7_27_47.png +0 -0
- data/examples/tmp/tiles/7_27_48.png +0 -0
- data/examples/tmp/tiles/7_27_49.png +0 -0
- data/examples/tmp/tiles/7_27_50.png +0 -0
- data/examples/tmp/tiles/7_28_43.png +0 -0
- data/examples/tmp/tiles/7_28_44.png +0 -0
- data/examples/tmp/tiles/7_28_45.png +0 -0
- data/examples/tmp/tiles/7_28_46.png +0 -0
- data/examples/tmp/tiles/7_28_47.png +0 -0
- data/examples/tmp/tiles/7_28_48.png +0 -0
- data/examples/tmp/tiles/7_28_49.png +0 -0
- data/examples/tmp/tiles/7_28_50.png +0 -0
- data/examples/tmp/tiles/7_29_43.png +0 -0
- data/examples/tmp/tiles/7_29_44.png +0 -0
- data/examples/tmp/tiles/7_29_45.png +0 -0
- data/examples/tmp/tiles/7_29_46.png +0 -0
- data/examples/tmp/tiles/7_29_47.png +0 -0
- data/examples/tmp/tiles/7_29_48.png +0 -0
- data/examples/tmp/tiles/7_29_49.png +0 -0
- data/examples/tmp/tiles/7_29_50.png +0 -0
- data/examples/tmp/tiles/7_30_43.png +0 -0
- data/examples/tmp/tiles/7_30_44.png +0 -0
- data/examples/tmp/tiles/7_30_45.png +0 -0
- data/examples/tmp/tiles/7_30_46.png +0 -0
- data/examples/tmp/tiles/7_30_47.png +0 -0
- data/examples/tmp/tiles/7_30_48.png +0 -0
- data/examples/tmp/tiles/7_30_49.png +0 -0
- data/examples/tmp/tiles/7_30_50.png +0 -0
- data/examples/tmp/tiles/7_31_43.png +0 -0
- data/examples/tmp/tiles/7_31_44.png +0 -0
- data/examples/tmp/tiles/7_31_45.png +0 -0
- data/examples/tmp/tiles/7_31_46.png +0 -0
- data/examples/tmp/tiles/7_31_47.png +0 -0
- data/examples/tmp/tiles/7_31_48.png +0 -0
- data/examples/tmp/tiles/7_31_49.png +0 -0
- data/examples/tmp/tiles/7_31_50.png +0 -0
- data/examples/tmp/tiles/7_32_43.png +0 -0
- data/examples/tmp/tiles/7_32_44.png +0 -0
- data/examples/tmp/tiles/7_32_45.png +0 -0
- data/examples/tmp/tiles/7_32_46.png +0 -0
- data/examples/tmp/tiles/7_32_47.png +0 -0
- data/examples/tmp/tiles/7_32_48.png +0 -0
- data/examples/tmp/tiles/7_32_49.png +0 -0
- data/examples/tmp/tiles/7_32_50.png +0 -0
- data/examples/tmp/tiles/7_37_71.png +0 -0
- data/examples/tmp/tiles/7_37_72.png +0 -0
- data/examples/tmp/tiles/7_37_73.png +0 -0
- data/examples/tmp/tiles/7_37_74.png +0 -0
- data/examples/tmp/tiles/7_37_75.png +0 -0
- data/examples/tmp/tiles/7_37_76.png +0 -0
- data/examples/tmp/tiles/7_37_77.png +0 -0
- data/examples/tmp/tiles/7_37_78.png +0 -0
- data/examples/tmp/tiles/7_37_79.png +0 -0
- data/examples/tmp/tiles/7_37_80.png +0 -0
- data/examples/tmp/tiles/7_37_81.png +0 -0
- data/examples/tmp/tiles/7_37_82.png +0 -0
- data/examples/tmp/tiles/7_37_83.png +0 -0
- data/examples/tmp/tiles/7_37_84.png +0 -0
- data/examples/tmp/tiles/7_37_85.png +0 -0
- data/examples/tmp/tiles/7_37_86.png +0 -0
- data/examples/tmp/tiles/7_37_87.png +0 -0
- data/examples/tmp/tiles/7_38_71.png +0 -0
- data/examples/tmp/tiles/7_38_72.png +0 -0
- data/examples/tmp/tiles/7_38_73.png +0 -0
- data/examples/tmp/tiles/7_38_74.png +0 -0
- data/examples/tmp/tiles/7_38_75.png +0 -0
- data/examples/tmp/tiles/7_38_76.png +0 -0
- data/examples/tmp/tiles/7_38_77.png +0 -0
- data/examples/tmp/tiles/7_38_78.png +0 -0
- data/examples/tmp/tiles/7_38_79.png +0 -0
- data/examples/tmp/tiles/7_38_80.png +0 -0
- data/examples/tmp/tiles/7_38_81.png +0 -0
- data/examples/tmp/tiles/7_38_82.png +0 -0
- data/examples/tmp/tiles/7_38_83.png +0 -0
- data/examples/tmp/tiles/7_38_84.png +0 -0
- data/examples/tmp/tiles/7_38_85.png +0 -0
- data/examples/tmp/tiles/7_38_86.png +0 -0
- data/examples/tmp/tiles/7_38_87.png +0 -0
- data/examples/tmp/tiles/7_39_71.png +0 -0
- data/examples/tmp/tiles/7_39_72.png +0 -0
- data/examples/tmp/tiles/7_39_73.png +0 -0
- data/examples/tmp/tiles/7_39_74.png +0 -0
- data/examples/tmp/tiles/7_39_75.png +0 -0
- data/examples/tmp/tiles/7_39_76.png +0 -0
- data/examples/tmp/tiles/7_39_77.png +0 -0
- data/examples/tmp/tiles/7_39_78.png +0 -0
- data/examples/tmp/tiles/7_39_79.png +0 -0
- data/examples/tmp/tiles/7_39_80.png +0 -0
- data/examples/tmp/tiles/7_39_81.png +0 -0
- data/examples/tmp/tiles/7_39_82.png +0 -0
- data/examples/tmp/tiles/7_39_83.png +0 -0
- data/examples/tmp/tiles/7_39_84.png +0 -0
- data/examples/tmp/tiles/7_39_85.png +0 -0
- data/examples/tmp/tiles/7_39_86.png +0 -0
- data/examples/tmp/tiles/7_39_87.png +0 -0
- data/examples/tmp/tiles/7_40_71.png +0 -0
- data/examples/tmp/tiles/7_40_72.png +0 -0
- data/examples/tmp/tiles/7_40_73.png +0 -0
- data/examples/tmp/tiles/7_40_74.png +0 -0
- data/examples/tmp/tiles/7_40_75.png +0 -0
- data/examples/tmp/tiles/7_40_76.png +0 -0
- data/examples/tmp/tiles/7_40_77.png +0 -0
- data/examples/tmp/tiles/7_40_78.png +0 -0
- data/examples/tmp/tiles/7_40_79.png +0 -0
- data/examples/tmp/tiles/7_40_80.png +0 -0
- data/examples/tmp/tiles/7_40_81.png +0 -0
- data/examples/tmp/tiles/7_40_82.png +0 -0
- data/examples/tmp/tiles/7_40_83.png +0 -0
- data/examples/tmp/tiles/7_40_84.png +0 -0
- data/examples/tmp/tiles/7_40_85.png +0 -0
- data/examples/tmp/tiles/7_40_86.png +0 -0
- data/examples/tmp/tiles/7_40_87.png +0 -0
- data/examples/tmp/tiles/7_41_71.png +0 -0
- data/examples/tmp/tiles/7_41_72.png +0 -0
- data/examples/tmp/tiles/7_41_73.png +0 -0
- data/examples/tmp/tiles/7_41_74.png +0 -0
- data/examples/tmp/tiles/7_41_75.png +0 -0
- data/examples/tmp/tiles/7_41_76.png +0 -0
- data/examples/tmp/tiles/7_41_77.png +0 -0
- data/examples/tmp/tiles/7_41_78.png +0 -0
- data/examples/tmp/tiles/7_41_79.png +0 -0
- data/examples/tmp/tiles/7_41_80.png +0 -0
- data/examples/tmp/tiles/7_41_81.png +0 -0
- data/examples/tmp/tiles/7_41_82.png +0 -0
- data/examples/tmp/tiles/7_41_83.png +0 -0
- data/examples/tmp/tiles/7_41_84.png +0 -0
- data/examples/tmp/tiles/7_41_85.png +0 -0
- data/examples/tmp/tiles/7_41_86.png +0 -0
- data/examples/tmp/tiles/7_41_87.png +0 -0
- data/examples/tmp/tiles/7_42_71.png +0 -0
- data/examples/tmp/tiles/7_42_72.png +0 -0
- data/examples/tmp/tiles/7_42_73.png +0 -0
- data/examples/tmp/tiles/7_42_74.png +0 -0
- data/examples/tmp/tiles/7_42_75.png +0 -0
- data/examples/tmp/tiles/7_42_76.png +0 -0
- data/examples/tmp/tiles/7_42_77.png +0 -0
- data/examples/tmp/tiles/7_42_78.png +0 -0
- data/examples/tmp/tiles/7_42_79.png +0 -0
- data/examples/tmp/tiles/7_42_80.png +0 -0
- data/examples/tmp/tiles/7_42_81.png +0 -0
- data/examples/tmp/tiles/7_42_82.png +0 -0
- data/examples/tmp/tiles/7_42_83.png +0 -0
- data/examples/tmp/tiles/7_42_84.png +0 -0
- data/examples/tmp/tiles/7_42_85.png +0 -0
- data/examples/tmp/tiles/7_42_86.png +0 -0
- data/examples/tmp/tiles/7_42_87.png +0 -0
- data/examples/tmp/tiles/7_43_71.png +0 -0
- data/examples/tmp/tiles/7_43_72.png +0 -0
- data/examples/tmp/tiles/7_43_73.png +0 -0
- data/examples/tmp/tiles/7_43_74.png +0 -0
- data/examples/tmp/tiles/7_43_75.png +0 -0
- data/examples/tmp/tiles/7_43_76.png +0 -0
- data/examples/tmp/tiles/7_43_77.png +0 -0
- data/examples/tmp/tiles/7_43_78.png +0 -0
- data/examples/tmp/tiles/7_43_79.png +0 -0
- data/examples/tmp/tiles/7_43_80.png +0 -0
- data/examples/tmp/tiles/7_43_81.png +0 -0
- data/examples/tmp/tiles/7_43_82.png +0 -0
- data/examples/tmp/tiles/7_43_83.png +0 -0
- data/examples/tmp/tiles/7_43_84.png +0 -0
- data/examples/tmp/tiles/7_43_85.png +0 -0
- data/examples/tmp/tiles/7_43_86.png +0 -0
- data/examples/tmp/tiles/7_43_87.png +0 -0
- data/examples/tmp/tiles/7_44_71.png +0 -0
- data/examples/tmp/tiles/7_44_72.png +0 -0
- data/examples/tmp/tiles/7_44_73.png +0 -0
- data/examples/tmp/tiles/7_44_74.png +0 -0
- data/examples/tmp/tiles/7_44_75.png +0 -0
- data/examples/tmp/tiles/7_44_76.png +0 -0
- data/examples/tmp/tiles/7_44_77.png +0 -0
- data/examples/tmp/tiles/7_44_78.png +0 -0
- data/examples/tmp/tiles/7_44_79.png +0 -0
- data/examples/tmp/tiles/7_44_80.png +0 -0
- data/examples/tmp/tiles/7_44_81.png +0 -0
- data/examples/tmp/tiles/7_44_82.png +0 -0
- data/examples/tmp/tiles/7_44_83.png +0 -0
- data/examples/tmp/tiles/7_44_84.png +0 -0
- data/examples/tmp/tiles/7_44_85.png +0 -0
- data/examples/tmp/tiles/7_44_86.png +0 -0
- data/examples/tmp/tiles/7_44_87.png +0 -0
- data/examples/tmp/tiles/7_75_64.png +0 -0
- data/examples/tmp/tiles/7_75_65.png +0 -0
- data/examples/tmp/tiles/7_75_66.png +0 -0
- data/examples/tmp/tiles/7_75_67.png +0 -0
- data/examples/tmp/tiles/7_75_68.png +0 -0
- data/examples/tmp/tiles/7_76_64.png +0 -0
- data/examples/tmp/tiles/7_76_65.png +0 -0
- data/examples/tmp/tiles/7_76_66.png +0 -0
- data/examples/tmp/tiles/7_76_67.png +0 -0
- data/examples/tmp/tiles/7_76_68.png +0 -0
- data/examples/tmp/tiles/7_77_64.png +0 -0
- data/examples/tmp/tiles/7_77_65.png +0 -0
- data/examples/tmp/tiles/7_77_66.png +0 -0
- data/examples/tmp/tiles/7_77_67.png +0 -0
- data/examples/tmp/tiles/7_77_68.png +0 -0
- data/lib/gd/gis/basemap.rb +116 -9
- data/lib/gd/gis/geometry.rb +40 -0
- data/lib/gd/gis/layer_lines.rb +36 -0
- data/lib/gd/gis/layer_points.rb +31 -1
- data/lib/gd/gis/layer_polygons.rb +38 -0
- data/lib/gd/gis/map.rb +53 -33
- data/lib/gd/gis/projection.rb +14 -0
- metadata +339 -17
- /data/examples/{fonts → street/fonts}/DejaVu Fonts License.txt +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSans-Bold.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSans-BoldOblique.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSans-ExtraLight.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSans-Oblique.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSans.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSansCondensed-Bold.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSansCondensed-BoldOblique.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSansCondensed-Oblique.ttf +0 -0
- /data/examples/{fonts → street/fonts}/DejaVuSansCondensed.ttf +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/gd/gis/basemap.rb
CHANGED
|
@@ -5,6 +5,7 @@ module GD
|
|
|
5
5
|
module GIS
|
|
6
6
|
class Basemap
|
|
7
7
|
TILE_SIZE = 256
|
|
8
|
+
attr_reader :origin_x, :origin_y
|
|
8
9
|
|
|
9
10
|
def initialize(zoom, bbox, provider=:carto_light)
|
|
10
11
|
@zoom = zoom
|
|
@@ -12,8 +13,93 @@ module GD
|
|
|
12
13
|
@provider = provider
|
|
13
14
|
end
|
|
14
15
|
|
|
15
|
-
def url(z,x,y)
|
|
16
|
-
|
|
16
|
+
def url(z, x, y, style = :osm)
|
|
17
|
+
case style
|
|
18
|
+
|
|
19
|
+
# ==============================
|
|
20
|
+
# OpenStreetMap
|
|
21
|
+
# ==============================
|
|
22
|
+
when :osm
|
|
23
|
+
"https://tile.openstreetmap.org/#{z}/#{x}/#{y}.png"
|
|
24
|
+
|
|
25
|
+
when :osm_hot
|
|
26
|
+
"https://tile.openstreetmap.fr/hot/#{z}/#{x}/#{y}.png"
|
|
27
|
+
|
|
28
|
+
when :osm_fr
|
|
29
|
+
"https://a.tile.openstreetmap.fr/osmfr/#{z}/#{x}/#{y}.png"
|
|
30
|
+
|
|
31
|
+
# ==============================
|
|
32
|
+
# CARTO
|
|
33
|
+
# ==============================
|
|
34
|
+
when :carto_light
|
|
35
|
+
"https://a.basemaps.cartocdn.com/light_all/#{z}/#{x}/#{y}.png"
|
|
36
|
+
|
|
37
|
+
when :carto_light_nolabels
|
|
38
|
+
"https://a.basemaps.cartocdn.com/light_nolabels/#{z}/#{x}/#{y}.png"
|
|
39
|
+
|
|
40
|
+
when :carto_dark
|
|
41
|
+
"https://a.basemaps.cartocdn.com/dark_all/#{z}/#{x}/#{y}.png"
|
|
42
|
+
|
|
43
|
+
when :carto_dark_nolabels
|
|
44
|
+
"https://a.basemaps.cartocdn.com/dark_nolabels/#{z}/#{x}/#{y}.png"
|
|
45
|
+
|
|
46
|
+
# ==============================
|
|
47
|
+
# ESRI / ArcGIS (Satellite, terrain, hybrid)
|
|
48
|
+
# ==============================
|
|
49
|
+
when :esri_satellite
|
|
50
|
+
"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/#{z}/#{y}/#{x}"
|
|
51
|
+
|
|
52
|
+
when :esri_streets
|
|
53
|
+
"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/#{z}/#{y}/#{x}"
|
|
54
|
+
|
|
55
|
+
when :esri_terrain
|
|
56
|
+
"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/#{z}/#{y}/#{x}"
|
|
57
|
+
|
|
58
|
+
when :esri_hybrid
|
|
59
|
+
"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/#{z}/#{y}/#{x}"
|
|
60
|
+
|
|
61
|
+
# ==============================
|
|
62
|
+
# STAMEN
|
|
63
|
+
# ==============================
|
|
64
|
+
when :stamen_toner
|
|
65
|
+
"https://stamen-tiles.a.ssl.fastly.net/toner/#{z}/#{x}/#{y}.png"
|
|
66
|
+
|
|
67
|
+
when :stamen_toner_lite
|
|
68
|
+
"https://stamen-tiles.a.ssl.fastly.net/toner-lite/#{z}/#{x}/#{y}.png"
|
|
69
|
+
|
|
70
|
+
when :stamen_terrain
|
|
71
|
+
"https://stamen-tiles.a.ssl.fastly.net/terrain/#{z}/#{x}/#{y}.png"
|
|
72
|
+
|
|
73
|
+
when :stamen_watercolor
|
|
74
|
+
"https://stamen-tiles.a.ssl.fastly.net/watercolor/#{z}/#{x}/#{y}.jpg"
|
|
75
|
+
|
|
76
|
+
# ==============================
|
|
77
|
+
# OpenTopoMap
|
|
78
|
+
# ==============================
|
|
79
|
+
when :topo
|
|
80
|
+
"https://a.tile.opentopomap.org/#{z}/#{x}/#{y}.png"
|
|
81
|
+
|
|
82
|
+
# ==============================
|
|
83
|
+
# Wikimedia
|
|
84
|
+
# ==============================
|
|
85
|
+
when :wikimedia
|
|
86
|
+
"https://maps.wikimedia.org/osm-intl/#{z}/#{x}/#{y}.png"
|
|
87
|
+
|
|
88
|
+
# ==============================
|
|
89
|
+
# OpenRailwayMap
|
|
90
|
+
# ==============================
|
|
91
|
+
when :railway
|
|
92
|
+
"https://tiles.openrailwaymap.org/standard/#{z}/#{x}/#{y}.png"
|
|
93
|
+
|
|
94
|
+
# ==============================
|
|
95
|
+
# CyclOSM
|
|
96
|
+
# ==============================
|
|
97
|
+
when :cyclosm
|
|
98
|
+
"https://a.tile-cyclosm.openstreetmap.fr/cyclosm/#{z}/#{x}/#{y}.png"
|
|
99
|
+
|
|
100
|
+
else
|
|
101
|
+
raise "Unknown basemap style: #{style}"
|
|
102
|
+
end
|
|
17
103
|
end
|
|
18
104
|
|
|
19
105
|
def lon2tile(lon)
|
|
@@ -36,30 +122,51 @@ module GD
|
|
|
36
122
|
@x_min = x_min
|
|
37
123
|
@y_min = y_min
|
|
38
124
|
|
|
125
|
+
@origin_x = x_min * TILE_SIZE
|
|
126
|
+
@origin_y = y_min * TILE_SIZE
|
|
127
|
+
|
|
39
128
|
FileUtils.mkdir_p("tmp/tiles")
|
|
40
129
|
|
|
41
130
|
tiles = []
|
|
42
131
|
|
|
43
132
|
(x_min..x_max).each do |x|
|
|
44
133
|
(y_min..y_max).each do |y|
|
|
45
|
-
path =
|
|
46
|
-
|
|
47
|
-
|
|
134
|
+
path = nil
|
|
135
|
+
|
|
136
|
+
unless File.exist?("tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.png") ||
|
|
137
|
+
File.exist?("tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.jpg")
|
|
138
|
+
|
|
139
|
+
uri = URI(url(@zoom, x, y, @provider))
|
|
48
140
|
|
|
49
141
|
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
|
50
142
|
req = Net::HTTP::Get.new(uri)
|
|
51
143
|
req["User-Agent"] = "libgd-gis/0.1 (Ruby)"
|
|
52
144
|
|
|
53
145
|
res = http.request(req)
|
|
146
|
+
raise "Tile fetch failed #{res.code}" unless res.code == "200"
|
|
147
|
+
|
|
148
|
+
content_type = res["content-type"]
|
|
54
149
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
150
|
+
ext =
|
|
151
|
+
if content_type&.include?("png")
|
|
152
|
+
"png"
|
|
153
|
+
elsif content_type&.include?("jpeg") || content_type&.include?("jpg")
|
|
154
|
+
"jpg"
|
|
155
|
+
else
|
|
156
|
+
raise "Unsupported tile type: #{content_type}"
|
|
157
|
+
end
|
|
58
158
|
|
|
159
|
+
path = "tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.#{ext}"
|
|
59
160
|
File.binwrite(path, res.body)
|
|
60
161
|
end
|
|
61
|
-
|
|
162
|
+
else
|
|
163
|
+
if File.exist?("tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.png")
|
|
164
|
+
path = "tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.png"
|
|
165
|
+
else
|
|
166
|
+
path = "tmp/tiles/#{@provider}_#{@zoom}_#{x}_#{y}.jpg"
|
|
167
|
+
end
|
|
62
168
|
end
|
|
169
|
+
|
|
63
170
|
tiles << [x,y,path]
|
|
64
171
|
end
|
|
65
172
|
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module GD
|
|
2
|
+
module GIS
|
|
3
|
+
module Geometry
|
|
4
|
+
def self.buffer_line(coords, meters)
|
|
5
|
+
left = []
|
|
6
|
+
right = []
|
|
7
|
+
|
|
8
|
+
coords.each_cons(2) do |a,b|
|
|
9
|
+
x1,y1 = a
|
|
10
|
+
x2,y2 = b
|
|
11
|
+
|
|
12
|
+
dx = x2 - x1
|
|
13
|
+
dy = y2 - y1
|
|
14
|
+
|
|
15
|
+
len = Math.sqrt(dx*dx + dy*dy)
|
|
16
|
+
next if len == 0
|
|
17
|
+
|
|
18
|
+
# normal vector
|
|
19
|
+
nx = -dy / len
|
|
20
|
+
ny = dx / len
|
|
21
|
+
|
|
22
|
+
# offset in degrees (approx)
|
|
23
|
+
# 1 meter ≈ 1 / 111_320 degrees
|
|
24
|
+
off = meters / 111_320.0
|
|
25
|
+
|
|
26
|
+
left << [x1 + nx*off, y1 + ny*off]
|
|
27
|
+
right << [x1 - nx*off, y1 - ny*off]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# add last point
|
|
31
|
+
x2,y2 = coords.last
|
|
32
|
+
left << [x2, y2]
|
|
33
|
+
right << [x2, y2]
|
|
34
|
+
|
|
35
|
+
polygon = left + right.reverse
|
|
36
|
+
polygon
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module GD
|
|
2
|
+
module GIS
|
|
3
|
+
class LinesLayer
|
|
4
|
+
def initialize(features, stroke:, width:)
|
|
5
|
+
@features = features
|
|
6
|
+
@stroke = stroke
|
|
7
|
+
@width = width
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def render!(img, projection)
|
|
11
|
+
@features.each do |f|
|
|
12
|
+
geom = f["geometry"]
|
|
13
|
+
|
|
14
|
+
case geom["type"]
|
|
15
|
+
when "LineString"
|
|
16
|
+
draw_line(geom["coordinates"], img, projection)
|
|
17
|
+
when "MultiLineString"
|
|
18
|
+
geom["coordinates"].each do |line|
|
|
19
|
+
draw_line(line, img, projection)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def draw_line(coords, img, projection)
|
|
26
|
+
pts = coords.map { |p| projection.call(p[0], p[1]) }
|
|
27
|
+
|
|
28
|
+
(0...pts.size-1).each do |i|
|
|
29
|
+
x1,y1 = pts[i]
|
|
30
|
+
x2,y2 = pts[i+1]
|
|
31
|
+
img.line(x1,y1,x2,y2,@stroke, thickness: @width)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/gd/gis/layer_points.rb
CHANGED
|
@@ -5,7 +5,12 @@ module GD
|
|
|
5
5
|
@data = data
|
|
6
6
|
@lon = lon
|
|
7
7
|
@lat = lat
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
if icon
|
|
10
|
+
@icon = GD::Image.open(icon)
|
|
11
|
+
else
|
|
12
|
+
@icon = build_default_marker
|
|
13
|
+
end
|
|
9
14
|
|
|
10
15
|
@label = label
|
|
11
16
|
@font = font
|
|
@@ -16,6 +21,31 @@ module GD
|
|
|
16
21
|
@icon.save_alpha = true
|
|
17
22
|
end
|
|
18
23
|
|
|
24
|
+
def build_default_marker
|
|
25
|
+
size = 32
|
|
26
|
+
img = GD::Image.new(size, size)
|
|
27
|
+
img.alpha_blending = true
|
|
28
|
+
img.save_alpha = true
|
|
29
|
+
|
|
30
|
+
transparent = GD::Color.rgba(0,0,0,0)
|
|
31
|
+
img.filled_rectangle(0,0,size,size,transparent)
|
|
32
|
+
|
|
33
|
+
white = GD::Color.rgb(255,255,255)
|
|
34
|
+
black = GD::Color.rgb(0,0,0)
|
|
35
|
+
|
|
36
|
+
cx = size / 2
|
|
37
|
+
cy = size / 2
|
|
38
|
+
r = 12
|
|
39
|
+
|
|
40
|
+
# borde blanco
|
|
41
|
+
img.arc(cx, cy, r*2+4, r*2+4, 0, 360, white)
|
|
42
|
+
|
|
43
|
+
# relleno negro
|
|
44
|
+
img.filled_arc(cx, cy, r*2, r*2, 0, 360, black)
|
|
45
|
+
|
|
46
|
+
img
|
|
47
|
+
end
|
|
48
|
+
|
|
19
49
|
def render!(img, projector)
|
|
20
50
|
w = @icon.width
|
|
21
51
|
h = @icon.height
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module GD
|
|
2
|
+
module GIS
|
|
3
|
+
class PolygonsLayer
|
|
4
|
+
def initialize(polygons, fill:, stroke: nil, width: nil)
|
|
5
|
+
@polygons = polygons
|
|
6
|
+
@fill = fill
|
|
7
|
+
@stroke = stroke
|
|
8
|
+
@width = width
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.from_lines(features, stroke:, fill:, width:)
|
|
12
|
+
polys = []
|
|
13
|
+
|
|
14
|
+
features.each do |f|
|
|
15
|
+
coords = f["geometry"]["coordinates"]
|
|
16
|
+
poly = Geometry.buffer_line(coords, width)
|
|
17
|
+
polys << poly
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
new(polys, fill: fill, stroke: stroke)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def render!(img, projection)
|
|
24
|
+
@polygons.each do |poly|
|
|
25
|
+
pts = poly.map { |p| projection.call(p[0], p[1]) }
|
|
26
|
+
|
|
27
|
+
img.filled_polygon(pts, @fill)
|
|
28
|
+
|
|
29
|
+
if @stroke
|
|
30
|
+
pts.each_cons(2) do |a,b|
|
|
31
|
+
img.line(a[0],a[1],b[0],b[1],@stroke, thickness: 1)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|