layeritems with java mapscript
Nicol Hermann
mapserver at GEOWORLD.DE
Tue Dec 14 01:24:01 PST 2004
Hi List,
i would like to detect the names of the attribut fields with java
mapscript. I tried the code below but i alway get back zero fields.
What i am doing wrong?
Thanks for any help
Nicol
package msjava;
import edu.umn.gis.mapscript.*;
public class layeritems {
public static void main(String[] args) {
System.loadLibrary("mapscript");
mapObj map = new
mapObj("/home/nicol/public_html/mapserver/dev/brd.map");
layerObj layer = map.getLayer(0);
System.out.println("Count of fields from layer "
+layer.getName()
+ " : " + layer.getNumitems());
for (int i =0; i < layer.getNumitems(); i++) {
System.out.println("Fieldname: " + layer.getItem(0));
}
}
}
More information about the MapServer-users
mailing list