Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Plio
Commits
e4a9bf61
Commit
e4a9bf61
authored
7 years ago
by
jay
Browse files
Options
Downloads
Patches
Plain Diff
Removes the libpysal dependency that appears to be pinned to scipy0.11
parent
92183a40
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.travis.yml
+1
-2
1 addition, 2 deletions
.travis.yml
appveyor.yml
+2
-3
2 additions, 3 deletions
appveyor.yml
plio/geofuncs/geofuncs.py
+28
-0
28 additions, 0 deletions
plio/geofuncs/geofuncs.py
plio/io/io_gdal.py
+1
-3
1 addition, 3 deletions
plio/io/io_gdal.py
with
32 additions
and
8 deletions
.travis.yml
+
1
−
2
View file @
e4a9bf61
...
...
@@ -45,9 +45,8 @@ install:
-
conda config --add channels jlaura
-
conda install python=$PYTHON_VERSION
-
conda install -c conda-forge gdal h5py
-
conda install pandas sqlalchemy pyyaml networkx
-
conda install pandas sqlalchemy pyyaml networkx
affine
-
conda install -c jlaura pvl protobuf
-
pip install affine libpysal
# Development installation
-
conda install nose coverage sh anaconda-client
...
...
This diff is collapsed.
Click to expand it.
appveyor.yml
+
2
−
3
View file @
e4a9bf61
...
...
@@ -40,7 +40,7 @@ install:
-
cmd
:
set PYTHONUNBUFFERED=1
-
cmd
:
conda config --set show_channel_urls
true
-
cmd
:
conda install --yes python=3.5
-
cmd
:
conda install --yes python=3.5
-
cmd
:
conda install -c pelson/channel/development --yes --quiet obvious-ci
-
cmd
:
conda config --add channels conda-forge
-
cmd
:
conda info
...
...
@@ -56,10 +56,9 @@ install:
-
cmd
:
conda install --yes -c conda-forge gdal h5py
-
cmd
:
conda install --yes pandas sqlalchemy pyyaml networkx affine
-
cmd
:
conda install --yes -c jlaura protobuf pvl
-
cmd
:
pip install libpysal
# Development installation
-
cmd
:
conda install --yes nose coverage
-
cmd
:
conda install --yes nose coverage
pytest
-
cmd
:
pip install coveralls
# Skip .NET project specific build phase.
...
...
This diff is collapsed.
Click to expand it.
plio/geofuncs/geofuncs.py
+
28
−
0
View file @
e4a9bf61
...
...
@@ -133,3 +133,31 @@ def find_four_corners(coords, threshold=120):
ll
=
min
(
lower
,
key
=
key
)
return
ul
,
ur
,
lr
,
ll
def
is_clockwise
(
vertices
):
"""
Returns whether a list of points describing a polygon are clockwise or counterclockwise.
is_clockwise(Point list) -> bool
Parameters
----------
vertices : a list of points that form a single ring
Examples
--------
>>>
is_clockwise
([
Point
((
0
,
0
)),
Point
((
10
,
0
)),
Point
((
0
,
10
))])
False
>>>
is_clockwise
([
Point
((
0
,
0
)),
Point
((
0
,
10
)),
Point
((
10
,
0
))])
True
>>>
v
=
[(
-
106.57798
,
35.174143999999998
),
(
-
106.583412
,
35.174141999999996
),
(
-
106.58417999999999
,
35.174143000000001
),
(
-
106.58377999999999
,
35.175542999999998
),
(
-
106.58287999999999
,
35.180543
),
(
-
106.58263099999999
,
35.181455
),
(
-
106.58257999999999
,
35.181643000000001
),
(
-
106.58198299999999
,
35.184615000000001
),
(
-
106.58148
,
35.187242999999995
),
(
-
106.58127999999999
,
35.188243
),
(
-
106.58138
,
35.188243
),
(
-
106.58108
,
35.189442999999997
),
(
-
106.58104
,
35.189644000000001
),
(
-
106.58028
,
35.193442999999995
),
(
-
106.580029
,
35.194541000000001
),
(
-
106.57974399999999
,
35.195785999999998
),
(
-
106.579475
,
35.196961999999999
),
(
-
106.57922699999999
,
35.198042999999998
),
(
-
106.578397
,
35.201665999999996
),
(
-
106.57827999999999
,
35.201642999999997
),
(
-
106.57737999999999
,
35.201642999999997
),
(
-
106.57697999999999
,
35.201543000000001
),
(
-
106.56436599999999
,
35.200311999999997
),
(
-
106.56058
,
35.199942999999998
),
(
-
106.56048
,
35.197342999999996
),
(
-
106.56048
,
35.195842999999996
),
(
-
106.56048
,
35.194342999999996
),
(
-
106.56048
,
35.193142999999999
),
(
-
106.56048
,
35.191873999999999
),
(
-
106.56048
,
35.191742999999995
),
(
-
106.56048
,
35.190242999999995
),
(
-
106.56037999999999
,
35.188642999999999
),
(
-
106.56037999999999
,
35.187242999999995
),
(
-
106.56037999999999
,
35.186842999999996
),
(
-
106.56037999999999
,
35.186552999999996
),
(
-
106.56037999999999
,
35.185842999999998
),
(
-
106.56037999999999
,
35.184443000000002
),
(
-
106.56037999999999
,
35.182943000000002
),
(
-
106.56037999999999
,
35.181342999999998
),
(
-
106.56037999999999
,
35.180433000000001
),
(
-
106.56037999999999
,
35.179943000000002
),
(
-
106.56037999999999
,
35.178542999999998
),
(
-
106.56037999999999
,
35.177790999999999
),
(
-
106.56037999999999
,
35.177143999999998
),
(
-
106.56037999999999
,
35.175643999999998
),
(
-
106.56037999999999
,
35.174444000000001
),
(
-
106.56037999999999
,
35.174043999999995
),
(
-
106.560526
,
35.174043999999995
),
(
-
106.56478
,
35.174043999999995
),
(
-
106.56627999999999
,
35.174143999999998
),
(
-
106.566541
,
35.174144999999996
),
(
-
106.569023
,
35.174157000000001
),
(
-
106.56917199999999
,
35.174157999999998
),
(
-
106.56938
,
35.174143999999998
),
(
-
106.57061499999999
,
35.174143999999998
),
(
-
106.57097999999999
,
35.174143999999998
),
(
-
106.57679999999999
,
35.174143999999998
),
(
-
106.57798
,
35.174143999999998
)]
>>>
is_clockwise
(
v
)
True
"""
if
len
(
vertices
)
<
3
:
return
True
area
=
0.0
ax
,
ay
=
vertices
[
0
]
for
bx
,
by
in
vertices
[
1
:]:
area
+=
ax
*
by
-
ay
*
bx
ax
,
ay
=
bx
,
by
bx
,
by
=
vertices
[
0
]
area
+=
ax
*
by
-
ay
*
bx
return
area
<
0.0
This diff is collapsed.
Click to expand it.
plio/io/io_gdal.py
+
1
−
3
View file @
e4a9bf61
...
...
@@ -14,8 +14,6 @@ from plio.io import extract_metadata
from
plio.geofuncs
import
geofuncs
from
plio.utils.utils
import
find_in_dict
from
libpysal.cg
import
is_clockwise
gdal
.
UseExceptions
()
NP2GDAL_CONVERSION
=
{
...
...
@@ -220,7 +218,7 @@ class GeoDataset(object):
@property
def
north_up
(
self
):
if
self
.
footprint
:
return
is_clockwise
(
json
.
loads
(
self
.
footprint
.
ExportToJson
())[
'
coordinates
'
][
0
][
0
])
return
geofuncs
.
is_clockwise
(
json
.
loads
(
self
.
footprint
.
ExportToJson
())[
'
coordinates
'
][
0
][
0
])
else
:
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment