Skip to content

Commit

Permalink
Improve sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
deeplook authored and sackh committed Jul 30, 2020
1 parent a9ebff5 commit 54c771c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ The following is a tiny "Hello World"-like example that you can run to have a su

```python
import json
import geojson
import xyzspaces as xyz
from geojson import FeatureCollection

xyz = xyz.XYZ(credentials="MY_XYZ_TOKEN")

Expand All @@ -116,7 +116,7 @@ description = "Description as markdown"
space = xyz.spaces.new(title=title, description=description)

# Add a Feature to a Space
features = {
feature = {
"type": "Feature",
"properties": {"party": "Republican"},
"geometry": {
Expand All @@ -131,7 +131,7 @@ features = {
}
}

feature_id = space.add_features(features=FeatureCollection([features]))["features"][0]["id"]
feature_id = space.add_features(features=geojson.FeatureCollection([feature]))["features"][0]["id"]

# Reading a Feature from a Space
feature = space.get_feature(feature_id=feature_id)
Expand Down

0 comments on commit 54c771c

Please sign in to comment.