From: <ch...@op...> - 2004-08-25 18:22:33
|
I forget how the code works exactly, try doing style=3Dnormal, that might work better. ----- Original Message ----- From: "morgane tison" <tis...@ya...> To: <geo...@li...> Sent: Wednesday, August 25, 2004 11:57 AM Subject: [Geoserver-users] nothing appears ... > 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 =3D new URL("file:D:/Documents/W3T2004/W3T2004OpenSource/shapefile/test2"); > ShapefileDataStore store =3D new ShapefileDataStore(shpfile); > > FeatureTypeFactory factory =3D FeatureTypeFactory.newInstance("point"); > =20 factory.addType(AttributeTypeFactory.newAttributeType("Shape",Geometry.cl= ass)); > =20 factory.addType(AttributeTypeFactory.newAttributeType("id",Integer.class)= ); > FeatureType type =3D factory.getFeatureType(); > > store.createSchema(type); > FeatureWriter fw =3D store.getFeatureWriter(store.getTypeNames()[0], > Transaction.AUTO_COMMIT); > double x1 =3D -117.7; > double y1 =3D 34.8; > > double x2 =3D -117.71; > double y2 =3D 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=3DGetMap&layers=3DW3T2004Test= :test2&bbox=3D-117.8,34.7,-117.649384,34.82315&width=3D400&height=3D200&s= rs=3DEPSG:4326&styles=3D&Format=3Dimage/jpeg > > > Must I create a style file to see the points? > > Thanks for your help > > morgane > > > --------------------------------- > Cr=E9ez gratuitement votre Yahoo! Mail avec 100 Mo de stockage ! > Cr=E9ez votre Yahoo! Mail > > Le nouveau Yahoo! Messenger est arriv=E9 ! D=E9couvrez toutes les nouveaut=E9s pour dialoguer instantan=E9ment avec vos amis.T=E9l=E9charge= z GRATUITEMENT ici ! ---------------------------------------------------------- This mail sent through IMP: https://webmail.limegroup.com/ |