From: Martin D. <mar...@te...> - 2004-02-05 19:04:15
|
Ian Schneider a =E9crit : >>* obviously, using special coordinate sequences could improve again >> the load time and memory footprint, since now we are spending twice >> the size of the .shp file in memory (the shapefile uses arrays of >> doubles in planar coordinate, in memory with have arrays of Coordian= tes, >> which take exactly twice the size as a couple of doubles). >=20 >=20 > Right. For some reason I thought that JTS1.4 provided a mechanism for t= his,=20 > but after looking, I realized it leaves alot the be desired. >=20 > Heres an idea, a GTGeometry: > - access to direct coordinates via index or array copying with offsets > - ability to create a JTSGeometry: a lazy, SoftReference to the bulky G= eometry=20 > with a CoordinateSequence adapter to the GTGeometry > - ability to determine which type of JTSGeometry it is, i.e getGeometry= Class()=20 > (either this or we mirror the Geometry classes in our own hierarchy..= .) > - other functionality we deem lacking of JTS Geometry? There is yet an other way that we may start to explore. While not=20 finished, GeoAPI already provides a set of interfaces built from ISO=20 19107. We may: - Remove all explicit reference to JTS geometries, and uses the OpenGIS's Geometry interface instead: http://geoapi.sourceforge.net/javadoc/org/opengis/gm/Geometry.html Using only OpenGIS's interface rather than JTS implementation may make it easier to switch to whatever backing store we want for coordinates. - Forget about JTS's CoordinateSequence, and use OpenGIS's PointArray instead (note: in my understanding of James discussion in past IRC meeting, we are allowed to provides some addition to this interface if we need them for efficient handling in Java): =20 http://geoapi.sourceforge.net/javadoc/org/opengis/gm/geometry/PointArray.= html This OpenGIS's PointArray interface is returned by LineString. In my understanding, if the Geometry is a GenericCurve (which sound like the case for most 2D primitives; 3D primitives would extends GenericSurface), then we fetch the data using: PointArray data =3D curve.asLineString().getControlPoints(); Are we ready to start the migration from JTS to ISO 19107 now? Should we=20 open a new module in Geotools (say "geometry") and start writting a=20 basic JTS wrapper? Martin. |