No subject
Mon Oct 7 05:54:23 PDT 2024
geometry pointer in the shape obj but i didn't get any further.
If there is anything else i can provide or if some testing is required i'd
be happy to help...
Thanks for your attention
----mapscript/java/examples/Query.java----cut-here--
import edu.umn.gis.mapscript.*;
public class Query {
public static void usage() {
System.err.println("Usage: Query {mapfile} {outfile}");
System.exit(-1);
}
public static void main(String[] args) {
if (args.length != 2) usage();
try
{
System.loadLibrary("mapscript");
}
catch(UnsatisfiedLinkError ule)
{
System.err.println(ule);
System.exit(-1);
}
mapObj map = new mapObj(args[0]);
map.getImagecolor().setRGB(153, 153, 204);
styleObj st = map.getLayer(1).getClass(0).getStyle(0);
st.getColor().setHex("#000000");
imageObj img = map.draw();
System.out.println("The map will be drawn to:"+args[1]);
layerObj layer = map.getLayerByName("POLYGON");
layer.setTemplate("dummy.template");
layer.queryByPoint(map,new pointObj(0.10,51.4,0),
mapscriptConstants.MS_MULTIPLE,-1);
resultCacheObj results = layer.getResults();
layer.open();
for (int i=0;i<results.getNumresults();i++) {
resultCacheMemberObj result = results.getResult(i);
//CRASH HAPPENS ON NEXT LINE
shapeObj feature = layer.getFeature(result.getShapeindex(),-1);
}
layer.close();
img.save(args[1], map);
}
}
-----End of Query.java----------
More information about the MapServer-users
mailing list