geoserver

Geoserver Layer from HTTPRequest


I am curious, is there a way for me to create a layer from an HTTPRequest in Geoserver. The response contains Geospatial data but it is not in any spatial format (Plain JSON):

{ 
   "status" : [
       {
           "name" : "Peter Ian Staker",
           "latdd" : "0.000", 
           "lngdd" : "0.000"
       }, 
    ...
   ],
   "datetime" : "today"
}

the data above is contrived but similar to the structure of what I will be receiving. I am currently using Geoserver for a few local datasets that I have and It would be nice to able to use one central server.


Solution

  • No, GeoServer will only create layers from geospatial data stores, and even if that was real GeoJson it would be a really bad idea to make a layer from it as it would require GeoServer to parse the text file each and every time some one moved the map.

    Take the data and parse it, write the output to a suitable database (PostGIS or GeoPackage) and then load layers from the database to GeoServer using the REST api.

    If you must do it inside GeoServer from a HTTP response you could look at adding it to a data base as part of a WPS process but that's a lot of work to reinvent ogr2ogr