15 Commits

Author SHA1 Message Date
marceloprates
dc90176911 Updated version number 2023-02-15 17:15:59 -03:00
marceloprates
4f7122e32b Updated version number 2023-02-15 17:14:51 -03:00
marceloprates
d81e71ab24 Updated version number 2023-02-15 17:08:10 -03:00
marceloprates
f017bea2da Updated version number (v0.2-beta.3 -> v0.2) in setup.py, updated examples notebook 2023-02-15 16:53:26 -03:00
marceloprates
2eeec0c610 Updated version number (v0.2-beta.2 -> v0.2-beta.3) in setup.py, removed unnecessary dependencies, updated README.md 2023-02-15 16:48:08 -03:00
marceloprates
0b45685010 Merge branch 'main' of github.com:marceloprates/prettymaps into main 2023-02-13 17:26:45 -03:00
marceloprates
af94eed6bd Changed version number (v0.2-beta -> v0.2-beta.2) in setup.py 2023-02-13 17:26:29 -03:00
marceloprates
a40c64e25d Changed package_dir location in setup.py 2023-02-13 17:21:33 -03:00
marceloprates
54339657fb Changed version number (v0.1.9 -> v0.2-beta) 2023-02-13 16:41:29 -03:00
marceloprates
dd2fd80544 Added tabulate and descartes dependencies to requirements.txt 2023-02-13 16:33:48 -03:00
marceloprates
e3a176a0b1 Removed ipykernel dependency from requirements.txt due to dependency conflicts 2023-02-13 15:57:13 -03:00
marceloprates
c0eb528301 Changed version number (v0.1.7 -> v0.1.8), added shapely, ipykernel and pyyaml dependencies to requirements.txt, removed unused imports from draw.py and fetch.py 2023-02-13 14:39:10 -03:00
marceloprates
d024b83954 Changed version number v0.1.6 -> v.0.1.7 and downgraded osmnx to v1.1.2 in an effort to solve a dependency conflict 2023-02-13 13:43:30 -03:00
marceloprates
8679cccf9e Updated version number v0.1.5 -> v0.1.6 and removed unnecessary dependencies from requirements.txt 2023-02-13 13:32:35 -03:00
marceloprates
cdebb322ec Updated version number 2023-02-13 13:22:39 -03:00
6 changed files with 32 additions and 59 deletions

View File

