Commit Graph
46 Commits
Author SHA1 Message Date
Kelsey Jordahl e45bc1d098 TST: Clean up the rebase and use assertRaises context manager in test 2013-11-18 22:34:33 -06:00
Carson Farmer a19e12ce99 fix typo in test name 2013-11-18 22:31:20 -06:00
Carson Farmer a99b759ba4 fix typo in test name 2013-11-18 22:31:20 -06:00
Carson Farmer bb4b7f68db BUG: Check that set_geometry will set valid geometry column 2013-11-18 22:31:20 -06:00
Jeff Tratner f33d8859a7 TST: Add a few test cases for changing geometries 2013-11-14 06:52:32 -05:00
Kelsey Jordahl b1ced78b16 BUG: Put back crs arguments that my merge had overwritten 2013-11-12 23:09:58 -05:00
Kelsey Jordahl 159d69e1e0 TST: Explicitly use relative imports and clean up tests 2013-11-12 22:58:31 -05:00
Kelsey Jordahl 249380ee69 TST: Clean up tests with assertRaises context manager. 2013-11-12 22:56:17 -05:00
Kelsey Jordahl 17d933c04a TST: Attempt to import unittest2 if running python 2.6 2013-11-12 22:56:17 -05:00
Jacob Wasserman b557e44c3c Fix tests to include crs when comparing GeoSeries 2013-11-11 19:21:13 -05:00
Jeff Tratner ec15621c1e CLN: crs set order: passed in, passed Series, DataFrame. 2013-11-06 20:18:10 -05:00
Jeff Tratner 9a35c2e5c6 ENH: Add set_dataframe method to DataFrame 2013-11-05 22:55:25 -05:00
Jeff Tratner c51add2456 Allow setting of crs in set_geometry 2013-11-05 22:37:11 -05:00
Jeff Tratner 799f6a2eb7 Only define name 'geometry' in one place 2013-11-05 22:34:41 -05:00
Jeff Tratner 6eb617b9dd Changeup tests to reflect drop=False default 2013-11-05 22:28:03 -05:00
Jeff Tratner b014e4f0ff ENH: Allow more flexibility with geometries 2013-11-05 22:11:24 -05:00
Jeff Tratner 4b4d93f9a5 TST: Fix setattr issue with geometry property and more edge case tests 2013-11-05 07:08:39 -05:00
Jeff Tratner 69aa0364e0 Add assert_geoseries_equal test util 2013-11-04 00:31:36 -05:00
Jeff Tratner 7df6db234f ENH: Allow geometry property to be set.
* Allows for clearer errors when a GeoDataFrame is created but has no
  geometry.
* TST: Add test util for comparing sequence (b/c assert_almost_equal seems
  to not work with shapely.
2013-11-04 00:31:12 -05:00
Jacob Wasserman 0e671667b0 ENH: Introduce method to handle NaNs in to_json()
This adds an 'na' option specifying how NaN values should be handled in
GeoDataFrame's to_json(). The default is 'null' which outputs JSON null.
The other options are 'drop' which removes any missing property, and 'keep'
which will output them as NaN.
2013-11-01 12:58:47 -04:00
Jacob Wasserman 72153f4c3b Add omitna option to GeoDataFrame.to_json
When omitna is true, any properties that are NaN will not be written out.
This means that different features can have different numbers of properties,
which is okay for GeoJSON. Writing out NaN values is not valid JSON and causes
problems for some parsers.
2013-11-01 02:29:18 -04:00
Jacob Wasserman 43616470e7 ENH: Add geometry property to GeoDataFrame
Adds a geometry property and set_geometry() method to GeoDataFrame. This was
suggested in Issue #45. The implementation mimics that of DataFrame's
set_index in that it returns a copy of the GeoDataFrame by default with the
new geometry. You can specify a column or give a list/ndarray of geometries.
2013-10-30 02:17:27 -04:00
Jacob Wasserman 4df3679546 Add tests for io functions.
Adds tests for the read_postgis methods. A tests/util.py is introduced
containing some of the common code for downloading the NYC boroughs file,
managing the existence of psycopg2, and connecting to a database.
2013-10-12 12:14:59 -04:00
Jacob Wasserman c404f83d14 Rename read_postgis() to from_postgis() 2013-10-08 20:38:21 -04:00
Jacob Wasserman 97947b8957 Add documentation to explain database creation 2013-10-08 20:35:40 -04:00
Jacob Wasserman 11b46b15bc Open database connection within a context manager 2013-10-08 20:35:27 -04:00
Jacob Wasserman 82232ac07b Create the NYC borough database in setUp()
Also removes the nybb table creation in the travis script
2013-10-05 18:55:34 -04:00
Jacob Wasserman bae2914136 Skip database tests if psycopg2 or db missing
Check if psycopg2 is installed. In setUp() check to see if we can connect
to the test_geopandas database. Skip the read_postgis tests if either
fails.
2013-10-05 16:34:07 -04:00
Jacob Wasserman 0a7508f111 Add testing for read_postgis function
It also installs postgis and creates a simple database filled with the borough
data. A new requirements.test.txt file is created so that not everybody
installing geopandas is required to install the packages for testing, psycopg2
in this case.
2013-10-05 02:39:33 -04:00
Kelsey Jordahl 266a70a610 TST: Test for transforming GeoDataFrame 2013-09-29 22:31:51 -05:00
Kelsey Jordahl e92ce6d183 BUG: Fix copy method for GeoSeries and GeoDataFrame 2013-09-29 22:06:43 -05:00
Kelsey Jordahl 268fd2a974 TST: Check that we are prevented from writing mixed types to file 2013-09-29 21:27:18 -05:00
Kelsey Jordahl 7fd9d756ac CLN: Remove useless test 2013-09-27 13:45:40 +02:00
Kelsey Jordahl c770a5cc42 Merge pull request #24 from kjordahl/bug/df-init-crs
BUG: crs was ignored in creation of GeoDataFrame
2013-08-22 20:44:44 -07:00
Jake Wasserman f544fd846f Add type tests for slicing/fancy indexing.
Add one check to output type of fancy index test
2013-08-22 22:57:27 -04:00
Kelsey Jordahl 019029c60f TST: Add test for GeoDataFrame.__init__() 2013-08-22 22:36:46 -04:00
Jake Wasserman 2d4128ad6f Return proper type for GeoDataFrame.__getitem__
Introduce type testing for GeoDataFrame.
Add tests for boolean index.

GeoDataFrame.__getitem__(key) returns the Geo* equivalent class when a
'geometry' column is present.

The following are True when df is a GeoDataFrame:
type(df['geometry']) is GeoSeries
type(df['column']) is Series
type(df[['column1', 'column2', 'geometry']]) is GeoDataFrame
type(df[['column1', 'column2']]) is DataFrame
2013-08-22 20:20:03 -04:00
Kelsey Jordahl de3bbb6924 TST: Fetch test NYC file if it doesn't exist 2013-08-20 00:06:08 -04:00
Kelsey Jordahl 0856a8e9e2 Re-use array of borough names 2013-08-07 18:52:08 -04:00
Kelsey Jordahl 3875baec21 Use temp directory for test_to_file 2013-08-07 18:50:11 -04:00
Carson Farmer 1a376d64de add initial support for writing to geospatial data formats via fiona 2013-07-21 16:36:38 -04:00
Kelsey Jordahl 4733055d8e Add test for values of text columns in GeoDataFrame from file 2013-07-15 11:45:18 +05:30
Kelsey Jordahl 36332c5caa Actually use unittest assert methods 2013-07-15 11:40:46 +05:30
Kelsey Jordahl e1f0d9a5af GeoDataFrame test to unittest framework 2013-07-15 11:28:59 +05:30
sgillies fd18fe30a1 to_json returns a GeoJSON representation of a GeoDataFrame. 2013-07-08 17:35:41 -06:00
sgillies 7782f6a00f Add kwargs to from_file that turn on extra fiona features.
Also try to import setup from setuptools to get the 'develop'
feature.
2013-07-07 22:00:22 -06:00