[geotk] début, installation

johann sorel johann.sorel at geomatys.fr
Thu Apr 15 09:10:36 EDT 2010


Hello,

I dont have the geotoolkit code in front of me (holidays) so the 
following guide might be a bit abstract but should help you.

Every default map objects are created by using the MapBuilder utility class.
MapContext context =  MapBuilder.createContext(DefaultGeographicCRS.WGS84);
The coordinate reference system provided here will only be used when you 
call getEnvelope
on the context, it is not used at rendering time.

The SimpleFeatureTypeBuilder doesn't exist anymore in the latest code, 
it's replaced by FeatureTypeBuilder.


To add a WMS layer you must first create a server :
WebMapServer wmsServer = WebMapServer(serverURL,version)
Then a layer :
WMSMapLayer wmsLayer = new WMSMapLayer(wmsServer, "layerName");

Add it in the MapContext and that's it.
context.layers().add(wmsLayer);

TIP 1 : to quickly verify a MapContext, you can use 
JMap2DFrame.show(context);
This will display a complete frame, with several map tools, tree, style 
editor ... and so on.
TIP 2 : to render mapcontext as an image use the class 
DefaultPortrayalService
http://pending.geotoolkit.org/apidocs/org/geotoolkit/display2d/service/DefaultPortrayalService.html
TIP 3 : the swing map widget class is JMap2D .


We currently don't have much tutorial nor javadoc in geotk-pending so if 
you have ideas for tutorial
feel free to send them on the mailing list.

johann sorel (in holidays)



Martin Desruisseaux a écrit :
> Hello Didier, and welcome!
>
> Since the Geotoolkit project tries to reach an international user 
> bases, the mails need to be in English. No worry, I will summarize 
> your question.
>
> In short, Didier downloaded geotk-bundle.pack.gz, unpacked it and have 
> been able to run the Plot2D widget, but not the more elaborated 
> widgets based on MapContext, SingleFeatureTypeBuilder, etc.
>
> This is normal since geotk-bundle.pack.gz contains only the stable 
> part of Geotk. The MapContext and other classes live in the pending 
> part for now. You can download a bundle which contains everything 
> (both the stable and pending parts with all there dependencies) there:
>
>     http://hudson.geomatys.com/job/Geotoolkit-pending/
>
> This remind me that I need to provide a link on the Geotk web page...
>
> The second question that Didier asks is: is it possible to use data 
> from a WMS server with Geotk? The answer is yes, using the 
> geotk-client-wms module (included in the above-cited pack). However in 
> order to get an example about how to use them, we need to hope that 
> Johan Sorel read his email during his holiday :) (he is in holiday 
> right now).
>
> A third issue raised by Didier is that the demo applet don't work in 
> his browser. This is a know issue that I need to fix; things are made 
> more difficult by the fact that I'm developing on a Mac platform, and 
> applet behavior seems to change more than standard Java applications 
> between browsers.
>
>     Regards,
>
>         Martin
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit
>



More information about the Geotoolkit mailing list