Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] CQLException on 'id' with Geomesa Geoserver plugin

Jo,

We now have a fix being reviewed:
  https://github.com/locationtech/geomesa/pull/891

Thanks again for your note.

Sincerely,
  -- Chris


On Tue, 2016-05-17 at 10:50 -0400, Chris Eichelberger wrote:
> Jo,
> 
> Ah!  This is an issue that's bitten us before, so 1) you're in good
> company; 2) this is exactly the right forum for your question.
> 
> It turns out that "id" is a reserved word in GeoTools:  https://githu
> b.
> com/geotools/geotools/blob/master/modules/library/cql/src/main/jjtree
> /E
> CQLGrammar.jjt#L428
> 
> We do have an outstanding ticket for GeoMesa to warn users when
> ingesting using reserved words:  https://geomesa.atlassian.net/browse
> /G
> EOMESA-1028  We hope to make some headway on this as part of 
> the upcoming 1.2.2 release of GeoMesa.
> 
> In the interim, there are good tools that can help you rename
> attributes in a Shapefile.  For example, see this question about
> ogr2ogr:  http://gis.stackexchange.com/questions/58541/how-to-rename-
> fi
> eld-names-in-a-shapefile-from-the-commandline  
> 
> Thanks!
> 
> Sincerely,
>   -- Chris
> 
> 
> 
> On Tue, 2016-05-17 at 14:24 +0100, Jo Walsh wrote:
> > 
> > dear all,
> > 
> > I'm evaluating Geomesa/Accumulo as a backend for Geoserver and so
> > far, so reasonable, however I have come across an issue after
> > ingesting a shapefile with a column named 'id' and then trying to
> > access that data source as a WFS layer in Geoserver - Geomesa
> > causes
> > Geotools raises a CQLException on the "id" field. I thought it
> > worth
> > raising here to see if others have come across the problem, what
> > insight others might have into the root causes, and whether this is
> > in fact the right forum for the issue.
> > 
> > I found a couple of what seem to be related tickets in
> > Geotools/Geoserver but they are both resolved:
> > https://osgeo-org.atlassian.net/browse/GEOT-2574
> > https://osgeo-org.atlassian.net/browse/GEOS-6634
> > 
> > And there's an older, also fixed geomesa issue referencing the ID
> > filter in ECQL: https://locationtech.org/mhonarc/lists/geomesa-user
> > s/
> > msg00195.html 
> > 
> > Here's the contents of geoserver.log where geomesa is triggering
> > the
> > error:
> > 
> > org.geoserver.wfs.WFSException: Error occurred getting features ...
> > Caused by: java.lang.IllegalArgumentException: Unable to parse
> > expression id=id org.geotools.filter.text.cql2.CQLException:
> > Encountered "id" at line 1, column 1.
> > Was expecting one of:
> >     <STRING_LITERAL> ...
> >     "true" ...
> >     "false" ...
> >     "point" ...
> >     "linestring" ...
> >     "polygon" ...
> >     "multipoint" ...
> >     "multilinestring" ...
> >     "multipolygon" ...
> >     "geometrycollection" ...
> >     "envelope" ...
> >     "(" ...
> >     "[" ...
> >     "-" ...
> >     <INTEGER_LITERAL> ...
> >     <FLOATING_LITERAL> ...
> >     <DATE> ...
> >     <DATE_TIME> ...
> >     <IDENTIFIER> ...
> >      Parsing : id.
> >         at
> > org.geotools.process.vector.TransformProcess.toDefinition(Transform
> > Pr
> > ocess.java:185)
> >         at
> > org.locationtech.geomesa.accumulo.index.QueryPlanner$.setQueryTrans
> > fo
> > rms(QueryPlanner.scala:324)
> >         at
> > org.locationtech.geomesa.accumulo.index.QueryPlanner$.configureQuer
> > y(
> > QueryPlanner.scala:228)
> >         at
> > org.locationtech.geomesa.accumulo.data.AccumuloFeatureCollection.ge
> > tS
> > chema(AccumuloFeatureSource.scala:115)
> >         at
> > org.locationtech.geomesa.accumulo.data.AccumuloFeatureCollection.ge
> > tS
> > chema(AccumuloFeatureSource.scala:105)
> > 
> > So it's happening here:
> > https://github.com/locationtech/geomesa/blob/master/geomesa-accumul
> > o/
> > geomesa-accumulo-
> > datastore/src/main/scala/org/locationtech/geomesa/accumulo/index/Qu
> > er
> > yPlanner.scala#L325
> > 
> > https://github.com/geotools/geotools/blob/master/modules/library/cq
> > l/
> > ECQL.md
> > states that ID is a predicate / reserved word in ECQL.
> > 
> > This is only happening if I ingest a shapefile with a column named
> > 'id' - i can replace the column name, re-ingest and the same data
> > appears fine via WFS.
> > 
> > cheers,
> > 
> > 
> > Jo
> > --
> > 
> > 
> > _______________________________________________
> > geomesa-users mailing list
> > geomesa-users@xxxxxxxxxxxxxxxx
> > To change your delivery options, retrieve your password, or
> > unsubscribe from this list, visit
> > https://www.locationtech.org/mailman/listinfo/geomesa-users
> _______________________________________________
> geomesa-users mailing list
> geomesa-users@xxxxxxxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://www.locationtech.org/mailman/listinfo/geomesa-users


Back to the top