forked from calvinmetcalf/topojson.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request calvinmetcalf#20 from calvinmetcalf/scw-python3
Further Python 3 + testing updates
- Loading branch information
Showing
10 changed files
with
44 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
version="0.1.0", | ||
license="BSD", | ||
packages=find_packages(), | ||
test_suite = 'test.topojson_test' | ||
test_suite="tests" | ||
) |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .topojson_test import TestTopojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"description": "A 20°x20° box surrounding Null Island." | ||
}, | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [[ | ||
[-10, 10], | ||
[ 10, 10], | ||
[ 10, -10], | ||
[-10, -10], | ||
[-10, 10] | ||
]] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import json | ||
import unittest | ||
|
||
from topojson.conversion import convert | ||
|
||
|
||
class TestTopojson(unittest.TestCase): | ||
|
||
def setUp(self): | ||
with open("tests/data/square.geojson") as f: | ||
self.square_geojson = json.load(f) | ||
|
||
def test_convert_geojson_to_topojson(self): | ||
tj = convert(self.square_geojson) | ||
self.assertEqual(tj['type'], 'Topology') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from __future__ import division | ||
from math import ceil, log | ||
|
||
|
||
def hasher(size): | ||
mask = int(size) - 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters