GeoLatte / geolatte-geom

A geometry model that conforms to the OGC Simple Features for SQL specification.
Other
134 stars 63 forks source link

Measured Geometry Problem with geolatte-1.1 #56

Closed MartinSteinwender closed 6 years ago

MartinSteinwender commented 6 years ago

Hi,

I ran into problems storing measured jts-geometries where M-Ordinates where not set I could make it work with some minor changes

fist Problem was in org.geolatte.geom.jts.JTS.from(Geometry) (called in JTSGeometryJavaTypeDescriptor.unwrap)

second Problem was in org.geolatte.geom.jts.PointSequenceCoordinateSequenceFactory.toPositionSequence(...) (is call on org.geolatte.geom.jts.JTS.pscsFactory)

I had also Problems with com.vividsolutions.jts.geom.impl.CoordinateArraySequence.getOrdinate(int, int) since this methode does not support m-Values. I would like it to not restrict the ordinateIndex, e.g.:

@Override public double getOrdinate(int index, int ordinateIndex) { return coordinates[index].getOrdinate(ordinateIndex); }

with these changes persisting MGeometries works for me (tagged with "Modification" ) I hope this ist usefull for the project

changed.zip

added check for the MValues not lost to test_measured_2d and test_measured_3d TestJTS.zip

maesenka commented 6 years ago

Could you elaborate on what the problems were that you ran into?

I didn't support writing M-values to (or testing for M-values in) JTS-geometries because JTS doesn't really support measures. So I'm curious what your use case is?

Anyway, I'll consider your contribution. But you really should be using a Pull Request to contribute to a project on GitHub.

maesenka commented 6 years ago

This is now merged into master