clarisma / geodesk-py

Fast and storage-efficient spatial database engine for OpenStreetMap data
https://docs.geodesk.com/python
GNU Lesser General Public License v3.0
36 stars 0 forks source link

`from_mercator` returns `None` #41

Closed nlehuby closed 7 months ago

nlehuby commented 7 months ago

I'm not sure to understand how the from_mercator function is to be used.

Here is my use case :

import geodesk
import shapely

# I get some streets
osm_data = geodesk.Features("city")
streets = osm_data("w[highway=residential]")

# I compute some buffers around the streets
buffered = []
for road in streets:
    buffered.append(shapely.buffer(road.shape, geodesk.to_mercator(meters=6, lat=48.8)))

# I want to export it in WGS84
[geodesk.from_mercator(elem) for elem in buffered]

the last line returns an array of None

even applied on a geodesk.Features with for instance [geodesk.from_mercator(elem.shape) for elem in streets], it returns an array of None.

What I am doing wrong ? :thinking:

clarisma commented 7 months ago

Your code is perfectly correct.

The problem: from_mercator() is documented, but we haven't actually implemented it yet. Sorry about that, I'll make it a priority item, we'll include in v0.1.6 (which should come out by Monday).