Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] An initial buffer works! ...and some subsequent questions.

Adrian Custer wrote:
Hey Jessie,
Thanks for your answer. Some clarification.


On Mon, 2006-03-13 at 10:19 -0800, Jesse Eichar wrote:

The catalog API has a method for creating "temporary georesources" such
as a memoryDatastore.
The method is something like:
CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource( featureType );


Is this really recent method in ICatalog? I can't find it in 1.1M4SDK
nor on the web javadocs.
I may of been on the OWS3 branch (ie where we needed it), it may be something that we did not have time to check back in yet. Can you check the latest release? The project Richard is on may of taken the time to bring this needed functionality in (actually he asked my about icons for it so it seems likely).
2) What's the elegant/correct way to bail out of an operation if I
get to a point where something doesn't resolve or some other assertion
fails?


Make sure you close all you resources (file handlers, readers/writers
etc... ) and return.  The framework doesn't really care as long as you
clean up after yourself.
So we can bail out, even firing off exceptions, and the RCP will
continue happily? If so, is there a uDig policy on how to transmit error
messages to the user?
At a minimumL normal eclipse policy, please use the Trace/Log facilities correctly. These facilities include dialogs for nasty things...

For udig specific opperation questions:
- I would prefer if your operation had a "view" that it was going to * This does not always make sense for the drop event. But in =20
the case that the component is a jface viewer then this method will =20
indicate the
     * location where the drop is taking place (before, on or after =20
the destination object).
     *
     * @see ViewerDropAdapter#getCurrentLocation()
     *
     * @return If the component is not a viewer this will always =20
return {@link ViewerDropAdapter#LOCATION_ON} otherwise it will be one =20
of the LOCATION_*
     * values.
     */
    public int getViewerLocation() {
        return location;
    }

}

Jesse


On 14-Mar-06, at 12:22 PM, M.S.Bachler wrote:

Hi!

That's great.
(I thought it was just me being really thick, and not spotting how to=20
get the x,y).

Thanks for adding these changes.

I still can't download the source code at the moment - we do use a
proxy
and I have a feeling it must be blocking some of the command =20
Subversion
needs - I will see IT tomorrow about it.

As I can't get to the source code - are there any javadocs on these=20
changes so I know what methods/variables are now available.

Thanks


Michelle

-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jesse=20
Eichar
Sent: 14 March 2006 19:08
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Shapefiles


Ok so a change of plans.

I've changed the API slightly.  Shouldn't bother you too much, all the

information is still there in the IDropAction class, now I've added=20
the getEvent() method to the IDropAction class.  It has the x,y=20
location of the event.

I think I've cleaned things up a little so you shouldn't have to worry

about any other classes besides the IDropAction (before the=20
UDIGDropHandler was accessible from the IDropAction)  I've changed=20
that but made sure that all the information is still available in the=20
IDropAction.


Jesse

On 14-Mar-06, at 9:33 AM, Jesse Eichar wrote:

Truthfully this is a good question.  I think you've identified=20
another short coming of this API.  I am going to make 3 changes to=20
UDIGDropHandler.

1.  I'm going to change getLocation to return a Point which will be=20
the x,y coordinates of the drop event relative to the component that=20
the component is dropped on. 2.  I'm going to add the method=20
getViewerLocation() that will return ON, BEFORE and AFTER locations.

(That is what getLocation() currently does)
3.  I'm going to add a method isViewer() so you can determine if
the control is a viewer and if you should use getViewerLocation()
or getLocation().

You'll have to download tonights nightly build.

(Sorry for the hard time you are having but DND has been a real=20
headache for me to figure out, never mind do right)

Jesse

On 14-Mar-06, at 2:19 AM, M.S.Bachler wrote:

Hi

Sorry about yesterdays rant.

If you have not lost all patients with me, I would really appreciate

it if anyone could tell me how I get the x, y coordinates of the=20
drop from
my IDropAction class.

Thanks

Michelle

-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of=20
M.S.Bachler
Sent: 13 March 2006 11:04
To: User-friendly Desktop Internet GIS
Subject: RE: [udig-devel] Shapefiles


Hi!

