Changeset 1111

Show
Ignore:
Timestamp:
06/17/08 16:38:26
Author:
mattrussell
Message:

Stage of two of rename to 'geojsonlib'.
Changed setup.py to have the right name, changed maintainer details.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • geojsonlib/trunk/CHANGES.txt

    r1085 r1111  
    33 
    441.0a4 (Sun Apr 27 2008) 
    5 ------------------ 
     5----------------------- 
    66 
    77- Get in step with GeoJSON draft version 6. 
     
    1111 
    1212- Made tests use ELLIPSIS to avoid output transmogification due to floating 
    13   point representation.  
    14    
     13  point representation. 
     14  
     15 
     161.0a5 (Tues June 17 2008)   
     17------------------------ 
     18 
     19- Renamed package to "geojsonlib" 
     20 
  • geojsonlib/trunk/setup.py

    r1084 r1111  
    55version = open("VERSION.txt", "rb").read() 
    66 
    7 setup(name          = "GeoJSON", 
     7setup(name          = "geojsonlib", 
    88      version       = version, 
    99      description   = "Encoder/decoder for simple GIS features", 
    1010      license       = "BSD", 
    11       keywords      = "gis geography json", 
     11      keywords      = "gis geography geometry json", 
    1212      author        = "Sean Gillies", 
    1313      author_email  = "sgillies@frii.com", 
    14       maintainer        = "Sean Gillies", 
    15       maintainer_email  = "sgillies@frii.com", 
     14      maintainer        = "Matthew Russell", 
     15      maintainer_email  = "matt@sanoodi.com", 
    1616      url           = "http://trac.gispython.org/projects/PCL/wiki/GeoJSON", 
    1717      long_description = readme_text, 
    18       packages          = ["geojson"], 
     18      packages          = ["geojsonlib"], 
    1919      install_requires  = ["simplejson", "setuptools"], 
    2020      test_suite    = "tests.test_suite", 
  • geojsonlib/trunk/tests/blog.txt

    r1054 r1111  
    55   >>> d = {"blog": {"posts": [{"atom:summary": "post 1", "type": "atom:item", "atom:description": "i love blogging"}, {"atom:summary": "post 2 from CA", "type": "atom:item", "location": {"type": "Point", "coordinates": [-120.2138, 40.1231]}, "atom:description": "geoblogging in California"}], "location": {"type": "Polygon", "coordinates": [[[-121.5627, 39.8173], [-119.5221, 39.8173], [-119.1232, 41.1231], [-121.5632, 41.3321], [-121.2156, 39.8103]]]}}} 
    66 
    7   >>> import geojson 
     7  >>> import geojsonlib 
    88 
    99  Encoding 
    1010 
    11   >>> json = geojson.dumps(d) 
     11  >>> json = geojsonlib.dumps(d) 
    1212  >>> json # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE  
    1313  '{"blog": {"posts": [{"atom:summary": "post 1", "type": "atom:item", "atom:description": "i love blogging"}, {"atom:summary": "post 2 from CA", "type": "atom:item", "location": {"type": "Point", "coordinates": [-120..., 40...]}, "atom:description": "geoblogging in California"}], "location": {"type": "Polygon", "coordinates": [[[-121..., 39...], [-119..., 39...], [-119..., 41...], [-121..., 41...], [-121..., 39...]]]}}}' 
     
    1515  Decoding 
    1616 
    17   >>> o = geojson.loads(json) 
     17  >>> o = geojsonlib.loads(json) 
    1818  >>> type(o) 
    1919  <type 'dict'> 
  • geojsonlib/trunk/tests/c2c_features.txt

    r1063 r1111  
    3636 
    3737  >>> f = Feature(12, Point(49.132323, 55.341411), foo='bar') 
    38   >>> import geojson 
    39   >>> geojson.dumps(f) # doctest: +ELLIPSIS  
     38  >>> import geojsonlib 
     39  >>> geojsonlib.dumps(f) # doctest: +ELLIPSIS  
    4040  '{"geometry": {"type": "Point", "coordinates": [49..., 55...]}, "type": "Feature", "properties": {"foo": "bar"}, "id": 12}' 
    4141  >>> c = FeatureCollection([f]) 
    42   >>> geojson.dumps(c) # doctest: +ELLIPSIS 
     42  >>> geojsonlib.dumps(c) # doctest: +ELLIPSIS 
    4343  '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [49..., 55...]}, "type": "Feature", "properties": {"foo": "bar"}, "id": 12}]}' 
  • geojsonlib/trunk/tests/featurecollection.txt

    r1063 r1111  
    1515  Encoding 
    1616 
    17   >>> import geojson 
    18   >>> json = geojson.dumps(fc) 
     17  >>> import geojsonlib 
     18  >>> json = geojsonlib.dumps(fc) 
    1919  >>> json  # doctest: +ELLIPSIS 
    2020  '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [44..., 67...]}, "type": "Feature", "id": "1"}]}' 
     
    2222  Decoding 
    2323   
    24   >>> fcb = geojson.loads(json) 
     24  >>> fcb = geojsonlib.loads(json) 
    2525  >>> fcb  # doctest: +ELLIPSIS 
    2626  {u'type': u'FeatureCollection', u'features': [{u'geometry': {u'type': u'Point', u'coordinates': [44..., 67...]}, u'type': u'Feature', u'id': u'1'}]} 
     
    3030----------------------------------------------------------- 
    3131   
    32   >>> features = [geojson.Feature(id=1, geometry=geojson.Point(coordinates=(53.04781795911469, -4.10888671875)))] 
    33   >>> fco = geojson.FeatureCollection(features=features) 
     32  >>> features = [geojsonlib.Feature(id=1, geometry=geojsonlib.Point(coordinates=(53.04781795911469, -4.10888671875)))] 
     33  >>> fco = geojsonlib.FeatureCollection(features=features) 
    3434  >>> fco.features  # doctest: +ELLIPSIS 
    3535  [Feature(geometry={'type': 'Point', 'coordinates': (53..., -4...)}, properties={}, id=1)] 
     
    3838  Encoding 
    3939 
    40   >>> json = geojson.dumps(fco) 
     40  >>> json = geojsonlib.dumps(fco) 
    4141  >>> json  # doctest: +ELLIPSIS 
    4242  '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [53..., -4...]}, "type": "Feature", "properties": {}, "id": 1}]}' 
     
    4545   and can encode back into a instnace of the same kind, or supply your own hook: 
    4646 
    47   >>> hook = lambda ob: geojson.GeoJSON.to_instance(ob, geojson.feature) 
    48   >>> fc = geojson.loads(json, object_hook=hook) 
     47  >>> hook = lambda ob: geojsonlib.GeoJSON.to_instance(ob, geojsonlib.feature) 
     48  >>> fc = geojsonlib.loads(json, object_hook=hook) 
    4949  >>> fc.features  # doctest: +ELLIPSIS 
    5050  [Feature(geometry={'type': 'Point', 'coordinates': [53..., -4...]}, properties={}, id=1)] 
     
    6767  ...     @property 
    6868  ...     def __geo_interface__(self): 
    69   ...         return geojson.Point(coordinates=[self.x, self.y]) 
     69  ...         return geojsonlib.Point(coordinates=[self.x, self.y]) 
    7070 
    7171  >>> p = Point(53.04781795911469, -4.10888671875) 
    72   >>> geojson.dumps(p)  # doctest: +ELLIPSIS 
     72  >>> geojsonlib.dumps(p)  # doctest: +ELLIPSIS 
    7373  '{"type": "Point", "coordinates": [53..., -4...]}' 
  • geojsonlib/trunk/tests/features.txt

    r1063 r1111  
    1212  ... } 
    1313 
    14   >>> import geojson 
     14  >>> import geojsonlib 
    1515 
    1616  Encoding 
    1717 
    18   >>> json = geojson.dumps(f) 
     18  >>> json = geojsonlib.dumps(f) 
    1919  >>> json  # doctest: +ELLIPSIS 
    2020  '{"geometry": {"type": "Point", "coordinates": [53..., -4...]}, "type": "Feature", "properties": {"title": "Dict 1"}, "id": "1"}' 
     
    2222  Decoding 
    2323 
    24   >>> o = geojson.loads(json) 
     24  >>> o = geojsonlib.loads(json) 
    2525  >>> o  # doctest: +ELLIPSIS 
    2626  {u'geometry': {u'type': u'Point', u'coordinates': [53..., -4...]}, u'type': u'Feature', u'properties': {u'title': u'Dict 1'}, u'id': u'1'} 
     
    3030--------------------- 
    3131 
    32   >>> from geojson.examples import SimpleWebFeature 
     32  >>> from geojsonlib.examples import SimpleWebFeature 
    3333  >>> feature = SimpleWebFeature(id='1', 
    3434  ...             geometry={'type': 'Point', 'coordinates': [53.04781795911469, -4.10888671875]}, 
     
    5151  Encoding 
    5252 
    53   >>> geojson.dumps(feature)  # doctest: +ELLIPSIS 
     53  >>> geojsonlib.dumps(feature)  # doctest: +ELLIPSIS 
    5454  '{"geometry": {"type": "Point", "coordinates": [53..., -4...]}, "type": "Feature", "properties": {"summary": "The first feature", "link": "http:\\/\\/example.org\\/features\\/1", "title": "Feature 1"}, "id": "1"}' 
    5555 
    5656  Decoding 
    5757 
    58   >>> factory = geojson.examples.createSimpleWebFeature  
     58  >>> factory = geojsonlib.examples.createSimpleWebFeature  
    5959  >>> json = '{"geometry": {"type": "Point", "coordinates": [53.04781795911469, -4.10888671875]}, "id": "1", "properties": {"summary": "The first feature", "link": "http:\\/\\/example.org\\/features\\/1", "title": "Feature 1"}}' 
    60   >>> feature = geojson.loads(json, object_hook=factory) 
     60  >>> feature = geojsonlib.loads(json, object_hook=factory) 
    6161  >>> type(feature) 
    62   <class 'geojson.examples.SimpleWebFeature'> 
     62  <class 'geojsonlib.examples.SimpleWebFeature'> 
    6363  >>> feature.id 
    6464  '1' 
     
    8888  >>> ob.__geo_interface__['geometry']  # doctest: +ELLIPSIS 
    8989  {'type': 'Point', 'coordinates': (-106..., 40...)} 
    90   >>> geojson.dumps(ob)  # doctest: +ELLIPSIS 
     90  >>> geojsonlib.dumps(ob)  # doctest: +ELLIPSIS 
    9191  '{"geometry": {"type": "Point", "coordinates": [-106..., 40...]}, "id": "1", "properties": {"title": "thingy one"}}' 
  • geojsonlib/trunk/tests/geometrycollection.txt

    r1063 r1111  
    1212  Encoding 
    1313 
    14   >>> import geojson 
    15   >>> json = geojson.dumps(gc) 
     14  >>> import geojsonlib 
     15  >>> json = geojsonlib.dumps(gc) 
    1616  >>> json  # doctest: +ELLIPSIS 
    1717  '{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [44..., 67...]}]}' 
     
    2020  Decoding 
    2121   
    22   >>> gcb = geojson.loads(json) 
     22  >>> gcb = geojsonlib.loads(json) 
    2323  >>> gcb  # doctest: +ELLIPSIS 
    2424  {u'type': u'GeometryCollection', u'geometries': [{u'type': u'Point', u'coordinates': [44..., 67...]}]} 
     
    2828----------------------------------------------------------- 
    2929   
    30   >>> geometries = [geojson.Point(coordinates=[53.04781795911469, -4.10888671875])] 
    31   >>> gc2 = geojson.GeometryCollection(geometries) 
     30  >>> geometries = [geojsonlib.Point(coordinates=[53.04781795911469, -4.10888671875])] 
     31  >>> gc2 = geojsonlib.GeometryCollection(geometries) 
    3232  >>> gc2.geometries # doctest: +ELLIPSIS 
    3333  [Point(coordinates=[53..., -4...])] 
     
    3535  Encoding 
    3636 
    37   >>> json = geojson.dumps(gc2) 
     37  >>> json = geojsonlib.dumps(gc2) 
    3838  >>> json  # doctest: +ELLIPSIS 
    3939  '{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [53..., -4...]}]}' 
     
    4242  and can decode back into a instance of the same kind, or supply your own hook: 
    4343 
    44   >>> gc = geojson.loads(json, object_hook=geojson.GeoJSON.to_instance) 
     44  >>> gc = geojsonlib.loads(json, object_hook=geojsonlib.GeoJSON.to_instance) 
    4545  >>> gc.geometries  # doctest: +ELLIPSIS 
    4646  [Point(coordinates=[53..., -4...])] 
  • geojsonlib/trunk/tests/geometry.txt

    r1063 r1111  
    1111  ... } 
    1212 
    13   >>> import geojson 
    14   >>> import geojson.geometry 
     13  >>> import geojsonlib 
     14  >>> import geojsonlib.geometry 
    1515 
    1616  Encoding 
    1717 
    18   >>> json = geojson.dumps(g) 
     18  >>> json = geojsonlib.dumps(g) 
    1919  >>> json # doctest: +ELLIPSIS 
    2020  '{"type": "Point", "coordinates": [1..., -54...]}' 
     
    2222  Decoding 
    2323 
    24   >>> o = geojson.loads(json) 
     24  >>> o = geojsonlib.loads(json) 
    2525  >>> o # doctest: +ELLIPSIS 
    2626  {u'type': u'Point', u'coordinates': [1..., -54...]} 
     
    3030--------------------- 
    3131 
    32   >>> ls = geojson.geometry.LineString(((52.1, -34.131), (65.231, -34.234))) 
     32  >>> ls = geojsonlib.geometry.LineString(((52.1, -34.131), (65.231, -34.234))) 
    3333 
    3434  >>> ls.__geo_interface__ # doctest: +ELLIPSIS 
     
    4242  Encoding 
    4343 
    44   >>> json = geojson.dumps(ls) 
     44  >>> json = geojsonlib.dumps(ls) 
    4545  >>> json # doctest: +ELLIPSIS 
    4646  '{"type": "LineString", "coordinates": [[52..., -34...], [65..., -34...]]}' 
    4747 
    4848  Decoding 
    49   >>> geojson.loads(json) # doctest: +ELLIPSIS 
     49  >>> geojsonlib.loads(json) # doctest: +ELLIPSIS 
    5050  {u'type': u'LineString', u'coordinates': [[52..., -34...], [65..., -34...]]} 
    5151 
    52   >>> factory = lambda o: geojson.GeoJSON.to_instance(o, geojson.geometry) 
    53   >>> geom = geojson.loads(json, object_hook=factory) 
     52  >>> factory = lambda o: geojsonlib.GeoJSON.to_instance(o, geojsonlib.geometry) 
     53  >>> geom = geojsonlib.loads(json, object_hook=factory) 
    5454  >>> type(geom) 
    55   <class 'geojson.geometry.LineString'> 
     55  <class 'geojsonlib.geometry.LineString'> 
    5656  >>> geom.type 
    5757  'LineString' 
     
    6262  Test custom crs  
    6363  
    64   >>> from geojson.crs import Named 
     64  >>> from geojsonlib.crs import Named 
    6565 
    6666  >>> coords = ((-1918145.0108183471, -4098018.9166399641), (-680004.67204747663, -3864394.3196185972)) 
    6767 
    68   >>> ls = geojson.geometry.LineString(coords, crs=Named(properties=dict(name='EPSG:4326'))) 
     68  >>> ls = geojsonlib.geometry.LineString(coords, crs=Named(properties=dict(name='EPSG:4326'))) 
    6969 
    7070  >>> ls.__geo_interface__ # doctest: +ELLIPSIS 
     
    7373  It satisfies the geometry protocol 
    7474 
    75   >>> json = geojson.dumps(ls) 
     75  >>> json = geojsonlib.dumps(ls) 
    7676  >>> json # doctest: +ELLIPSIS 
    7777  '{"crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, "type": "LineString", "coordinates": [[-1918145..., -4098018...], [-680004..., -3864394...]]}' 
    7878 
    7979  Decoding 
    80   >>> geojson.loads(json) # doctest: +ELLIPSIS 
     80  >>> geojsonlib.loads(json) # doctest: +ELLIPSIS 
    8181  {u'crs': {u'type': u'name', u'properties': {u'name': u'EPSG:4326'}}, u'type': u'LineString', u'coordinates': [[-1918145..., -4098018...], [-680004..., -3864394...]]} 
    8282  
    8383 
    84   >>> factory = lambda o: geojson.GeoJSON.to_instance(o, geojson.geometry) 
    85   >>> geom = geojson.loads(json, object_hook=factory) 
     84  >>> factory = lambda o: geojsonlib.GeoJSON.to_instance(o, geojsonlib.geometry) 
     85  >>> geom = geojsonlib.loads(json, object_hook=factory) 
    8686  >>> type(geom) 
    87   <class 'geojson.geometry.LineString'> 
     87  <class 'geojsonlib.geometry.LineString'> 
    8888  >>> geom.type 
    8989  'LineString' 
     
    105105  >>> ob.__geo_interface__['coordinates']  # doctest: +ELLIPSIS 
    106106  (-106..., 40...) 
    107   >>> geojson.dumps(ob)  # doctest: +ELLIPSIS 
     107  >>> geojsonlib.dumps(ob)  # doctest: +ELLIPSIS 
    108108  '{"type": "Point", "coordinates": [-106..., 40...]}' 
  • geojsonlib/trunk/tests/including_additional_members.txt

    r1063 r1111  
    1919  ... } 
    2020 
    21   >>> import geojson 
     21  >>> import geojsonlib 
    2222 
    2323  Encoding 
    2424 
    25   >>> json = geojson.dumps(f) 
     25  >>> json = geojsonlib.dumps(f) 
    2626   
    2727  >>> json 
     
    3030  Decoding 
    3131 
    32   >>> o = geojson.loads(json) 
     32  >>> o = geojsonlib.loads(json) 
    3333   
    3434  >>> json 
     
    3636 
    3737 
    38 Custom objects can be decoded into a json structure containing valid geojson 
     38Custom objects can be decoded into a json structure containing valid geojsonlib 
    3939---------------------------------------------------------------------------- 
    4040 
     
    5252  >>> r = Route("Snowdonia circular", "A nice bike ride around some mountains", ((1.0, 2.0), (2.0, 3.2))) 
    5353   
    54   >>> json = geojson.dumps(r) 
     54  >>> json = geojsonlib.dumps(r) 
    5555   
    5656  >>> json  # doctest: +ELLIPSIS 
    5757  '{"description": "A nice bike ride around some mountains", "title": "Snowdonia circular", "geometry": {"type": "LineString", "coordinates": [[1..., 2...], [2..., 3...]]}, "type": "Feature", "properties": {}, "id": null}' 
    5858 
    59   >>> r = geojson.loads(json)  
     59  >>> r = geojsonlib.loads(json)  
    6060  >>> r # doctest: +ELLIPSIS 
    6161  {u'description': u'A nice bike ride around some mountains', u'title': u'Snowdonia circular', u'geometry': {u'type': u'LineString', u'coordinates': [[1..., 2...], [2..., 3...]]}, u'id': None, u'type': u'Feature', u'properties': {}} 
  • geojsonlib/trunk/tests/objects.txt

    r1063 r1111  
    11Encoding objects with __geo_interface__ 
    22------------------------------------------ 
    3   >>> import geojson 
     3  >>> import geojsonlib 
    44 
    55  >>> class LatLon(object): 
     
    1616  >>> lat_lon = LatLon(-54.1231, 4.53242) 
    1717   
    18   Can be encoded into geojson geometry: 
     18  Can be encoded into geojsonlib geometry: 
    1919 
    20   >>> json = geojson.dumps(lat_lon) 
     20  >>> json = geojsonlib.dumps(lat_lon) 
    2121  >>> json # doctest: +ELLIPSIS 
    2222  '{"type": "Point", "coordinates": [4..., -54...]}' 
    2323 
    24   Objects with a __geo_interface__ attribute or property can be nested in geojson feature: 
     24  Objects with a __geo_interface__ attribute or property can be nested in geojsonlib feature: 
    2525 
    26   >>> f = geojson.Feature(geometry=lat_lon) 
     26  >>> f = geojsonlib.Feature(geometry=lat_lon) 
    2727 
    2828  And feature will encode: 
    2929 
    30   >>> json = geojson.dumps(f) 
     30  >>> json = geojsonlib.dumps(f) 
    3131  >>> json # doctest: +ELLIPSIS 
    3232  '{"geometry": {"type": "Point", "coordinates": [4..., -54...]}, "type": "Feature", "properties": {}, "id": null}' 
    3333 
    34   geojson types can be used to implemented a __geo_interface__: 
     34  geojsonlib types can be used to implemented a __geo_interface__: 
    3535 
    3636  >>> class LatLon2(LatLon): 
    3737  ...     @property 
    3838  ...     def __geo_interface__(self): 
    39   ...             return geojson.Point((self.lon, self.lat)) 
     39  ...             return geojsonlib.Point((self.lon, self.lat)) 
    4040  ...  
    4141 
     
    4444  ...     @property 
    4545  ...     def __geo_interface__(self): 
    46   ...         return geojson.Point((self.lon, self.lat)) 
     46  ...         return geojsonlib.Point((self.lon, self.lat)) 
    4747  ...      
    4848  ...    
    4949 
    5050  >>> ll2 = LatLon2(-54.1231, 4.53242) 
    51   >>> json2 = geojson.dumps(ll2) 
     51  >>> json2 = geojsonlib.dumps(ll2) 
    5252  >>> json2 # doctest: +ELLIPSIS 
    5353  '{"type": "Point", "coordinates": [4..., -54...]}' 
     
    5757    - to a dict 
    5858 
    59   >>> feature_dict = geojson.loads(json) 
     59  >>> feature_dict = geojsonlib.loads(json) 
    6060  >>> feature_dict # doctest: +ELLIPSIS 
    6161  {u'geometry': {u'type': u'Point', u'coordinates': [4..., -54...]}, u'type': u'Feature', u'properties': {}, u'id': None} 
     
    6464 
    6565  >>> ll2 = LatLon2(43.3,-154.1)  
    66   >>> json = geojson.dumps(ll2)  
     66  >>> json = geojsonlib.dumps(ll2)  
    6767  >>> json # doctest: +ELLIPSIS 
    6868  '{"type": "Point", "coordinates": [-154..., 43...]}' 
    6969   
    70   >>> geojson.loads(json) # doctest: +ELLIPSIS 
     70  >>> geojsonlib.loads(json) # doctest: +ELLIPSIS 
    7171  {u'type': u'Point', u'coordinates': [-154..., 43...]} 
    7272   
    73   >>> factory = lambda ob: geojson.GeoJSON.to_instance(ob) 
    74   >>> geometry = geojson.loads(json, object_hook=factory) 
     73  >>> factory = lambda ob: geojsonlib.GeoJSON.to_instance(ob) 
     74  >>> geometry = geojsonlib.loads(json, object_hook=factory) 
    7575  >>> geometry   # doctest: +ELLIPSIS      
    7676  Point(coordinates=[-154..., 43...]) 
  • geojsonlib/trunk/VERSION.txt

    r1084 r1111  
    1 1.0a4 
     11.0a5