Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatial Autocorrelation measures #13

Open
ozak opened this issue Dec 22, 2016 · 16 comments
Open

Spatial Autocorrelation measures #13

ozak opened this issue Dec 22, 2016 · 16 comments

Comments

@ozak
Copy link
Owner

ozak commented Dec 22, 2016

Generalize #11 and address pysal/pysal/issues/895

@ozak ozak changed the title Spatial Autocorrelation meausures Spatial Autocorrelation measures Dec 22, 2016
@ozak
Copy link
Owner Author

ozak commented Dec 22, 2016

d6b1169 adds Global spatial autocorrelation measures to GeoRasters

@ozak
Copy link
Owner Author

ozak commented Dec 26, 2016

e76a24e Added local spatial autocorrelation measures. Output is similar to Pysal, but is saved in a GeoRaster, so that the geographical information of the original data is preserved and output is aligned to underlying data.

@ozak
Copy link
Owner Author

ozak commented Dec 26, 2016

@sjsrey I have uploaded a script that shows the use of the Spatial autocorrelation measures spatial_script.py

In order to test the functionality and ensure it is correct it would be good to use a known data set with results (in order to compare). Do you have one in mind?

@sjsrey
Copy link

sjsrey commented Dec 27, 2016

I''ve hit another bug trying to install on a different linux machine. In a new conda environment the instructions for pip install georasters will generate many errors (gdal problems mostly). I tried to get around them with first installing gdal via:

conda install gdal

and then the pip install georasters works.

However when trying to import georasters I then get the following error:

In [1]: import georasters as gr
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-9d3425e47620> in <module>()
----> 1 import georasters as gr

/home/serge/anaconda2/envs/georasters/lib/python2.7/site-packages/georasters/__init__.py in <module>()
      1 # This file allows all subdirectories in this directory to be loaded by Python
      2 # -*- coding: utf-8 -*-
----> 3 from .georasters import get_geo_info, map_pixel, map_pixel_inv, aggregate, create_geotiff, align_rasters, \
      4                         load_tiff, union, GeoRaster, RasterGeoError, RasterGeoTError, RasterGeoTWarning, merge, \
      5                         from_file, to_pandas, to_geopandas, from_pandas, raster_weights, map_vector

/home/serge/anaconda2/envs/georasters/lib/python2.7/site-packages/georasters/georasters.py in <module>()
     36 import matplotlib.pyplot as plt
     37 import pandas as pd
---> 38 from fiona.crs import from_string
     39 import geopandas as gp
     40 from shapely.geometry import Polygon, LineString

ImportError: No module named fiona.crs

@ozak
Copy link
Owner Author

ozak commented Dec 27, 2016

That is strange, since it is able to install on Travis, which is Linux and uses conda. What version of fiona do you have? I just installed on a clean install of OS X 10.12 with fiona-1.5.1 and on my machine I have fiona-1.7.0.post2.

@ozak
Copy link
Owner Author

ozak commented Dec 27, 2016

The GDAL issues may be due to conda having an issue with GDAL 2 vs GDAL 1. I've seen conda complain in other packages I used or installed. See,s parts of the conda packages are compiled against v1 and others against v2, and conda does not force it to be the same underlying library. I had to force conda to use GDAL 1, although georasters does not really care about which version is installed (unless they removed functions or changed the way to call them).

@sjsrey
Copy link

sjsrey commented Dec 27, 2016

Can you update the install instructions to show how you are explicitly forcing to use GDAL 1?

@ozak
Copy link
Owner Author

ozak commented Dec 27, 2016

I use a YAML file to pass instruction to conda. I just used the condition gdal<2. I guess one could use conda install gdal<2?

@sjsrey
Copy link

sjsrey commented Dec 27, 2016 via email

@ozak
Copy link
Owner Author

ozak commented Dec 27, 2016

I will add it...I never thought people would have problem, since I did not have issues with Travis. Let me try to use the Travis.yml file to see if that would work better, since I have too many packages installed.

@sjsrey
Copy link

sjsrey commented Dec 28, 2016

Cool. This can help as we use local yml files to get users setup for workshops on PySAL so maybe the same thing could be used for devs on georasters?

Here is an example

@ozak
Copy link
Owner Author

ozak commented Dec 28, 2016

I will try to provide an example later tonight. I was trying to upgrade my OS, so not everything is working at the moment.

@ozak
Copy link
Owner Author

ozak commented Dec 28, 2016

Ok..looks like I was finally able to get it in a conda env try_georasters2.yml. It seems the move to GDAL 2 has cause d major breaks and not all channels are compatible nor do they have GDAL+OGR+GeoPandas+Fiona (+libs) compatible.

It seems conda does not install all the requirements (nor the requirements of the requirements. Is there a way to force it?

Let me know if it works for you too. And thanks for taking the time!

@ozak
Copy link
Owner Author

ozak commented Dec 28, 2016

one more script in case you rather try python-3.5 try_georasters3.yml

@ozak
Copy link
Owner Author

ozak commented Dec 29, 2016

I have uploaded it to anaconda.org so perhaps now it will be easier to install.

@ozak
Copy link
Owner Author

ozak commented Jan 3, 2019

PySal functions have been added. Need tests and update to new API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants