Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Edit Tool Plugin Implementation - Committing changes over both vector and raster layers

A couple of responses inline...


I'm trying to implement curve edit tool

Fun.

Currently, my codes are heavily base on FreeHandTool and FreeHandPolygonDrawBehivaour.. Since, my tools will draw Line/Curve which will not be require any closing path. I like to be end-up with open ends. One question here, when I determineShapeType() from current getEditLayer(), it always return polygon..

It is based on the currently selected layer; so it should change depending on what layer you are editing.

I don't understand where I left to configure this to be SimpleFeatureType LineString. I used DrawType.LINE at initActivators and I have to force ShapeType.LINE at implementing behaviour.

And finally, I can use AbstractDrawCommand for drawing line and curve and from Path/PathAdapter/GeneralPath to EditUtils.appendPathToShape to adding vertices feature points..

The abstract draw commands are used for visual feedback while the user is drawing ... so they are not intended to do anything just provide something for users to see as they use the tool. When they have completed their shape you can set up some kind of edit command to push the shape into the current feature.

Now my main questions are:

How can I commit these drawing/changes to backdrop Map layer?

You will need to issue an edit command to update the geometry of the current feature; or create a feature if you are defining a new one.

I also want to write these drawing features/graphics to write on both features(vector) shapefiles layer and raster layer. How can I achieve that?

The shape file layer provides features which you can manipulate on the edit blackboard (the edit blackboard is just kind of a work area where several tools can manipulate a shape in a collaborative manner).

Updating a raster is an interesting idea; raster data is focused on sampling out records of information and I have not explored making tools to work on rasters yet. The grid coverage api is there and you can work with the raster data - I just have no experience with it.

I don't know what is happening, but all my drawing features/graphics over shapefile layer or raster layer could not save or commit changes..

Have a look at the docs here:
- http://udig.refractions.net/confluence/display/DEV/07+Edit+Tools

They are kind of my notes and diagrams about the edit tool framework. They are in a wiki so if you see anything that needs to be correct please go ahead and add to that page.

Jody



Back to the top