Draw a shapefile in java -
i read shapefile in java , draw it. there anyway read shapefile , draw in java? know useful , easy framework?
thanks.
you can try geotools. can start code.
public class quickstart { public static void main(string[] args) throws exception { file file = jfiledatastorechooser.showopenfile("shp", null); if (file == null) { return; } filedatastore store = filedatastorefinder.getdatastore(file); simplefeaturesource featuresource = store.getfeaturesource(); // create map content , add our shapefile mapcontent map = new mapcontent(); map.settitle("quickstart"); style style = sld.createsimplestyle(featuresource.getschema()); layer layer = new featurelayer(featuresource, style); map.addlayer(layer); // display map jmapframe.showmap(map); } }
Comments
Post a Comment