[udig-devel] (no subject)
Jesse Eichar
jeichar at refractions.net
Mon Aug 13 08:49:55 PDT 2007
I don't remember for sure if there is a convenience method already
made for this. You can look at the FeatureUtils class for some
utility methods dealing with features. If not then the following
code snippet should help. (I haven't compiled it so forgive the typos)
Class type = layer.getSchema().getDefaultGeometry().getType();
Polygon.class.isAssignableFrom( type ) ||
MultiPolygon.class.isAssignableFrom(type)
Jesse
On Aug 13, 2007, at 4:39 AM, Andy Cox wrote:
> Hello,
>
>
>
> Does anyone know if there is an easy way to get a layers geometry
> type. I am trying to populate a list with the layers that are in
> the map but I only want to include the polygon layers. So far I have
>
>
>
> Map map = ApplicationGISInternal.getActiveMap();
>
>
>
> List<ILayer> layers = map.getMapLayers();
>
>
>
> ILayer layer;
>
>
>
> for (i=0; i<layers.size(); i++) {
>
>
>
> layer = (ILayer)layers.get(i);
>
>
>
> if (layer IS TYPE OF POLYGON OR MULTIPOLYOGON)) {
>
> layerList.add("" + layer.getName());
>
> }
>
> }
>
>
>
> Thanks
> Andy
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20070813/7f50c281/attachment.html
More information about the udig-devel
mailing list