Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Setting a CRS for a layer or for the whole map

Hi,
How can I set the projection of a layer at creation? How ca I set the projection for the whole map? Is there any better solution?
Judging by the error I get,it seems that when a layer is added to a map it is not automatically converted to a common crs.
In my particular case I have modified preferredzoomlevels tutorial so that I may see a postgis layer and a wmt layer (openstreetmaps) instead of a shp .


The error I get when I try to “zoom to area of interest” :
!ENTRY net.refractions.udig.project 1 0 2012-06-15 14:08:53.086
!MESSAGE Show All failed to run
!STACK 0
org.opengis.geometry.MismatchedReferenceSystemException: The coordinate reference system must be the same for all objects.
at org.geotools.geometry.jts.ReferencedEnvelope.ensureCompatibleReferenceSystem(ReferencedEnvelope.java:305)
at org.geotools.geometry.jts.ReferencedEnvelope.expandToInclude(ReferencedEnvelope.java:545)
at net.refractions.udig.project.internal.render.impl.ViewportModelImpl.zoomToExtent(ViewportModelImpl.java:787)
at net.refractions.udig.project.internal.command.navigation.ZoomExtentCommand.runImpl(ZoomExtentCommand.java:35)
at net.refractions.udig.project.internal.command.navigation.AbstractNavCommand.run(AbstractNavCommand.java:72)
at net.refractions.udig.project.command.CommandManager$Executor.execute(CommandManager.java:400)
at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:325)
at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:311)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Thanks guys


Back to the top