From e94def07a93aeb71e7862fb6dd2b87975ba437ad Mon Sep 17 00:00:00 2001 From: Cellie Date: Mon, 17 Mar 2025 19:20:22 +0100 Subject: [PATCH 1/5] Update README.md --- README.md | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e9d60e4..36c56d0 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,34 @@ # OpenStreetMap-esp32 - ## What is this -This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and caching system for ESP32-based devices.
+This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices. Under the hood it uses [LovyanGFX](https://github.com/lovyan03/LovyanGFX) and [PNGdec](https://github.com/bitbank2/PNGdec) to do the heavy lifting. -It fetches, decodes and caches OSM tiles, composes a map from these tiles and returns the map as a LGFX sprite.
The sprite can be pushed to the screen or used for further composing.
Downloaded tiles are cached in psram. +A map is composed from downloaded OSM tiles and returned as a LGFX sprite. +The sprite can be pushed to the screen or used for further composing. +Downloaded tiles are cached in psram for reuse. -The library should work on any ESP32 type with a bit of psram and a LovyanGFX compatible display. +The library should work on any ESP32 type with psram and a LovyanGFX compatible display. -## Copyright and license of the map data +The downloaded tile cache gets large very quickly -128kB per tile- so a ESP32 with psram is required. -The OpenstreetMap-esp32 library -this library- is licensed under the [MIT license](/license).
The downloaded tile data has a different license than this library. +![map](https://github.com/user-attachments/assets/bc0534c1-b2e6-4f6e-804f-95b7db00c850) +An example 320px by 240px map -OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF).
-Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use). +## License differences between this library and the map data + +#### This library has a MIT license -## Screenshots and example code +The `OpenstreetMap-esp32` library -this library- is licensed under the [MIT license](/LICENSE). -![map](https://github.com/user-attachments/assets/bc0534c1-b2e6-4f6e-804f-95b7db00c850) +#### The downloaded tile data has a Open Data Commons Open Database License (ODbL) -Screenshot of a 320x240 map from a esp32-s3-box-lite +OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF). + +Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use). -### Example code returning the default 320x240 map +## Example code +### Example returning the default 320x240 map ```c++ #include @@ -82,11 +88,7 @@ void loop() } ``` -![map](https://github.com/user-attachments/assets/9a92bbff-e96d-444d-8b34-29801744fa80) - -Screenshot of a 480x800 map from a esp32-8048s050 - -### Example code setting map resolution and cache size on RGB panel devices +### Example setting map resolution and cache size on RGB panel devices ```c++ #include @@ -151,7 +153,8 @@ void loop() delay(1000); } ``` - +![map](https://github.com/user-attachments/assets/9a92bbff-e96d-444d-8b34-29801744fa80) +Screenshot of a 480x800 map from a esp32-8048s050 ### PlatformIO setup ```bash lib_deps = From a1369ec562b3917916a027f892d1511f466a9813 Mon Sep 17 00:00:00 2001 From: Cellie Date: Mon, 17 Mar 2025 19:27:00 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 36c56d0..3fcefc3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # OpenStreetMap-esp32 + ## What is this This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices. @@ -28,6 +29,7 @@ OpenStreetMap® is open data, licensed under the [Open Data Commons Open Databas Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use). ## Example code + ### Example returning the default 320x240 map ```c++ @@ -155,7 +157,9 @@ void loop() ``` ![map](https://github.com/user-attachments/assets/9a92bbff-e96d-444d-8b34-29801744fa80) Screenshot of a 480x800 map from a esp32-8048s050 -### PlatformIO setup + +### PlatformIO setup\ + ```bash lib_deps = https://github.com/CelliesProjects/OpenStreetMap-esp32 From d891fba02ff097367390dcbbf8c9fa2778a700f4 Mon Sep 17 00:00:00 2001 From: Cellie Date: Mon, 17 Mar 2025 19:31:11 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3fcefc3..6a34c71 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The downloaded tile cache gets large very quickly -128kB per tile- so a ESP32 wi ![map](https://github.com/user-attachments/assets/bc0534c1-b2e6-4f6e-804f-95b7db00c850) An example 320px by 240px map -## License differences between this library and the map data +### License differences between this library and the map data #### This library has a MIT license @@ -28,9 +28,9 @@ OpenStreetMap® is open data, licensed under the [Open Data Commons Open Databas Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use). -## Example code +### Example code -### Example returning the default 320x240 map +#### Example returning the default 320x240 map ```c++ #include From 86e3d961d9ce76381964cb331a08424a3a2ac01d Mon Sep 17 00:00:00 2001 From: Cellie Date: Mon, 17 Mar 2025 19:49:24 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6a34c71..6a6f81d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # OpenStreetMap-esp32 +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0961fc2320cd495a9411eb391d5791ca)](https://app.codacy.com/gh/CelliesProjects/OpenStreetMap-esp32/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) + ## What is this This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices. From 40a5670306e2cae14c08ace9b4bc18627594e594 Mon Sep 17 00:00:00 2001 From: Cellie Date: Mon, 17 Mar 2025 20:01:04 +0100 Subject: [PATCH 5/5] Update MemoryBuffer.cpp --- src/MemoryBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MemoryBuffer.cpp b/src/MemoryBuffer.cpp index d4ca536..f2ba8c9 100644 --- a/src/MemoryBuffer.cpp +++ b/src/MemoryBuffer.cpp @@ -5,7 +5,7 @@ MemoryBuffer::MemoryBuffer(size_t size) : size_(size), buffer_(nullptr) { if (size_ > 0) { - buffer_ = (uint8_t *)malloc(size_); + buffer_ = static_cast(malloc(size_)); if (buffer_ == nullptr) { log_e("Memory allocation failed!");