[Geoserver-devel] [JIRA] (GEOS-9827) CSV data source gives error, fails to find fields that are used for geometry.

Michael Sexton created an issue

GeoServer / BugGEOS-9827

CSV data source gives error, fails to find fields that are used for geometry.

Issue Type:

BugBug

Affects Versions:

2.18.1

Assignee:

Unassigned

Created:

14/Dec/20 1:35 AM

Environment:

All platforms

Priority:

MediumMedium

Reporter:

Michael Sexton

Hi,

This was reported on the GeoServer Users Group. It possibly affects GeoTools.

http://osgeo-org.1560.x6.nabble.com/CSV-data-source-gives-error-SEC-UNOFFICIAL-td5451180.html

If I have a test CSV file as follows

ID,Lon,Lat
1,120.1,-35.2

And use the CSV Vector Data Source, choosing ‘guess’ as the strategy, on trying to create the Layer you get the following error:

Failed to load attribute list, internal error is: the SimpleFeatureType test:test does not contains the configured attribute Lon. Check your schema configuration

It seems at the below point in the code the layer tries to load the feature type with each property based on the list of attributes found in the CSV

https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/catalog/ResourcePool.java#L1078

But in GeoTools the Lat/Lon columns are removed on encoding of the Point class, which means the feature type does not have the attributes GeoServer is looking for

https://github.com/geotools/geotools/blob/master/modules/plugin/csv/src/main/java/org/geotools/data/csv/parse/CSVLatLonStrategy.java#L121

I’m not sure where this bug resides. Part of me thinks that the Lat/Lon fields shouldn’t be dropped when parsing a CSV, as they hold useful human-readable information. But I don’t know the internal logic of GeoTools all that well compared to GeoServer.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100152-sha1:d8e2c46)

Atlassian logo