Comments (4)
@lucky-verma its been awhile since we have taken a look at this issue, I tried recently to replicate the issue and I dont think I can replicate using the example given or at least in this version of testing it I get a result without error:
env info:
Windows 10 Pro
Python 3.6.11
pandana=0.6.1
geopandas=0.9.0
pandas=1.1.0
osmnet=0.1.6
reproducible example:
import matplotlib.pyplot as plt
import pandana
import pandas as pd, geopandas as gpd
# use osmnet directly instead of from pandana
from osmnet import load
bbox = [12.8881, 77.5079, 12.9918, 77.6562]
# distance was not originally provided so I picked 1000 m
distance=1000
df = pd.DataFrame(
{'id':[1522786113, 2227865111, 309601717, 1513928857, 2220792136, 6455354942],
'Name': ['Neil', 'Nitin', 'Mukesh','Alpha','Beta','Office'],
'Area': ['Valsad', 'Silvasa', 'Daman','Rajkot','Dui','Vapi'],
'lat': [12.956550, 12.950360, 12.912047,12.955546,12.939653,12.928109],
'lon': [77.540640, 77.581135, 77.586969,77.529658,77.542523,77.639337]})
pois = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df.lon, df.lat))
network = load.network_from_bbox(bbox[0], bbox[1], bbox[2], bbox[3],network_type='drive')
network=pandana.Network(network[0]["x"],network[0]["y"], network[1]["from"], network[1]["to"],network[1][["distance"]])
network.precompute(distance + 1)
network.set_pois(category='my_amenity', x_col=pois['lon'], y_col=pois['lat'], maxdist=distance, maxitems=7)
access = network.nearest_pois(distance=distance, category='my_amenity', num_pois=7)
bbox_aspect_ratio = (bbox[2] - bbox[0]) / (bbox[3] - bbox[1])
fig_kwargs = {'facecolor':'w',
'figsize':(15, 15 * bbox_aspect_ratio)}
# keyword arguments to pass for scatter plots
plot_kwargs = {'s':5,
'alpha':0.9,
'cmap':'viridis_r',
'edgecolor':'none'}
n = 1
bmap, fig, ax = network.plot(access[n], bbox=bbox, plot_kwargs=plot_kwargs, fig_kwargs=fig_kwargs)
ax.set_facecolor('k')
ax.set_title('Walking distance (m) to nearest boi around Bangalore-India', fontsize=15)
fig.savefig('images/accessibility.png', dpi=200, bbox_inches='tight')
plt.show()
Ill close this for now, but if the issue persists when you update your packages, please let us know and can reopen.
from osmnet.
I get the same error for different cities in Central Europe like Berlin, Cologne and Amsterdam. Other queries in Lisbon and Dublin work.
I think the difficulties are with pyProj , I get a future warning:
c:\users\sven.conda\envs\thesisox\lib\site-packages\pyproj\crs\crs.py:53: FutureWarning: '+init=:
' syntax is deprecated. "Authority: code is the preferred initialization method. When making the change, be mindful of axis order changes:
return _prepare_from_string(" ".join(pjargs))
There a change of the axis order is mentioned, which I also recognize in my code.
network = osm.network_from_bbox(lat_min=bbox[0], lng_min=bbox[1], lat_max=bbox[2], lng_max=bbox[3])
print(network[0]["x"], network[0]["y"])
- id
- 21518835 7.617888
- 21518840 7.619910
- 21518841 7.619844
- 21518843 7.622686
- 21518845 7.623884
-
...
- 7622832878 7.624866
- 7622832880 7.624928
- 7623060866 7.629284
- 7623060875 7.631151
- 7645051167 7.611426
- Name: x, Length: 4722, dtype: float64 id
- 21518835 51.951031
- 21518840 51.954686
- 21518841 51.954977
- 21518843 51.955540
- 21518845 51.955627
-
...
- 7622832878 51.964202
- 7622832880 51.964346
- 7623060866 51.963732
- 7623060875 51.965294
- 7645051167 51.968587
- Name: y, Length: 4722, dtype: float64
The expected format is x = 51.951031 y = 7.617888
For this reason the data probably cannot be visualized.
However, I haven't found a solution yet, and would be very grateful for some ideas.
from osmnet.
Hi @jamesjoyce92 , I have compared the format for working and not working region, they both are similar.
I hope someone helps!
from osmnet.
Hey @thinkersloo,
yeah, you're right. I was a bit hastily, I've checked it for some working bboxes and get the same order, too.
from osmnet.
Related Issues (10)
- Node Query Client Error HOT 1
- Including OSMNet in other packages' requirements - now fixed HOT 1
- version and conda-forge release updates HOT 1
- Geopandas 0.7 uses new object type for CRS HOT 8
- Misc DeprecationWarning and FutureWarnings HOT 1
- Consider tagging a new release? HOT 2
- Network from bbox func should support either explicit lat/lons or bbox tuple - not both HOT 1
- Tags-to-keep from Overpass API might need to be updated HOT 1
- Suggested feature: custom OSM filters HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmnet.