Last active
January 18, 2018 13:36
-
-
Save mapcentia/59751ce83abc42252ae3b2885f65ceb8 to your computer and use it in GitHub Desktop.
Feature API
This file contains hidden or 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
# Insert nye features. De skal ikke have deres primær nøgle, da denne typisk bliver autogeneret i databasen. | |
# Signatur /api/v2/feature/[user|subuser]/[layer med geom felt]/[projektion på GeoJSON] | |
# GeoJSON skal være en FeaturCollection. Også selvom der kun er en enkelt feature. | |
curl --header 'GC2-API-KEY:ffb2562b21bac90a0368b09995a697c1' -XPOST 127.0.0.1/api/v2/feature/test@mydb/foo.bar.the_geom/4326 -d ' | |
{ | |
"type": "FeaturCollection", | |
"features": [ | |
{ | |
"geometry": { | |
"type": "Point", | |
"coordinates": [ | |
9.3854141222287, | |
56.610719650965 | |
] | |
}, | |
"type": "Feature", | |
"properties": { | |
"id": 1 | |
} | |
}, | |
{ | |
"geometry": { | |
"type": "Point", | |
"coordinates": [ | |
9.5172500597103, | |
56.614498240617 | |
] | |
}, | |
"type": "Feature", | |
"properties": { | |
"id": 2 | |
} | |
} | |
] | |
} | |
' | |
# Update eks. features. De skal have deres primær nøgle i GeoJSON. Her "gid". | |
# Signatur /api/v2/feature/[user|subuser]/[layer med geom felt]/[projektion på GeoJSON] | |
# GeoJSON skal være en FeaturCollection. Også selvom der kun er en enkelt feature. | |
curl --header 'GC2-API-KEY:ffb2562b21bac90a0368b09995a697c1' -XPUT 127.0.0.1/api/v2/feature/test@mydb/foo.bar.the_geom/4326 -d ' | |
{ | |
"type": "FeaturCollection", | |
"features": [ | |
{ | |
"geometry": { | |
"type": "Point", | |
"coordinates": [ | |
9.3854141222287, | |
56.610719650965 | |
] | |
}, | |
"type": "Feature", | |
"properties": { | |
"gid": 1, | |
"id": 10 | |
} | |
}, | |
{ | |
"geometry": { | |
"type": "Point", | |
"coordinates": [ | |
9.3854141222287, | |
56.610719650965 | |
] | |
}, | |
"type": "Feature", | |
"properties": { | |
"gid": 2, | |
"id": 11 | |
} | |
} | |
] | |
} | |
' | |
# Delete eks. feature. | |
# Signatur /api/v2/feature/[user|subuser]/[layer med geom felt]/[projektion på GeoJSON]/[primær nøgle værdi] | |
# Der kan kun slettes én feature ad gangen. | |
curl --header 'GC2-API-KEY:ffb2562b21bac90a0368b09995a697c1' -XDELETE 127.0.0.1/api/v2/feature/test@mydb/foo.bar.the_geom/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment