[geotk] début, installation
johann sorel
johann.sorel at geomatys.fr
Fri Apr 16 10:13:36 EDT 2010
The code you have written seems correct.
(don't write the request parameter in the server url,
http://localhost/cgi-bin/mapserv.exe?map=toto&
<http://localhost/cgi-bin/mapserv.exe?map=toto&REQUEST=getcapabilities>)
I think the problem comes from missing jars or uncorrectly imported, in
any case it really looks like an IDE project problem. Unfortunately for
you I'm on netbeans so I won't be of much help on eclipse.
TIP 4 : I am not sure that Mapserver is correctly using the
CordinateReferenceSystem. I mean using Lat/long or Long/Lat axis order
in EPSG:4326 WMS1.1.1 and 1.3.0.
Since geotoolkit uses the real EPSG:4326 as defined in EPSG, that is
Latitude/Longitude and Proj4 uses Long/Lat you might obtain a rotated
image. If it happens you can use CRS:84 or use the methods on
WMSMapLayer setCrs84Politic(...) and setEpsg4326Politic(...)
Didier CREST a écrit :
> Hello,
>
> I tried to used the example of M.Sorel but Eclipse says that the
> constructor of WebMapServer(URL, WMSVersion) is not defined. But I saw
> in the library and the Constructor is in. So I don't understand why it
> doesn't work.
>
>
> package wms;
>
> import java.net.URL;
>
> import org.geotoolkit.gui.swing.go2.JMap2DFrame;
> import org.geotoolkit.map.MapBuilder;
> import org.geotoolkit.map.MapContext;
> import org.geotoolkit.referencing.crs.DefaultGeographicCRS;
> import org.geotoolkit.wms.WebMapServer;
> import org.geotoolkit.wms.map.WMSMapLayer;
> import org.geotoolkit.wms.xml.WMSVersion;
>
> public class TWMS {
>
>
> public static void main(String[] args) {
>
> MapContext lMapContext =
> MapBuilder.createContext(DefaultGeographicCRS.WGS84);
> URL serverURL = new
> URL("http://localhost/cgi-bin/mapserv.exe?map=toto&REQUEST=getcapabilities
> <http://localhost/cgi-bin/mapserv.exe?map=toto&REQUEST=getcapabilities>");
>
> //Error on this line the constructor is not defined
>
> WebMapServer lWMS = WebMapServer(serverURL, WMSVersion.v111);
> //FeatureTypeBuilder lFeature = new FeatureTypeBuilder();
> WMSMapLayer lWmsMapLayer = new WMSMapLayer(lWMS, "sr57_depare");
> lMapContext.layers().add(lWmsMapLayer);
>
> JMap2DFrame.show(lMapContext);
>
>
> }
> }
>
>
> Sorry for my English and thanks to help me.
>
> Toshy
More information about the Geotoolkit
mailing list