Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Free spaital database

> Now I am thinnking Where to start?

Yes this is the joy of programming :-)

> I mean If I add an extra layer (polygon layer) using uDig and once I save
> the layer then it wil be stored as a .shp file. is it the proper way to
> store layer into database?

Have a look in the tutorials folder where there is an operation to
export a shapefile; you can modify this same approach to export to a
postgis table. I have done this for customers twice now; but so far it
has not
made it back into udig core.

Strictly as a user: you can also use the "create type" operation to
make a new postgis table; and then copy and paste data into the table.

> Otherwise will I need to store as a polygons into the database,and again
> where can I get these polygon values in to my uDig program? please take me through right way..

You can perform a query against a layer:
1. resolve the layer to a FeatureSource
2. featureSource.getFeatures( filter ) will give you a FeatureCollection
3. go through the feature collection to get the features
4. each feature has attributes; one or more of which will by a
geometry (ie a polygon?)

I think this may also be covered by a code example:
- http://udig.refractions.net/confluence/display/DEV/1+Code+Examples


Back to the top