Comments (6)
There is no packaged release of MovingPandas yet, so it cannot be installed in the same sense as a proper Python page.
trajectory.py does not contain import movingpandas as mp
. Do you mean one of the ipynb notebooks? (They do contain this line.)
The easiest way to use MovingPandas right now is through the MyBinder notebook at: https://mybinder.org/v2/gh/anitagraser/movingpandas/master
Alternatively, I recommend installing Anaconda. Then you can use the environment.yml config file to tell conda how to configure a Python environment that is compatible with MovingPandas. This way you can run the included ipynb notebooks locally on your machine or start using MovingPandas in your own projects.
from movingpandas.
Hi! Thanks for the reply. If i opt to go with the creation of an environment through anaconda, what exactly do I need to do?
I have the following steps in mind:
1.) Install anaconda,
2.) copy the environments.yml file to the env directory of conda
3.) Then execute the following code in my terminal
conda env create -f environment.yml
But, do I still need to add anything to the environment.yml file downloaded from github? What other steps am I missing?
I want to create a similar plot you have in the mybinder notebook at Out[21] but with my own point data.
from movingpandas.
The following steps should do it:
- Install Anaconda
- Clone the movingpandas repository
- In Anaconda Navigator | Environments | Import select the movingpandas environment.yml from the cloned directory:
- Wait until the environment is ready, then change to the Home tab and install Jupyter notebooks into the movingpandas environment
- Launch Jupyter notebooks and navigate to the cloned directory to execute them
- Now you can adjust the code to use your own data
from movingpandas.
Hi,
Thanks for the tips.
I did everything from 1 to 6, but whenever I try to execute the import statements in the notebook, I get this error. I tried reading it but cannot seem to understand why it occurs
I ran these codes first in the notebook:
import urllib import os import pandas as pd import movingpandas as mp import contextily as ctx from geopandas import GeoDataFrame, read_file from shapely.geometry import Point, LineString, Polygon from datetime import datetime, timedelta
Then this is the error message:
`---------------------------------------------------------------------------
OSError Traceback (most recent call last)
in
2 import os
3 import pandas as pd
----> 4 import movingpandas as mp
5 import contextily as ctx
6 from geopandas import GeoDataFrame, read_file
~/Downloads/movingpandas-master/movingpandas/init.py in
3 """
4
----> 5 from .trajectory import *
6
7 version = '0.99.0.dev'
~/Downloads/movingpandas-master/movingpandas/trajectory.py in
4 import sys
5
----> 6 import contextily as ctx
7
8 from shapely.affinity import translate
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/init.py in
4
5 from . import tile_providers as sources
----> 6 from .place import Place, plot_map
7 from .tile import *
8 from .plotting import add_basemap, add_attribution
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/place.py in
4 import matplotlib.pyplot as plt
5 from warnings import warn
----> 6 from .tile import howmany, bounds2raster, bounds2img, _sm2ll, _calculate_zoom
7 from .plotting import ATTRIBUTION, INTERPOLATION, ZOOM, add_attribution
8
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/tile.py in
10 import rasterio as rio
11 from PIL import Image
---> 12 from cartopy.io.img_tiles import _merge_tiles as merge_tiles
13 from rasterio.transform import from_origin
14 from . import tile_providers as sources
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/cartopy/init.py in
105 # Commonly used sub-modules. Imported here to provide end-user
106 # convenience.
--> 107 import cartopy.crs
108 import cartopy.feature # noqa: F401 (flake8 = unused import)
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/cartopy/crs.py in
30
31 import numpy as np
---> 32 import shapely.geometry as sgeom
33 from shapely.prepared import prep
34 import six
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geometry/init.py in
2 """
3
----> 4 from .base import CAP_STYLE, JOIN_STYLE
5 from .geo import box, shape, asShape, mapping
6 from .point import Point, asPoint
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geometry/base.py in
15
16 from shapely.affinity import affine_transform
---> 17 from shapely.coords import CoordinateSequence
18 from shapely.errors import WKBReadingError, WKTReadingError
19 from shapely.ftools import wraps
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/coords.py in
6 from ctypes import byref, c_double, c_uint
7
----> 8 from shapely.geos import lgeos
9 from shapely.topology import Validating
10
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geos.py in
111 _lgeos = load_dll('geos_c', fallbacks=alt_paths)
112
--> 113 free = load_dll('c').free
114 free.argtypes = [c_void_p]
115 free.restype = None
~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geos.py in load_dll(libname, fallbacks, mode)
54 raise OSError(
55 "Could not find lib {0} or load any of its variants {1}.".format(
---> 56 libname, fallbacks or []))
57
58 _lgeos = None
OSError: Could not find lib c or load any of its variants [].`
I am not sure what is happening. I have done all the steps including the install Jupyter from the Home tab to my movingpandas environment. Any ideas on what could be happening?
from movingpandas.
from movingpandas.
Hi. Im using a OSX
It seems that it's a problem I also have with shapely. I've been trying to fix it but cannot seem to find a solution.
This is the link of what I experience with shapely also. I have installed all depndencies from conda-forge as to not have it mixing up with defaults. But it still has problems with regard to geos and its libs as seen here
from movingpandas.
Related Issues (20)
- Improve docstring formatting
- Interpolate elevation HOT 2
- Interpolate direction HOT 4
- Add explore function (like in GeoPandas) HOT 4
- Reporting progress of get_significant_points_gdf HOT 5
- Add clipping with a list of polygons
- Avoid timestamps in trajectory IDs
- Make TrajectoryCollection indexable HOT 1
- Add geometry method to Trajectory HOT 1
- Add TrajectoryCollection.get_trajectories(object_id): TrajectoryCollection method HOT 1
- Add objectID weights to Aggregator flows output
- Add functionality to split trajectory based on change in angle/heading HOT 6
- Add common part of commuters (CPC) feature HOT 1
- Add summary data to TrajectoryCollection HOT 4
- TrajectoryCollection.clip doesn't consider min_length correctly
- len(Trajectory) fails with TypeError: 'float' object cannot be interpreted as an integer
- python setup.py develop fails with UnicodeDecodeError
- Add missing TrajectoryCollection.intersection() function
- Parallelize TrajectoryCollection operations
- allow method chaining HOT 1
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 movingpandas.