[GEOS] #896: Many (all?) GEOS operations do not preserve SRID

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+--------------------------
 Reporter:  dbaston     |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:  3.6.3
Component:  Default     |    Version:  3.6.2
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 For example, the following test fails:

 {{{
     void object::test<11>()
     {
         geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0)");
         GEOSSetSRID(geom1_, 32145);

         geom2_ = GEOSOffsetCurve(geom1_, 2, 0, GEOSBUF_JOIN_ROUND, 2);

         ensure_equals( GEOSGetSRID(geom1_), GEOSGetSRID(geom2_) );
     }

 }}}

 It's obvious that SRID could be preserved here. For binary operations, I'd
 say that it's not the job of GEOS to check SRID consistency, and that the
 result could have the SRID of the first argument.

 Any thoughts about this?

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------
Changes (by robe):

 * milestone:  3.6.3 => 3.7.0


Comment:

 I would agree, but I think this would constitute a policy change so can't
 go in 3.6.3.

 Could go in 3.7.0 even though we've called beta since it's not really an
 api change.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:1>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 Did you check what do Intersection/Union do ?
 I suspect OffsetCurve is just behind as being
 original  code (rather than direct JTS port)

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:2>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by dbaston):

 No, I didn't check intersection or union. I started writing unit tests for
 this, and then it occurred to me that maybe this wasn't considered a bug.
 If there's agreement that it's a bug, I can go ahead with tests and fixes
 for all functions.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:3>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by dbaston):

 It looks like the problem is unique to the C API, and affects all
 functions that produce a geometry as an output.

 When a GEOS Geometry is created, it is given the SRID of its
 GeometryFactory. However, the C API does not use the concept of a
 GeometryFactory and provides no access to it. When the C API function
 GEOSSetSRID is called, it sets the SRID of an individual geometry, but
 leaves the GeometryFactory untouched.

 Any objections to resolving this at the C API level, by setting the SRID
 of created geometries to match their inputs?

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:4>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by robe):

 I've got no objections.  I don't even have objections if you want to back
 port to 3.6, 3.5 as it does sound like a bug.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:5>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 I don't think GeometryFactory should be affected by GEOSGeom_setSRID.
 JTS also doesn't set SRID of output geometry from operations, I wonder
 what Martin Davis thinks about this.

 I'm +0 with adding SRID propagation in C-API (as I guess as of now
 all clients are already doing this in their converters)

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:6>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 So it turns out Geometry#setSRID is supposed to be only used in
 exceptional cases, for backward compatibility:
 https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java#L264

 Rather, a user should indeed set the SRID in the factory, which we're not
 doing from C-API.

 Now that we DO have garbage-collected factories (for precision model) we
 might start doing something about SRID too. Sounds like a wider plan is
 needed though.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:7>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: Many (all?) GEOS operations do not preserve SRID

geos-2
In reply to this post by geos-2
#896: Many (all?) GEOS operations do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by dbaston):

 Hi strk, I probably expressed myself poorly. I don't think the C API
 should modify the GeometryFactory.

 Because it is not possible to manipulate a GeometryFactory in the C API, I
 think that the C API should set the SRID of the output geometries (after
 they are created) to match the SRID of the inputs.

 I don't think we should try to retrofit GeometryFactories into the C API.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:8>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: CAPI functions do not preserve SRID (was: Many (all?) GEOS operations do not preserve SRID)

geos-2
In reply to this post by geos-2
#896: CAPI functions do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:9>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: CAPI functions do not preserve SRID

geos-2
In reply to this post by geos-2
#896: CAPI functions do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by dbaston):

 Related: #724

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:10>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: CAPI functions do not preserve SRID

geos-2
In reply to this post by geos-2
#896: CAPI functions do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.7.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by dbaston):

 To attempt to further clarify, I am proposing that C API functions be
 modified like this (from `GEOSUnaryUnion_r`):


 {{{
 GeomPtr g3 ( g->Union() );
 g3->setSRID( g->getSRID() ); // proposed modification
 return g3.release();
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:11>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #896: CAPI functions do not preserve SRID

geos-2
In reply to this post by geos-2
#896: CAPI functions do not preserve SRID
------------------------+---------------------------
 Reporter:  dbaston     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.8.0
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------
Changes (by robe):

 * milestone:  3.7.0 => 3.8.0


--
Ticket URL: <https://trac.osgeo.org/geos/ticket/896#comment:12>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel