We learn more and more each time we talk :-)- There is some support for
SQLServer on geotools trunk; but I have not tried it out (or hooked it up to
uDig yet). So at least for the short term you are going to want to load
things into the application on your own. The Map blackboard is a good place
to load random data into; you can load in the shapes yourself using JDBC and
make them into a JTS Geometry on your own (a bad idea would be to store them
as a WKT String - are you making use of SQLServer spatial support to store
your gates?)
- Creating a tool like you describe will be okay; you should think carefully
about how your tool will work (as a series of clicks) and store the clicks
in your tool until the forth and final point is pressed. Most of the udig
edit tools allow the user to click multiple times and then ask for a double
click to "finish" the shape - but if you only need for points then you can
make it easier.
- Have a look at the DistanceTool (the one in udig) as an example of how to
use a draw command to provide visual feedback (it draws the "line" being
measured as the user does a click, click, click
- Indeed start by copying the uDig distance tool it does most of what you
want already!
- After the shape is drawn you will need to make a query against your road
database and check if any roads are too close; how you do that will depend
on what your roads are measured in (are they measured in meters? if so it
will be easy to check if they are 10 meters away!)
- Make sure to go over that coordinate tool and coordinate mapgraphic source
code and ask me any questions you have about how they work; this is how you
will show your "Gates"

If you had more time and energy it would be nice if the SQLServer support
was hooked up on trunk. This would let you treat your gates like a normal
layer. I need to add "event" support to the SQLServer datastore - but that
is something that can be done. Would you be able to copy one of the existing
datastore wizards as an example? This kind of sounds like a lot of work -
and it is only really useful if you have thousands of gates :-P

Jody

On Thu, Feb 26, 2009 at 6:26 PM, prasad babu <[email protected]>wrote:

> Hi Jody
>
> Thank you so much for your excelent reply. Here is my workflow
>
> 1-> I have to select a "toolgate" tool, use it to draw a gate, It can be
> any shape.
> Note- I need to select the points like(1,2,3,4) once i clicked 4 the one it
> has to connect the 4 coordinates,Othere wise I can draw somthing with
> lines (I prefer first one).
> 2->   I must write the toolgates outside the roads,If the road size is 10m
> then , I should not allow the users to draw toolgate with 8m.
> It should always to be >10.for that I need to extract the coardinates and
> need to do some calculations before drawing the gate.
>
> 3->Once I draw everything then I need to save ( tollgates) it in the
> SQLServer Database.
>
> 4-> Once I open the Map from the database then all gates has to popup
> automatically on to the screen, and also if I do any changes on that then it
> needs to save on database again.
>
> 5-> The coardiantes may differ , I mean some times i may need to connect 6
> coardiantes to draw a gate..
>
> This is my basic workflow, Any Ideas?
> Any way Thanks again for your answers.
>
> Best Regards
> Babu
>
> On Thu, Feb 26, 2009 at 12:46 PM, Jody Garnett <[email protected]>wrote:
>
>> On Thu, Feb 26, 2009 at 1:17 PM, prasad babu 
>> <[email protected]>wrote:
>>
>>> Hi
>>>
>>> I added  a plug-in to the tool, and now I need to draw some thing on the
>>> map which conncets 4 coardinates.
>>>
>>
>> So next up you can create a MapGraphic (its responsibility will be to draw
>> the coordinates). Have a look at the code example documented here:
>> -
>> http://udig.refractions.net/confluence/display/DEV/2+Training+Materials#2TrainingMaterials-MapGraphic
>>
>>
>>> and I must restrict the size and way of the polygon or whatever... I wont
>>> allow users to draw what ever they want. I need to do some calculations
>>> while drawing a extra layer on the map.
>>>
>>
>> That is fine; you can do whatever you need when drawing.
>>
>>>
>>> My actual requirement.
>>>
>>> I need to work on a road map, there will be many roads , and I need to
>>> add some gantrys (means toll gates for price calculations) to the map . I
>>> just want to add a plug -in to do this process.
>>>
>>
>> So what is your workflow? Are the four points representing a "tool gate"?
>> 1. Select the "toll gate" tool; use it to draw a gate
>> 2. During drawing you can use a DrawCommand to provide visual feedback;
>> when the gate is done you can invalidate the draw command and add the new
>> gate to the map blackboard. When the gate is done you can check if there is
>> a "toll gate" mapgraphic on the map and if not you can add it; if it is
>> already there you can refresh it
>> 3. Create a "toll gate" mapgraphic that draws the toll gate on the screen
>>
>> Is this correct? Are you really drawing a box for a toll gate; or do you
>> need to click and snap to the nearest layer?
>>
>>    1-> Which class I need to extend to write an extra layer? (I extended
>>> simple tool for calulate the distance in the example,there are methods like
>>> mouse dragged  and so on..) and I also needto do an reverse engine that
>>> means I will get the data from GPS (4 Coardinates)
>>> and I need to connect ther 4 coardinate and  display it
>>> automaticaly once I open the Map.
>>>
>>> Plese suggest me what would be the best way to do this.
>>>
>>> Any ideas will be appriciated.
>>>
>>> Thanks in advance
>>> Babu
>>>
>>>
>>>
>>> On Wed, Feb 25, 2009 at 10:51 AM, Jody Garnett 
>>> <[email protected]>wrote:
>>>
>>>> That sounds perfect; if you are intending to define a region of interest
>>>> then a region of interest tool is more explicit to both you and your user.
>>>> You should find that your tool can store the region of interest on the map
>>>> backboad; and then your other view etc can pick it up from there as needed.
>>>> The coordinate tool / coordinate map graphic example in tutorials show how
>>>> to do this; and it has been used by many other teams. The DIVAGIS team used
>>>> this techqniue to define a region of interest "grid" and then had a bunch 
>>>> of
>>>> operations build around doing analysis of the points that fell into each
>>>> grid square.
>>>>
>>>> Jody
>>>>
>>>>
>>>> On Tue, Feb 24, 2009 at 7:46 PM, Despres 
>>>> <[email protected]>wrote:
>>>>
>>>>>     Thanks for your help,
>>>>>
>>>>>
>>>>>
>>>>> The point is that the filter i get doesn’t contain a bounding box.
>>>>> Indeed, I may have only one or no rasters layer on the map.
>>>>>
>>>>> I think what I tried to do is impossible with the Bbox selection tool,
>>>>> so I developped my own Bbox tool. The goal is just to define a Region of
>>>>> Interest.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Damien
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>  ------------------------------
>>>>>
>>>>> *De :* [email protected] [mailto:
>>>>> [email protected]] *De la part de* Jody Garnett
>>>>> *Envoyé :* mardi 24 février 2009 06:08
>>>>> *À :* User-friendly Desktop Internet GIS
>>>>> *Objet :* Re: [udig-devel] BBoxSelection Listener
>>>>>
>>>>>
>>>>>
>>>>> The filter geneated by the BBoxSelectionCommand is available for you
>>>>> .... layer.getFilter().
>>>>>
>>>>>
>>>>> You can look at this data structure and get the bounding box if you
>>>>> like; altough the selection for a layer (ie the filter) is not always done
>>>>> as a bounding box.
>>>>>
>>>>> I hope this helps.
>>>>>
>>>>> If you need to listen to any random part of the
>>>>> project/map/layer/viewport model you can - the magic word you need to know
>>>>> is "adapters"; the best way to figure out how is to look at some of the
>>>>> existing add/remove listener implementations and watch how they translate 
>>>>> a
>>>>> Notification (ie what adapters "listen to") into a layer change event.
>>>>>
>>>>> I am still not sure if the various map changed, and layer changed
>>>>> events are worth while or if it would be easier just to use this
>>>>> Notification thing everywhere.
>>>>>
>>>>> Jody
>>>>>
>>>>>    On Wed, Feb 18, 2009 at 4:35 AM, Despres <
>>>>> [email protected]> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I’m trying to develop a plug-in that could listen to the
>>>>> BBoxSelectionCommand and get the bbox that have been drawn by the user 
>>>>> with
>>>>> the bbox tool.
>>>>>
>>>>> I’ve tried to add a MapListener, I catch an event but it doesn’t help:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *activeMap*.addMapListener(*new* IMapListener(){
>>>>>
>>>>>             *public* *void* changed(MapEvent event)
>>>>>
>>>>>             {
>>>>>
>>>>>               System.*out*.println("change");
>>>>>
>>>>>               *if*(event.getType() == MapEvent.MapEventType.*
>>>>> MAP_COMMAND*){
>>>>>
>>>>>                 CommandManager val =
>>>>> (CommandManager)event.getNewValue();
>>>>>
>>>>>                 Object *old*=event.getOldValue();
>>>>>
>>>>>                 System.*out*.println(val.getMaxHistorySize());
>>>>>
>>>>>               }
>>>>>
>>>>>             }});
>>>>>
>>>>>               }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance for your help, I’m really lost here.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *DESPRES Damien*
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>> http://udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>> http://udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>>
>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig)
>>> http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>
>>>
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>>
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to