You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each of the 3 Subclasses of BasicPreparedGeometry throw an Error if you call the constructor.
TypeError: Cannot read properties of undefined (reading 'apply')
at Function.getCoordinates (node_modules/jsts/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.js:16:10)
at PreparedPolygon.apply (node_modules/jsts/org/locationtech/jts/geom/prep/BasicPreparedGeometry.js:13:60)
at new BasicPreparedGeometry (node_modules/jsts/org/locationtech/jts/geom/prep/BasicPreparedGeometry.js:6:40)
at new PreparedPolygon (node_modules/jsts/org/locationtech/jts/geom/prep/PreparedPolygon.js:13:5)
Interesting. But is there an actual use case for PreparedPolygon in JSTS? They are a performance enchantment for some usage in the original JTS but I would not assume those carry over in the transpilation.
I noticed the lack of perpared geometries as well trying to use the intersects() method. For what its worth, it looks like the prepared polygon's intersects() uses two spatial indexes, one for checking if the other geometrys points are inside or outside the polygon, as well as a spatial segment index for finding intersections that touch the the polygon. I would imagine the performance advantages of using the spatial indexes would also carry over to this transpiled version.
Each of the 3 Subclasses of BasicPreparedGeometry throw an Error if you call the constructor.
TypeError: Cannot read properties of undefined (reading 'apply')
at Function.getCoordinates (node_modules/jsts/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.js:16:10)
at PreparedPolygon.apply (node_modules/jsts/org/locationtech/jts/geom/prep/BasicPreparedGeometry.js:13:60)
at new BasicPreparedGeometry (node_modules/jsts/org/locationtech/jts/geom/prep/BasicPreparedGeometry.js:6:40)
at new PreparedPolygon (node_modules/jsts/org/locationtech/jts/geom/prep/PreparedPolygon.js:13:5)
Testcase
If you put a LineString or a Point in it, it fails as well.
To fix it simply call the super constructor with the given geometry.
PreparedPolygon:
The text was updated successfully, but these errors were encountered: