I am using the GeoServer Importer REST API to import some CSV data to an Oracle database(datastore). This is what I do:

  • create an export task:
curl -XPOST -H "Content-type: application/json" -d @import.json "https://server:8043/geoserver/rest/imports"

{"import": {
  "targetWorkspace": {
     "workspace": {
        "name": "gds"
  "targetStore": {
     "dataStore": {
        "name": "TestData"
} }
  • Define the data:
curl -F name=test -F filedata=@RS_Data.csv "https://server:8043/geoserver/rest/imports/${TASK_ID}/tasks"

Data:Modified sample from the GeoServer manual


Output is as follows:

  • Update CRS:
curl -XPUT -H "Content-type: application/json" -d @updateSRS.json "https://server:8043/geoserver/rest/imports/${TASK_ID}/tasks/0/layer"

the above call works fine:

  • create a transformation mapping the Lat/Lon columns to a point:
curl -XPOST -H "Content-type: application/json" -d @topoint.json "https://server:8043/geoserver/rest/imports/${TASK_ID}/tasks/0/transforms"

Works fine too

  • The import call is as follows:
curl -XPOST "https://server:8043/geoserver/rest/imports/${TASK_ID}"

However, running the task itself yields the following result with error:

    "dataStore":{"name":"TestData","type":"Oracle NG (OCI)"}},
    "errorMessage":"FeatureType http://www.opengis.net/gml:RS_DATA0 does not have lat lng fields named 'Lat' and 'Lon'",

Checking from Geoserver Webinterface, I get the following error:

java.lang.Exception: FeatureType http://www.opengis.net/gml:RS_DATA0 does not have lat lng fields named 'Lat' and 'Lon'
at org.geoserver.importer.transform.AttributesToPointGeometryTransform.apply(AttributesToPointGeometryTransform.java:56)
at org.geoserver.importer.transform.VectorTransformChain.inline(VectorTransformChain.java:41)
at org.geoserver.importer.Importer.loadIntoDataStore(Importer.java:1189)
at org.geoserver.importer.Importer.doIndirectImport(Importer.java:970)
at org.geoserver.importer.Importer.run(Importer.java:831)
at org.geoserver.importer.Importer.run(Importer.java:781)
at org.geoserver.importer.Importer.run(Importer.java:755)
at org.geoserver.importer.Importer.run(Importer.java:751)

I really can't figure out what's the problem, and I can't seem to find anything from the forum. The importer plugin documentation itself is rather thin.

Any Help?


The CSV should be:

ID,AssetID,SampleTime,Lat,Lon,Value 1,1,2015-01-01T10:00:00,10.00,62.00,15.2 2,1,2015-01-01T11:00:00,10.10,62.11,30.25

Written like you have it, there is an extra double quote that might make the parser think you have an attribute named ,Lon,Value (although it would be better if the code just threw an exception at the un-closed double quote)

| improve this answer | |
  • Thanks for the reply. However, even removing the double quote does not solve it. I had inserted the double quotes hoping that it was not interpreting the lat lon column names as strings. BTW, I tried with other datasets but to no avail. What beats me is that, i have one particular CSV file that seems to work fine. – algone Jan 15 '16 at 8:26
  • The problem still persists. While trying to find a solution, I checked the versions of my importer plugin and compared it to the Geoserver version. Turns out that I was using version 2.8.0 of Geoserver against 2.8.1 of the importer extension. So I moved to Geoserver 2.8.1, but no change, ...still the importer cant find the lat lon even though they are there. Could the problem be on the db side? Am using an Oracle OCI datastore – algone Jan 20 '16 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.