Hello Victor, Currently there is no way to fix this without a code change. I believe the problematic line of code is this one <https://github.com/geoserver/geoserver/blob/main/src/community/schemaless-features/schemaless-core/src/main/java/org/geoserver/schemalessfeatures/SchemalessFeatureMapper.java#L138> where the value type is forced to be the same of the AttributeType (that indeed is build on the first feature retrieved).
Regards, Marco Volpini == GeoServer Professional Services from the experts! Visit http://bit.ly/gs-services-us for more information. == Marco Volpini Software Engineer GeoSolutions Group phone: +39 0584 962313 fax: +39 0584 1660272 https://www.geosolutionsgroup.com/ http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail. On Fri, Feb 4, 2022 at 4:07 PM Victor.Sinceac <victor.sinc...@corobor.com> wrote: > Hi, > > When using this plugin > https://github.com/geoserver/geoserver/commits/main/src/community/schemaless-features > on a MongoDB collection where values to be used by a GeoServer layer are > declared as Object, the plugin builds a series of features where the > feature type is based on the type of the 1st feature. > > When layer expects values of type Double and the 1st feature found has > type Double, everything goes fine: other values in collection with type > Integer are casted to Double (e.g. value "29" is retrieved in the layer as > "29.0"). > > But, when 1st feature found has type Integer, everything goes bad: if > other values have type Double in collection, they are casted to Integer > (e.g. value "29.45" is retrieved in the layer as "29"). > > This is a blocking issue for a layer based on such a collection... > > Any idea how to fix this? > > A simple workaround would be to systematically add something like > "0.000000001" to every value in each document (this would force the object > to have type Double). But this is decidedly ugly, cannot call it a > solution... > > Many thanks, Victor > > Victor.Sinceac | > Software Developer > *victor.sinc...@corobor.com* <victor.sinc...@corobor.com> > Tel: *+33 1 45 73 60 60* <+33%201%2045%2073%2060%2060> > Corobor Systems | 41 Rue Périer , 92120 MONTROUGE , France > [image: Corobor Systems on LinkedIn] > <https://www.linkedin.com/company/corobor-systems> > [image: @corobor_systems] <https://twitter.com/corobor_systems> > > > > > > > ------------------------------ > This message is subject to and does not create or vary any contractual > relationship between Campbell Scientific Limited, its subsidiaries or > affiliates ("CSL") and you. Internet communications are not secure and > therefore CSL does not accept legal responsibility for the contents of this > message. The message is intended for the addressee only and its contents > and any attached files are strictly confidential. If you have received it > in error, please telephone +44 (0)1509 601141 or email > postmas...@campbellsci.co.uk. Thank you. > Campbell Scientific Ltd. > Company Registration Number: 1933935 (England and Wales) Registered > Address: Campbell Park, 80 Hathern Road, Shepshed, Loughborough, > Leicestershire LE12 9GX, UK > Tel: +44 (0) 1509 601141 > Fax: +44 (0) 1509 601091 > Web: www.campbellsci.co.uk > > ------------------------------ > > _______________________________________________ > Geoserver-devel mailing list > Geoserver-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-devel >
_______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-devel