Skip to content

Commit

Permalink
Merge 9bd4f59 into 761b5c6
Browse files Browse the repository at this point in the history
  • Loading branch information
kjordahl committed Jul 6, 2014
2 parents 761b5c6 + 9bd4f59 commit 2ddc7d2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 22 deletions.
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ python:
- 2.7
- 3.2
- 3.3
- 3.4

env:
- PANDAS_VERSION=v0.12.0
- PANDAS_VERSION=v0.13.1
- PANDAS_VERSION=v0.14.0
- PANDAS_VERSION=master

matrix:
exclude:
- python: 2.6
env: PANDAS_VERSION=v0.14.0

before_install:
- sudo add-apt-repository -y ppa:ubuntugis/ppa
- sudo apt-get update
- sudo apt-get install gdal-bin libgdal-dev postgis
- sudo -u postgres psql -c "drop database if exists test_geopandas"
- sudo -u postgres psql -c "create database test_geopandas"
- sudo -u postgres psql -c "create extension postgis" -d test_geopandas
- sudo apt-get install gdal-bin libgdal-dev
# - sudo -u postgres psql -c "drop database if exists test_geopandas"
# - sudo -u postgres psql -c "create database test_geopandas"
# - sudo -u postgres psql -c "create extension postgis" -d test_geopandas

install:
- pip install -r requirements.txt --use-mirrors
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ GeoPandas objects also know how to plot themselves. GeoPandas uses [descartes](

>>> g.plot()

GeoPandas also implements alternate constructors that can read any data format recognized by [fiona](http://toblerity.github.io/fiona). To read a [file containing the boroughs of New York City](http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip):
GeoPandas also implements alternate constructors that can read any data format recognized by [fiona](http://toblerity.github.io/fiona). To read a [file containing the boroughs of New York City](http://www.nyc.gov/html/dcp/download/bytes/nybb_14aav.zip):

>>> boros = GeoDataFrame.from_file('nybb.shp')
>>> boros.set_index('BoroCode', inplace=True)
Expand Down
2 changes: 1 addition & 1 deletion doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Dependencies
Supports Python versions 2.6, 2.7, and 3.2+.

- `numpy`_
- `pandas`_
- `pandas`_ (version 0.13 or later)
- `shapely`_
- `fiona`_
- `six`_
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ borough that are in the holes:
.. _matplotlib: http://matplotlib.org
.. _fiona: http://toblerity.github.io/fiona
.. _geopy: https://github.com/geopy/geopy
.. _file containing the boroughs of New York City: http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip
.. _file containing the boroughs of New York City: http://www.nyc.gov/html/dcp/download/bytes/nybb_14aav.zip

.. toctree::
:maxdepth: 2
Expand Down
4 changes: 2 additions & 2 deletions examples/nyc_boros.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
TODO: autogenerate these from docs themselves
Kelsey Jordahl
Time-stamp: <Sun Jul 7 17:31:12 IST 2013>
Time-stamp: <Tue May 6 12:17:29 EDT 2014>
"""
import numpy as np
import matplotlib.pyplot as plt
Expand All @@ -14,7 +14,7 @@
np.random.seed(1)
DPI = 100

# http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip
# http://www.nyc.gov/html/dcp/download/bytes/nybb_14aav.zip
boros = GeoDataFrame.from_file('nybb.shp')
boros.set_index('BoroCode', inplace=True)
boros.sort()
Expand Down
7 changes: 3 additions & 4 deletions tests/test_geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ def setUp(self):

nybb_filename = download_nybb()

self.df = read_file('/nybb_13a/nybb.shp', vfs='zip://' + nybb_filename)
self.df = read_file('/nybb_14a_av/nybb.shp', vfs='zip://' + nybb_filename)
self.tempdir = tempfile.mkdtemp()
self.boros = np.array(['Staten Island', 'Queens', 'Brooklyn',
'Manhattan', 'Bronx'])
self.boros = self.df['BoroName']
self.crs = {'init': 'epsg:4326'}
self.df2 = GeoDataFrame([
{'geometry' : Point(x, y), 'value1': x + y, 'value2': x * y}
Expand Down Expand Up @@ -334,7 +333,7 @@ def test_transform(self):

def test_from_features(self):
nybb_filename = download_nybb()
with fiona.open('/nybb_13a/nybb.shp',
with fiona.open('/nybb_14a_av/nybb.shp',
vfs='zip://' + nybb_filename) as f:
features = list(f)
crs = f.crs
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class TestIO(unittest.TestCase):
def setUp(self):
nybb_filename = tests.util.download_nybb()
path = '/nybb_13a/nybb.shp'
path = '/nybb_14a_av/nybb.shp'
vfs = 'zip://' + nybb_filename
self.df = read_file(path, vfs=vfs)
with fiona.open(path, vfs=vfs) as f:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import tempfile
import unittest

import matplotlib
matplotlib.use('Agg', warn=False)
from matplotlib.pyplot import Artist, savefig, clf
from matplotlib.testing.noseclasses import ImageComparisonFailure
from matplotlib.testing.compare import compare_images
Expand All @@ -13,6 +15,7 @@

from geopandas import GeoSeries


# If set to True, generate images rather than perform tests (all tests will pass!)
GENERATE_BASELINE = False

Expand Down
15 changes: 8 additions & 7 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ class OperationalError(Exception):

def download_nybb():
""" Returns the path to the NYC boroughs file. Downloads if necessary. """
# Data from http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip
# saved as geopandas/examples/nybb_13a.zip.
filename = os.path.join('examples', 'nybb_13a.zip')
if not os.path.exists(filename):
with io.open(filename, 'wb') as f:
response = urlopen('http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip')
# Data from http://www.nyc.gov/html/dcp/download/bytes/nybb_14aav.zip
# saved as geopandas/examples/nybb_14aav.zip.
filename = 'nybb_14aav.zip'
full_path_name = os.path.join('examples', filename)
if not os.path.exists(full_path_name):
with io.open(full_path_name, 'wb') as f:
response = urlopen('http://www.nyc.gov/html/dcp/download/bytes/{0}'.format(filename))
f.write(response.read())
return filename
return full_path_name


def validate_boro_df(test, df):
Expand Down

0 comments on commit 2ddc7d2

Please sign in to comment.