@@ -1,47 +1,36 @@
# prettymaps
A minimal Python library to draw customized maps from [OpenStreetMap](https://www.openstreetmap.org/#map=12/11.0733/106.3078) created using the [osmnx](https://github.com/gboeing/osmnx), [matplotlib](https://matplotlib.org/), [shapely](https://shapely.readthedocs.io/en/stable/index.html) and [vsketch](https://github.com/abey79/vsketch) packages.
A Python package to draw maps with customizable styles from [OpenStreetMap](https://www.openstreetmap.org/#map=12/11.0733/106.3078) data. Created using the [osmnx](https://github.com/gboeing/osmnx), [matplotlib](https://matplotlib.org/), [shapely](https://shapely.readthedocs.io/en/stable/index.html) and [vsketch](https://github.com/abey79/vsketch) packages.
> **This work is [licensed](LICENSE) under a GNU Affero General Public License v3.0 (you can make commercial use, distribute and modify this project, but must **disclose** the source code with the license and copyright notice)**
<a href='https://ko-fi.com/marceloprates_' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
# Installation
### Install using with [pip](https://pypi.org):
```
pip install prettymaps
```
# [Google Colab Demo](https://colab.research.google.com/github/marceloprates/prettymaps/blob/master/notebooks/examples.ipynb)
![](https://github.com/marceloprates/prettymaps/raw/main/prints/heerhugowaard.png)
This work is [licensed](LICENSE) under a GNU Affero General Public License v3.0 (you can make commercial use, distribute and modify this project, but must **disclose** the source code with the license and copyright notice)
## Note about crediting and NFTs:
# Note about crediting and NFTs:
- Please keep the printed message on the figures crediting my repository and OpenStreetMap ([mandatory by their license](https://www.openstreetmap.org/copyright)).
- I am personally **against** NFTs for their [environmental impact](https://earth.org/nfts-environmental-impact/), the fact that they're a [giant money-laundering pyramid scheme](https://twitter.com/smdiehl/status/1445795667826208770) and the structural incentives they create for [theft](https://twitter.com/NFTtheft) in the open source and generative art communities.
- **I do not authorize in any way this project to be used for selling NFTs**, although I cannot legally enforce it. **Respect the creator**.
- The [AeternaCivitas](https://magiceden.io/marketplace/aeterna_civitas) and [geoartnft](https://www.geo-nft.com/) projects have used this work to sell NFTs and refused to credit it. See how they reacted after being exposed: [AeternaCivitas](etc/NFT_theft_AeternaCivitas.jpg), [geoartnft](etc/NFT_theft_geoart.jpg).
- **I have closed my other generative art projects on Github and won't be sharing new ones as open source to protect me from the NFT community**.
<a href='https://ko-fi.com/marceloprates_' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
## As seen on [Hacker News](https://web.archive.org/web/20210825160918/https://news.ycombinator.com/news):
# As seen on [Hacker News](https://web.archive.org/web/20210825160918/https://news.ycombinator.com/news):
![](https://github.com/marceloprates/prettymaps/raw/main/prints/hackernews-prettymaps.png)
## [prettymaps subreddit](https://www.reddit.com/r/prettymaps_/)
## [Google Colaboratory Demo](https://colab.research.google.com/github/marceloprates/prettymaps/blob/master/notebooks/examples.ipynb)
# [prettymaps subreddit](https://www.reddit.com/r/prettymaps_/)
# Installation
OBS. I'm trying to solve a dependency issue with [vsketch](https://vsketch.readthedocs.io/en/latest/install.html) before publishing prettymaps v0.1.3, so, for now, please install directly from GitHub.
### Install locally:
Install prettymaps with:
```
pip install git+https://github.com/marceloprates/prettymaps
```
### Install on Google Colaboratory:
Install prettymaps with:
```
!pip install -e "git+https://github.com/marceloprates/prettymaps#egg=prettymaps"
```
Then **restart the runtime** (Runtime -> Restart Runtime) before importing prettymaps
# Tutorial

View File

@@ -6,12 +6,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Instructions for Google Colab:\n",
"# 1. Uncomment the following line\n",
"# 2. Run it\n",
"# 3. Restart runtime (Runtime -> Restart runtime)\n",
"# 4. Comment it again\n",
"#!pip install -e \"git+https://github.com/marceloprates/prettymaps#egg=prettymaps\""
"# Install prettymaps using pip:\n",
"!pip install prettymaps"
]
},
{
@@ -1577,7 +1573,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]"
},
"orig_nbformat": 4,
"vscode": {

View File

@@ -20,7 +20,7 @@ import re
import os
import json
import yaml
import IPython
#import IPython
import pathlib
import warnings
import matplotlib
@@ -37,8 +37,8 @@ from matplotlib import pyplot as plt
from matplotlib.colors import hex2color
from matplotlib.patches import Path, PathPatch
from typing import Optional, Union, Tuple, List, Dict, Any, Iterable
from shapely.geometry import Point, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, box
from shapely.geometry.base import BaseGeometry
from shapely.geometry import Point, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, box
#import vsketch
@@ -78,6 +78,7 @@ class Preset:
"""
params: dict
'''
def _ipython_display_(self):
"""
Implements the _ipython_display_() function for the Preset class.
@@ -104,7 +105,7 @@ class Preset:
params.iloc[1:, 2:] = ''
IPython.display.display(IPython.display.Markdown(params.to_markdown()))
'''
def transform_gdfs(
gdfs: Dict[str, gp.GeoDataFrame],

View File

@@ -16,19 +16,11 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from ast import Dict
from functools import reduce
from tokenize import Number, String
from typing import Optional, Union, Tuple
# from unittest.runner import _ResultClassType
from xmlrpc.client import Boolean
import re
import osmnx as ox
from osmnx import utils_geo
from osmnx._errors import EmptyOverpassResponse
import warnings
import numpy as np
import osmnx as ox
from copy import deepcopy
from shapely.geometry import (
box,
Point,
@@ -37,12 +29,10 @@ from shapely.geometry import (
LineString,
MultiLineString,
)
from geopandas import GeoDataFrame
from shapely.affinity import rotate
from shapely.ops import unary_union
from geopandas import GeoDataFrame, read_file
import warnings
from shapely.errors import ShapelyDeprecationWarning
from copy import deepcopy
# Parse query (by coordinates, OSMId or name)

View File

@@ -1,6 +1,3 @@
osmnx==1.2.2
tabulate==0.8.9
Shapely>=1.8,<2.0
descartes==1.1.0
ipykernel==5.3.4
pyyaml==6.0.0
pyyaml==6.0.0

View File

@@ -7,7 +7,7 @@ presets_dir = os.path.abspath(os.path.join(os.path.pardir, 'presets'))
setup(
name="prettymaps",
version="v0.1.4",
version="v1.0.0",
description="A simple python library to draw pretty maps from OpenStreetMap data",
long_description=parent_dir.joinpath("README.md").read_text(),
long_description_content_type="text/markdown",
@@ -22,6 +22,6 @@ setup(
classifiers=[
"Intended Audience :: Science/Research",
],
package_dir={'prettymaps': '.'},
package_dir={'prettymaps': 'prettymaps'},
package_data={'prettymaps': ['presets/*.json']},
)