Put data
Updated at:
After you create an index table, you can import data into the table by using the Ganos REST API.
| Configuration parameters | Description |
| URL | /index/:ds/:index/features |
| Method | POST |
| URL parameters | alias=[alphanumeric]: the name of an existing data source (DS). index=[alphanumeric]: the name of an existing index. |
| Data parameter | A feature collection in GeoJSON format. |
| Successful response | Code: 200. Returns a list of IDs for the added features. |
| Failed response | Code: 400. The request failed. |
For example, to import data into the
my_index index of the my_ds data source, write the feature information in GeoJSON format to a features.json file and then import the file into Ganos:echo '{"type":"FeatureCollection","features":[' \
'{"type":"Feature","geometry":{"type":"Point",' \
'"coordinates":[32,10]},"properties":{"id":"1","name":"n1"}},' \
'{"type":"Feature","geometry":{"type":"Point",' \
'"coordinates":[34,10]},"properties":{"id":"2","name":"n2"}}]}' \
> features.json
curl \
'localhost:8080/geoserver/geomesa/geojson/index/my_ds/my_index/features'\
-H 'Content-type: application/json' \
-d @features.jsonIf the command succeeds, a list of IDs for the new data is returned, such as [1,2].
Is this page helpful?