-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: When exporting a GeoJSON with ElementType BigDecimal, value is exported in quotation marks #1248
Comments
Looking at the property definition in the screenshot I don't think the behavior is wrong for the schema definition. hale does not support multi-dimensional arrays or lists of lists as binding at the moment though. The type is defined as list of BigDecimal but its values seem to be lists of lists of numbers. I would guess what happens is that the list can't be converted to BigDecimal so for writing to Json it resorts to the string representation as fallback. The workaround with the explicit geometry binding that was mentioned only works in cases where the intent is to create a GeoJson geometry representation, which in the given example seems to be the case. |
I was the one who raised the ticket. |
@JohannaOtt so how my xsd schema should look like if I wanted to use GeometryProperty class? |
@mgarbula If you use an XML schema to define the schema, then you need to use GML types to have a geometry binding in hale. Here is an example based on your project (zip contains project and exported Json): In the exported Json you can see that |
This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in two weeks if no further activity occurs. Thank you for your contributions. |
As the behavior describe as a bug in the issue description is expected and all questions are clarified, I would like to move on and close this issue. @mgarbula Any objections? |
This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in two weeks if no further activity occurs. Thank you for your contributions. |
Describe the bug
When exporting a GeoJSON file for a schema based on an xsd defining an element as BigDecimal, the values are exported with quotation marks.
To Reproduce
Check the transformation provided in this forum thread.
Expected behavior
There should be no quotation marks when exporting the data as GeoJSON.
Possible workaround: As a workaround it should be possible to use a schema that uses an actual geometry binding and let the writer encode it as geojson geometry. So defining geometry as a geometry field (using hale GeometryProperty class as binding, directly using JTS Geometry class might also work).
The text was updated successfully, but these errors were encountered: