Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [udig-devel] Difficulty with raster images using World Image Files

Hi!

I have been looking through the 'Styled Layer Descriptor Implementation
Specification'.
I have been trying to understand how I would write my SLDs for
specifying the icon to use for my points on a given layer.

As far as I can tell, it only allows you to point at graphics on the
web.
Is there anyway I can store the image file information in the shapefile
itself for the layer and have the SLD know the image for the current
layer from the shape file?

I do not know if this is possible, but I just wanted on SLD that said,
get the image from the current shapefile and use it for all points on
this layer.

Or am I getting different concepts in a muddle?

Michelle



-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jody
Garnett
Sent: 10 March 2006 12:06
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Difficulty with raster images using World
Image Files


M.S.Bachler wrote:
> You wrote:
>  
> "Another possibility is to create a point shapefile and one of the
> attributes can be a URL to an image.
> The style you can define for the layer can simply display that icon at

> the location of the point."
>  
> I think this is the way I need to go.
> Bearing in mind I am not up to speed with uDig and GIS, this is what I
> believe I need to achieve and the associated question I have (some of 
> which may be silly).
I will try for some off the cuff answers as I install maven and wait for

a geotools build ;-)
> I need to create layers pointing to local shape files, which each will
> display one type of icon.
> So they can turn the layers on an off. Display all the fish, then all 
> the huts etc.
> Q: Can one shapefile hold information about more than one icon/point? 
> (I am sure it can - I just what to be certain)
Well lets think, you could define your shapefile as follows: NAME -
incase you want to label it? ICON - url for the icon POINT - position of
the icon

To render this you can construct a SLD file (by hand):
- that uses the UDIG Icon url example, and replaces the external graphic

URL with a reference to your ICON attribute 
- that draws a label w/ the name, etc...

This would be a good solution for displaying photographs on a map.

If the SLD specification cannot do this you can instead arrange: NAME -
incase you want to label it? TYPE - some magic string indicating type
POINT - position of the icon

And your sld will:
- consist of a series of rules, and each rule will describe an 
ExternalGraphic for TYPE equals "CAMPSITE")....

This would be a good solution for displaying custom symbols on a map.

Then to manage your shapefile you could do one of the following:
- make a drag and drop extension that grabs a PNG/GIF dropped on the map

and adds a new feature in that position
- make a view with your symbols on it and use DND as above
- use the existing feature creation tools to add new points, and define 
a custom feature editor with a browse button that lets users locate the 
PNG/GIF
> As they drag an icon from the palette, I need to determine if I have a
> layer already for that type of icon.
> I was hoping to use the layer name = icon name.
> Q: Is the layer name stored in the shape file, i.e. is it persistent?
I see so with that idea you have a shapefile of NAME,POINT and the SLD 
for that layer renderers the points with a specific external graphic. As
for the DnD action you can do whatever you need to, you may wish to 
ensure that the map has all the correct types before allowing your tool 
to function. Or only "enabled" DnD for types that have defined layers?
> If there is already a layer displaying say huts, I need to create a
> new point displaying the hut icon dropped else I need to create a new 
> layer and add the icon to that.
> Q: Is it possible to add a right-click menu to an icon on a layer (I 
> guess to a point object - though I am still fuzzie about this a
present)?
Yes, that is the opperations API, you get to say what object you want 
your opperation to work against and then it will show up in right click 
menus anywhere that object appears.  So if you did it based on 
FeatureType your opperations would occur in Layers and in the Catalog. 
If you did it based on a Layer then it would show up only on layers.... 
> I need to be able to associated a point icon with a Compendium map (an
> external application).
> I am going to use sockets to achieve this.
> Q: What information do I need to store in Compendium for it to be able

> to request uDig to open a specific project, map and layer to link it 
> back to a specific icon on a map? Is it just the .umap file and a 
> layer ID of some kind? If so, how do I programmatically find out what 
> the current .umap file is?, and how do I use that later to re-open 
> that map?
Hrm - better let Jesse answer this one.
> Extra: They have not asked for this yet, but I am guessing that they
> may expect to be able to drag the icons around the map to relocate
them.
> Q: Is this currently possible. If not, is this as simple as adding a 
> drag/drop event to an object somewhere, or are we talking really 
> complicated?
That would just be normal feature editing, the "move point" tool.
> Sorry about all the questions. After a sleepless night worrying, I am
> trying to crystalize what I need to achieve, and some of the questions

> I have at this stage.
Ack, get some sleep. If you need to talk on IRC we can try and set 
something up, and if you need help that is not based on volunteer time 
you can talk to refractions more formally.
> Thanks for your patients with me so far.
It is all good, indeed we need more questions so we know what to
document. Jody

_______________________________________________
User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top