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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# Paraná bbox (alineado a tiles)
|
|
5
|
+
BBOX = [-60.556640625, -31.8402326679, -60.46875, -31.6907818061]
|
|
6
|
+
|
|
7
|
+
map = GD::GIS::Map.new(
|
|
8
|
+
bbox: BBOX,
|
|
9
|
+
zoom: 14,
|
|
10
|
+
basemap: :carto_light
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# Cargar Av. Ramírez desde OSM
|
|
14
|
+
geo = JSON.parse(File.read("ramirez_full.geojson"))
|
|
15
|
+
features = geo["features"]
|
|
16
|
+
|
|
17
|
+
# Dibujar la avenida como calle real
|
|
18
|
+
map.add_lines(
|
|
19
|
+
features,
|
|
20
|
+
stroke: [0, 0, 0, 90], # borde
|
|
21
|
+
fill: [0, 0, 0, 90], # calzada
|
|
22
|
+
width: 50 # ancho en metros
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
map.add_lines(
|
|
26
|
+
features,
|
|
27
|
+
stroke: [255, 165, 0, 90],
|
|
28
|
+
width: 2
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Etiqueta
|
|
32
|
+
map.add_points(
|
|
33
|
+
[{ lon: -60.5205, lat: -31.76, name: "Av. Ramírez" }],
|
|
34
|
+
lon: ->(p){ p[:lon] },
|
|
35
|
+
lat: ->(p){ p[:lat] },
|
|
36
|
+
label: ->(p){ p[:name] },
|
|
37
|
+
font: "./fonts/DejaVuSans.ttf",
|
|
38
|
+
size: 16,
|
|
39
|
+
color: [0,0,0,160],
|
|
40
|
+
icon: "mark.png"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
map.render
|
|
44
|
+
map.save("ramirez_gis.png")
|
|
45
|
+
|
|
46
|
+
puts "Generated ramirez_gis.png"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "FeatureCollection",
|
|
3
|
+
"name": "lines",
|
|
4
|
+
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
|
|
5
|
+
"features": [
|
|
6
|
+
{ "type": "Feature", "properties": { "osm_id": "219940989", "name": "Avenida Francisco Ramírez", "highway": "residential", "z_order": 3, "other_tags": "\"maxspeed\"=>\"50\",\"oneway\"=>\"no\",\"surface\"=>\"unpaved\"" }, "geometry": { "type": "LineString", "coordinates": [ [ -60.5251827, -31.7761256 ], [ -60.5253463, -31.7768341 ], [ -60.5253905, -31.7770598 ], [ -60.5254739, -31.7775396 ], [ -60.5255012, -31.7776896 ], [ -60.5257433, -31.7787484 ], [ -60.5260108, -31.779936 ], [ -60.526105, -31.780401 ], [ -60.5262588, -31.7809974 ], [ -60.5265826, -31.7825533 ], [ -60.5268783, -31.7839116 ], [ -60.5272739, -31.7858544 ], [ -60.5276437, -31.7875383 ], [ -60.5278189, -31.7883138 ], [ -60.5282972, -31.7907331 ] ] } },
|
|
7
|
+
{ "type": "Feature", "properties": { "osm_id": "1223354126", "name": "Avenida Francisco Ramírez", "highway": "residential", "z_order": 3, "other_tags": "\"maxspeed\"=>\"50\",\"oneway\"=>\"no\",\"surface\"=>\"unpaved\"" }, "geometry": { "type": "LineString", "coordinates": [ [ -60.52453, -31.7730628 ], [ -60.5247139, -31.7739941 ], [ -60.5247635, -31.7742453 ], [ -60.5247859, -31.7743491 ], [ -60.5250583, -31.7755461 ], [ -60.5251827, -31.7761256 ] ] } }
|
|
8
|
+
]
|
|
9
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
cat << 'EOF' > query.overpass
|
|
4
|
+
[out:json][timeout:25];
|
|
5
|
+
|
|
6
|
+
(
|
|
7
|
+
way["highway"~"primary|secondary|trunk"]
|
|
8
|
+
(-31.79, -60.56, -31.70, -60.52);
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
out geom;
|
|
12
|
+
EOF
|
|
13
|
+
|
|
14
|
+
curl -X POST \
|
|
15
|
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
16
|
+
--data "data=$(cat query.overpass)" \
|
|
17
|
+
https://overpass.kumi.systems/api/interpreter \
|
|
18
|
+
> ramirez.json
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "gd/gis"
|
|
3
|
+
|
|
4
|
+
# BBox grande alineado a tiles (Paraná)
|
|
5
|
+
BBOX = [-60.556640625, -31.8402326679, -60.46875, -31.6907818061]
|
|
6
|
+
|
|
7
|
+
map = GD::GIS::Map.new(
|
|
8
|
+
bbox: BBOX,
|
|
9
|
+
zoom: 14,
|
|
10
|
+
basemap: :carto_light
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
geo = JSON.parse(File.read("ramirez_full.geojson"))
|
|
14
|
+
features = geo["features"]
|
|
15
|
+
|
|
16
|
+
# Expandir todos los LineString en una nube de puntos
|
|
17
|
+
points = []
|
|
18
|
+
|
|
19
|
+
features.each do |f|
|
|
20
|
+
coords = f["geometry"]["coordinates"]
|
|
21
|
+
|
|
22
|
+
# Puede haber MultiLineString
|
|
23
|
+
if coords.first.first.is_a?(Array)
|
|
24
|
+
coords.each do |line|
|
|
25
|
+
line.each do |pt|
|
|
26
|
+
points << { lon: pt[0], lat: pt[1] }
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
else
|
|
30
|
+
coords.each do |pt|
|
|
31
|
+
points << { lon: pt[0], lat: pt[1] }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
map.add_points(
|
|
37
|
+
points,
|
|
38
|
+
lon: ->(p) { p[:lon] },
|
|
39
|
+
lat: ->(p) { p[:lat] },
|
|
40
|
+
icon: "dot.png"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
map.render
|
|
44
|
+
map.save("ramirez_full.png")
|
|
45
|
+
|
|
46
|
+
puts "Generated ramirez_full.png"
|