Hi,
I’ve got another problem…
i’ve create my shapefile with the following code
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.feature.FeatureTypeFactory;
import org.geotools.feature.FeatureType;
import org.geotools.feature.AttributeTypeFactory;
import org.geotools.data.FeatureWriter;
import org.geotools.data.Transaction;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.PrecisionModel;
import java.net.URL;
public class Test {
public Test() {
}
public static void main(String args) {
try {
URL shpfile = new URL(“file:D:/Documents/W3T2004/W3T2004OpenSource/shapefile/test2”);
ShapefileDataStore store = new ShapefileDataStore(shpfile);
FeatureTypeFactory factory = FeatureTypeFactory.newInstance(“point”);
factory.addType(AttributeTypeFactory.newAttributeType(“Shape”,Geometry.class));
factory.addType(AttributeTypeFactory.newAttributeType(“id”,Integer.class));
FeatureType type = factory.getFeatureType();
store.createSchema(type);
FeatureWriter fw = store.getFeatureWriter(store.getTypeNames()[0],
Transaction.AUTO_COMMIT);
double x1 = -117.7;
double y1 = 34.8;
double x2 = -117.71;
double y2 = 34.81;
fw.next().setAttributes(new Object{
new Point(new Coordinate(x1,y1), new PrecisionModel(),4326),
new Integer(0)
});
fw.write();
fw.next().setAttributes(new Object{
new Point(new Coordinate(x2,y2), new PrecisionModel(),4326),
new Integer(1)
});
fw.write();
fw.close();
}
catch (Exception e) {
System.out.println(e);
}
}
}
when i want to see this shapefile nothing appear!!!
i type the following url
http://localhost:8080/geoserver/wms?request=GetMap&layers=W3T2004Test:test2&bbox=-117.8,34.7,-117.649384,34.82315&width=400&height=200&srs=EPSG:4326&styles=&Format=image/jpeg
Must I create a style file to see the points?
Thanks for your help
morgane
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail
Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. Téléchargez GRATUITEMENT ici !