Thanks everyone for your various inputs.
I am still not sure what I am doing (I have decided I am just=20
thick!).

I can't see how the DataUtility way or creating a FeatureType passes

in the x,y of the point. Then again, I can't even figure out how I
get the
x, y coordinates of the drop from my IDropAction class in order to
create the coords for my Point class in the first place? I have run
around the API, but can't figure it out.

Is there really no example code out there that I can study to
help me

understand things better. I am unable to download the source code=20
with Subversion (I did write to the list about this but no one
replied). I
need the equivalent of "uDig for Dummies" book.

Being a Java developer for many years I thought this project
would be

relatively easy. But I think having no familiarity with Eclipse or=20
GIS at all, has really not helped me. While Eclipse is becoming more
familiar, 'GIS speak' is still a mistery. I think what seems
obvious to
many of you when talking about the code, just escapes me.

I know people are reluctant to spoon feed me the code I need. I know

I need to go through the pain barrier and try and understand it
all myself. But it really hurts, and for various reasons the
timescale
of my project has been shrunk, and I am in danger (for the first
time in
my lief!), of not completing something, and having to say I can't
do it.

I think I have just not reached that eureka moment, when everything=20
suddenly clicks into place. I hope it happens soon! I still have a=20
head full of floating jigsaw pieces.

Meanwhile, if someone could help me with how I get the x,y of the=20
drop, that would be great.

Michelle - ( with a heavy cold - feeling rather sorry for myself :-=20
( - going to get a cup of tea )

-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jody=20
Garnett
Sent: 11 March 2006 08:58
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Shapefiles


You guys are working to hard, I wrote a parser method I never wanted

to do this stuff twice.
-
http://udig.refractions.net/docs/api-geotools/org/geotools/data/
DataUtil
ities.html

The format is silly, but it is in the javadocs:
- http://udig.refractions.net/docs/api-geotools/org/geotools/data/
DataUtil
ities.html#createType(java.lang.String,%20java.lang.String)

basically:
"name:String,age:Number,position:Point,*destination:Point"
Where the * indicates the default geometry ..

Other useful stuff:
- http://udig.refractions.net/docs/api-geotools/org/geotools/
feature/
Featu
reTypes.html

Jody


M.S.Bachler wrote:

Hi!

Silly question.

Earlier you helpfully gave me a code snippet to create a new=20
shapefile.

IndexedShapefileDatastoreFactory fac=3Dnew=20
IndexedShapefileDataStoreFactory();

ShapefileDataStore ds=3Dfac.createDatastore(url);

// I assume this is the URL of the new shapefile I want it to=20
create?

GeometryFactory gf =3D new GeometryFactory();

ds.createSchema( featureType );

// Here I got lost. Started to investigate FeatureType and felt=20
like I was walking through tar.

I did some stuff with FeatureType the other day... trying to create

a new Feature from scratch. Here is the code I found to create a=20
new
FeatureType:
                    AttributeType geomAttr =3D
AttributeTypeFactory.newAttributeType("the_geom", LineString.class);
                    FeatureType ftRoad =3D
FeatureTypeBuilder.newFeatureType(new AttributeType[] {geomAttr},=20
"road");

    //                WKTReader wktReader =3D new WKTReader();
    //                Point geometry =3D (Point) wktReader.read=20
("POINT
(" + lat + " " + lon + ")");
                    GeometryFactory geomFactory =3D new
GeometryFactory();
                    LineString geometry =3D
geomFactory.createLineString(coords);
                    Feature theRoad =3D ftRoad.create(new Object[]=20
{geometry}, "myRoad");


This example Feature only has one attribute which is the geometry,=20
the_geom. You can create and add other attributes in the=20
AttributType[] and Object[] if needed.

These classes are from the org.geotools.feature package.

Hopefully you may find this useful. I'm not sure if this is the
most

up-to-date way of doing it, but it worked for me.

Mark

--
This message has been scanned for viruses and dangerous content by
*MailScanner* <http://www.mailscanner.info/>, and is believed to be

clean. _______________________________________________
User-friendly Desktop Internet GIS (uDig)=20
http://udig.refractions.net=20
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=20
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


Back to the top