|
From: Trevor S. <ts...@ty...> - 2005-07-15 22:32:17
|
Greetings everyone, Our use of Geotools is in a client-server situation. We use the StyledMapPane on the client, which makes requests to a small wrapper around calls to DataStores. The client knows its area of interest, and includes that in the request; the server sends back serialized feature wrappers (I posted the code to do so on the Wiki some time ago). There are two main situations in which we display a StyledMapPane. When a user starts our application they see an "overview map" of the whole county, showing a few layers which make sense at that size, such as rivers and major roads. When they zoom in to a certain depth other layers, such as parcels, will load. For the other use case, they call up a specific parcel and see that parcel and a few neighboring ones and then can maneuver in the map if they desire. Our architect did some profiling recently and noticed that the memory usage from loading the overview map was on the order of 20MB (the rest of the app takes about 6MB on startup), and created well over 100,000 Coordinate objects. I'm not surprised at this number of coordinates, since rivers and roads tend to have a lot of points. However, since the map is only about 200 pixels square, many of these points are sent unnecessarily, because they won't get rendered as separate points. Our architect asserted that we should be able to filter features that would be smaller than a pixel (easy) and transform the remaining geometries to match the desired resolution. A line with lots of small wiggles when viewed at high resolution looks straight when viewed from low resolution, so there's no reason to send all the extra data until the user zooms in, at which point it would be sampled at a higher resolution. What's the best way to do this? Is there already a Geotools or JTS method I can call to perform this operation? If there isn't, and I were to write it, where in Geotools would it belong? (I'm assuming this would be a generally useful method...) Is there a better way of accomplishing the same goal (i.e. optimizing geometries for memory size)? Thanks, -- Trevor Stone | Software Engineer | tel 800-554-4434 ext 208 | fax 303-271-1930 | email ts...@ty... Tyler Technologies | Eagle Division | 14142 Denver West Pkwy Suite 155 | Lakewood, CO 80401 | www.tyler-eagle.com |