Mike Bresnahan ha scritto:
> Given a WMS request for a 256x256 map tile and vector data stored in
> Oracle Spatial, I am trying to understand how GeoTools crops the
> image. Judging by some database tracing, GeoTools does not appear to
> use the sdo_intersection function. Instead it simply queries all
> polygons that have any interaction with the bounding box of the map
> tile (via the sdo_relate operator). This will result in a lot of
> vertices outside the bounding box of the map tile. How does GeoTools
> transform this into just the vertices present on the map tile and/or
> where in the source code does this happen?
> 
> The reason I ask, is because I am trying to implement a high
> throughput map tiler to transform some very large polygons into
> smaller polygons of the right size for a map tile. I have tried to do
> this by using sdo_intersection to compute the intersection of the
> large polygons with the bounding box of the map tile, but it is very
> very slow. I have seen a single intersection of a tile bounding box
> and a 40,000 vertex polygon take 11 seconds. Since I have to perform
> over 100,000 of these operations, I need to find something faster. I
> know its possible to do this faster, because GeoTools creates map
> tiles in less than 11 seconds on the same data. But so far I have not
> been able to find the magic code in the source I downloaded.
> 
> Any help would be greatly appreciated.

GeoTools simply loads everything that happens to be even partly
in the requested bbox, simplifies the geometry and then has java2d
draw it, the native code that performs drawing does the rest,
but for sure it's not doing a topological overlay, that's way
too much expensive as you noticed.

The path is basically the same for all datastores, for shapefiles
we have some extra optimized renderer, but that's it. Try loading
your data in postgis and feel the difference, if that is enough,
it's the Oracle datastore that you have to blame. To put it gently,
performance wise the Oracle datastore is... bad.... really bad.
It just takes a lot of time to read the geometries from the
backend, and does not build JTS geometries optimized for rendering
speed.

Anyways, if you want, you can use GeoServer and GeoWebCache to
address your problem directly, the first renders the tiles
(slowly on top of Oracle) the second caches the results so that
you just have to compute each tile once. That is, assuming
your data is not changing.

Cheers
Andrea

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to