Create a shapefile using Java Mapscript

Libo Feng bobbyfung at HOTMAIL.COM
Thu Apr 21 08:43:36 EDT 2005


I am a newbie to Java mapscript and in my project, I need to dynamically
create a shape file that contains a point. The coordinate of that point is
from an address matching web service. I am able to create the .shp, .shx
files with the mapscript and a .dbf file with Javadbf. But the .shp and .shx
seem to be empty - when I open it with ArcExplorer, there is no point at all.

The following is the code:

shapefileObj civicAddressShp = new shapefileObj(shapeFile,
                                    mapscriptConstants.MS_SHAPEFILE_POINT);
pointObj addressPoint = new pointObj(x, y, 0.0, Double.MIN_VALUE);
civicAddressShp.addPoint(addressPoint);


Did I miss anything? Thanks!



More information about the mapserver-users mailing list