[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] How to implement custom DataStore?
|
Filip Krikava wrote:
Hello,
For couple of months I was working on an eclipse based application for
traffic data analyses and now it's time to add some GIS support and I
decided to use udig, which looks really nice.
Welcome.
What I need to do, is to display a map which consists of number of
road stretches. I have is a file-based database that have an interface
which provides a method that for given geographic coordinates and
given list of road classes returns a list of all road stretches with
attributes like name, geometry, maximum speed, etc. The data set is
rather huge about 2GB, in order to keep good responsive UI it needs to
limit the number of stretches to minimum - filtering based on zoom
level (on the country level it only makes sense to show motor-ways for
example).
I'm very new to both geotools and udig and I was wondering what is the
best way to implement it.
I have a really old advaced tutorial for data store developers over in
the geotools user guide...
The general idea is:
- extend abstract data store
- implement a couple of methods for read-only access - the important
one is making a "FeatureReader" over all your data
- everything else you get for "free" ...
- If you do have the ability to use an index it is worth your time to
override a few more methods and optimize.
The link is here:
- http://docs.codehaus.org/display/GEOTDOC/DataStore+Developers+Guide
The code used for that tutorial is now actually committed and available
as the PropertyDataStore; so if you want to study the final result you can.
Another idea is to *not* implement a DataStore; and write your own
renderer for your own content. uDig is an integration platform There are
some examples in the tutorials folder on how to do this taken from the
uDig training course.
The idea is to only bother to use GeoTools for your own work if it buys
you something you like. In this case it would buy you the ability to use
SLD styles.
In terms of making your data go fast there are a couple good options...
- process your data - using the JTS library to simplify your data - and
show the simplified data when the user is zoomed out; switch between
different scales of your data as you zoom in (ie have three layers; each
with a min / max scale set)
Finally it may be worth your time to use a spatial database such as
PostGIS; even if you just use it to simplify and process your data prior
to use. In general hacking up your data (or finding and then hacking up
your data) takes about 1/2 the time of most spatial application I end up
writing...
Jody