After you create an index, you can import data into the index table.
Parameter | Description |
---|---|
URL | /index/:ds/:index/features |
Method | POST |
URL parameters | alias=[alphanumeric] specifies the name of the newly created DS. index=[alphanumeric] specifies the name of the newly created index. |
Data parameters | The Feature collection in the GeoJSON format. |
Success response | Code: 200. Content: Add a list of Feature IDs. |
Error response | Code: 400, which indicates that some required parameters are not specified. Content: empty. |
Example: Import data into the index table in my_ds. Write the Feature information in the GeoJson format to the features.json file, and import the file to HBase 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.json
If the operation is successful, the system returns the ID list of the newly input data: [1,2].