Michael Sexton ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ab9e62176-4dd6-4ba2-bff3-7786b22c11fc
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-9827?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 ) GEOS-9827 ( 
https://osgeo-org.atlassian.net/browse/GEOS-9827?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 ) CSV data source gives error, fails to find fields that are used for 
geometry. ( 
https://osgeo-org.atlassian.net/browse/GEOS-9827?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 )

Issue Type: Bug Affects Versions: 2.18.1 Assignee: Unassigned Created: 
14/Dec/20 1:35 AM Environment:

All platforms

Priority: Medium Reporter: Michael Sexton ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ab9e62176-4dd6-4ba2-bff3-7786b22c11fc
 )

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.

( 
https://osgeo-org.atlassian.net/browse/GEOS-9827#add-comment?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-9827#add-comment?atlOrigin=eyJpIjoiOWFmYzliOWExYWUzNDc3NGExODU5NTYzNGJlNjUwNTMiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100152- 
sha1:d8e2c46 )
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to