Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.7.6
-
Fix Version/s: None
-
Component/s: WFS
-
Labels:None
-
Environment:1.7.6, windows Vista
-
Number of attachments :
Description
I have a vector dataset stored in a MySQL table and am trying to do a WFS request on it with this URL:
http://localhost:8080/geoserver/wfs?request=getfeature&service=wfs&version=1.1.0&typename=urban_region&outputFormat=GML3&cql_filter=INTERSECT(spatial_data,POLYGON((52.78429031372057 -3.8953366279600257,52.78429031372057 -2.6543542064157517,51.812992538486576 -2.6543542064157517,51.812992538486576 -3.8953366279600257,52.78429031372057 -3.8953366279600257)))
However I get back this error:
<ows:ExceptionText>java.util.NoSuchElementException: Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT id_primary, CODE, LEGEND, FILE_NAME, NUMBER, NAME, NUMBER0, ADMIN_NAME, TYPE, FERRY_FROM, FERRY_TO, FERRY_TIME, FERRY_TYPE, RESTRICTIO, ACCESS, AMENDED, USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IMPERIAL, METRIC,
AsText(spatial_data) AS spatial_data FROM urban_region Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT id_primary, CODE, LEGEND, FILE_NAME, NUMBER, NAME, NUMBER0, ADMIN_NAME, TYPE, FERRY_FROM, FERRY_TO, FERRY_TIME, FERRY_TYPE, RESTRICTIO, ACCESS, AMENDED, USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IMPERIAL, METRIC, AsText(spatial_data) AS spatial_data FROM urban_region Error Performing SQL query: SELECT id_primary, CODE, LEGEND, FILE_NAME, NUMBER, NAME, NUMBER0, ADMIN_NAME, TYPE, FERRY_FROM, FERRY_TO, FERRY_TIME, FERRY_TYPE, RESTRICTIO, ACCESS, AMENDED, USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IMPERIAL, METRIC, AsText(spatial_data) AS spatial_data FROM urban_region
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IM' at line 1</ows:ExceptionText>
Strangely, if I change output format to GML2 (all other formats produce the first error, above), I get a slightly different error:
<ows:ExceptionText>
error:Translator error Translator error Error reading Features Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT id_primary, CODE, LEGEND, FILE_NAME, NUMBER, NAME, NUMBER0, ADMIN_NAME, TYPE, FERRY_FROM, FERRY_TO, FERRY_TIME, FERRY_TYPE, RESTRICTIO, ACCESS, AMENDED, USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IMPERIAL, METRIC, AsText(spatial_data) AS spatial_data FROM urban_region
Error Performing SQL query: SELECT id_primary, CODE, LEGEND, FILE_NAME, NUMBER, NAME, NUMBER0, ADMIN_NAME, TYPE, FERRY_FROM, FERRY_TO, FERRY_TIME, FERRY_TYPE, RESTRICTIO, ACCESS, AMENDED, USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IMPERIAL, METRIC, AsText(spatial_data) AS spatial_data FROM urban_region
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USAGE, LOCATION, GIS, OWNER, NORTH, SOUTH, EAST, WEST, CLOCKWISE, ANTICLOCKW, IM' at line 1
</ows:ExceptionText>
I should note that the data displays fine in WMS, and that the same URL works perfectly when I use a different layer instead of urban_region.
This may be an error with the dataset (again, it display fine in WMS though), but a quick google search shows this error has occured before in GeoServer before being fixed.
Hmmm... the mysql datastore is pretty much abandoned, no one has been working on it since 1.5 years ago I think.
First strange thing I've noticed is the "astext" usage... why is not the wkb support used? Should be enabled by default.
Also, by looking at the query I have no idea why it's wrong, maybe one of the field names is a reserved character?
Can you run the same query in a sql client and find exactly what's wrong with it.