libgd-gis 0.4.3 → 0.4.4
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 +38 -32
- data/lib/gd/gis/style.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12f001e0a04fd6daa74954df04a6e9a7fb0c96125dcc4abc9d86ad47e2b88c7f
|
|
4
|
+
data.tar.gz: 691682c8ba0207ab1e57f6e47b42aca5f352e99674090b0fb88082d9a01252b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c211ae32a88b7c012ac235a4d00cf03b195074ebfd9a8140f2661368e0515125366e81c576f2d7e277eb38ab56f20e44c484fac8fcf44fb3ce44053d627e146
|
|
7
|
+
data.tar.gz: 245b629a1c2729a7e43d09a47c9e5833e3032699ca4d2b80479d19b9dfc44f4d14eb16261d2c0a113794ffea3e1eff029aa9cb1ed314e9e6f887c5fa16de28d9
|
data/README.md
CHANGED
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
<p align="right">
|
|
28
28
|
<img src="docs/images/logo-gis.png" width="160" />
|
|
29
29
|
</p>
|
|
30
|
-
|
|
31
30
|

|
|
32
31
|
[](https://www.codacy.com/app/libgd-gis/libgd-gis?utm_source=github.com&utm_medium=referral&utm_content=libgd-gis/libgd-gis&utm_campaign=Badge_Grade)
|
|
33
32
|
[](https://coveralls.io/github/libgd-gis/libgd-gis?branch=master)
|
|
@@ -35,16 +34,46 @@
|
|
|
35
34
|
|
|
36
35
|
---
|
|
37
36
|
|
|
38
|
-
**libgd-gis** is a
|
|
39
|
-
|
|
37
|
+
**libgd-gis** is a A native map rendering engine for Ruby built on **libgd**.
|
|
38
|
+
|
|
39
|
+
It allows developers to generate maps, tiles, and heatmaps directly from GeoJSON using the libgd raster engine — without external services.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Use Cases
|
|
44
|
+
|
|
45
|
+
libgd-gis is useful for:
|
|
46
|
+
|
|
47
|
+
- Generating static maps for Rails applications
|
|
48
|
+
- Rendering GeoJSON data to PNG images
|
|
49
|
+
- Creating heatmaps and geographic visualizations
|
|
50
|
+
- Building internal dashboards with map outputs
|
|
51
|
+
- Self-hosted alternatives to static map APIs
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Example
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
map = GD::GIS::Map.new(width: 800, height: 600)
|
|
59
|
+
|
|
60
|
+
map.add_geojson("countries.geojson")
|
|
61
|
+
map.add_point(lat: -34.6, lon: -58.4)
|
|
62
|
+
map.render
|
|
63
|
+
|
|
64
|
+
map.save("map.png")
|
|
65
|
+
```
|
|
40
66
|
|
|
41
|
-
|
|
67
|
+

|
|
42
68
|
|
|
43
69
|
---
|
|
44
70
|
|
|
71
|
+
> 🆕 **Update:** Style is no longer mandatory. Maps now render out-of-the-box using a built-in default style.
|
|
72
|
+
|
|
73
|
+
---
|
|
45
74
|
## Features
|
|
46
75
|
|
|
47
|
-
- Web Mercator tile rendering (OSM, CARTO, ESRI, Stamen, etc.)
|
|
76
|
+
- Web Mercator map and tile rendering (OSM, CARTO, ESRI, Stamen, etc.)
|
|
48
77
|
- CRS normalization (CRS84, EPSG:4326, EPSG:3857, Gauss–Krüger Argentina)
|
|
49
78
|
- Layered rendering pipeline
|
|
50
79
|
- YAML-based styling
|
|
@@ -54,20 +83,6 @@ This library is designed for **map visualization**, not for spatial analysis.
|
|
|
54
83
|
|
|
55
84
|
---
|
|
56
85
|
|
|
57
|
-
## Non-Goals
|
|
58
|
-
|
|
59
|
-
libgd-gis intentionally does **not** aim to be:
|
|
60
|
-
|
|
61
|
-
- a spatial analysis engine
|
|
62
|
-
- a replacement for PostGIS / GEOS
|
|
63
|
-
- a full map server
|
|
64
|
-
- a vector tile generator
|
|
65
|
-
|
|
66
|
-
If you need projections beyond Web Mercator or topological correctness,
|
|
67
|
-
use a full GIS stack.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
86
|
## Installation
|
|
72
87
|
|
|
73
88
|
Add to your Gemfile:
|
|
@@ -124,19 +139,6 @@ map.save("map.png")
|
|
|
124
139
|
|
|
125
140
|
---
|
|
126
141
|
|
|
127
|
-
## Styles Are Mandatory
|
|
128
|
-
|
|
129
|
-
libgd-gis requires an explicit **style definition** in order to render a map.
|
|
130
|
-
|
|
131
|
-
A `GD::GIS::Map` instance **will not render without a style**, and calling
|
|
132
|
-
`map.render` before assigning one will raise an error.
|
|
133
|
-
|
|
134
|
-
This is intentional.
|
|
135
|
-
|
|
136
|
-
Styles define how semantic layers (roads, water, parks, points, etc.) are mapped
|
|
137
|
-
to visual properties such as colors, stroke widths, fills, and drawing order.
|
|
138
|
-
No implicit or default styling is applied.
|
|
139
|
-
|
|
140
142
|
### Example:
|
|
141
143
|
|
|
142
144
|
```ruby
|
|
@@ -201,6 +203,8 @@ order:
|
|
|
201
203
|
This design ensures predictable rendering and makes all visual decisions explicit
|
|
202
204
|
and reproducible.
|
|
203
205
|
|
|
206
|
+

|
|
207
|
+
|
|
204
208
|
|
|
205
209
|
---
|
|
206
210
|
|
|
@@ -210,6 +214,8 @@ and reproducible.
|
|
|
210
214
|
LibGD-GIS includes a global dataset of predefined geographic areas.
|
|
211
215
|
You can use them directly as the `bbox` parameter.
|
|
212
216
|
|
|
217
|
+

|
|
218
|
+
|
|
213
219
|
### Example
|
|
214
220
|
|
|
215
221
|
```ruby
|
data/lib/gd/gis/style.rb
CHANGED
|
@@ -127,7 +127,7 @@ module GD
|
|
|
127
127
|
},
|
|
128
128
|
|
|
129
129
|
label: {
|
|
130
|
-
label: {
|
|
130
|
+
label: {
|
|
131
131
|
color: [229, 231, 235],
|
|
132
132
|
font: GD::GIS::FontHelper.find("DejaVuSans"),
|
|
133
133
|
size: 12
|
|
@@ -135,7 +135,7 @@ module GD
|
|
|
135
135
|
},
|
|
136
136
|
|
|
137
137
|
roads: {
|
|
138
|
-
roads: {
|
|
138
|
+
roads: {
|
|
139
139
|
color: [229, 231, 235],
|
|
140
140
|
font: GD::GIS::FontHelper.find("DejaVuSans"),
|
|
141
141
|
width: 6
|
|
@@ -172,7 +172,7 @@ module GD
|
|
|
172
172
|
},
|
|
173
173
|
|
|
174
174
|
track: {
|
|
175
|
-
track: {
|
|
175
|
+
track: {
|
|
176
176
|
stroke: [0, 85, 127, 250],
|
|
177
177
|
color: [250, 204, 21],
|
|
178
178
|
width: 2,
|