Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Reprojection problem?

The problem is: I'm programmatically adding a temporary layer that is used in combination with an own edit tool for user based modifications.

The MapEditor contains the CRS Dialog. Without modifications on the MapEditor the user can always change the CRS. Therefore I tested this behaviour and discovered that the temporary layer doesn't work properly.

Jürgen

Jesse Eichar schrieb:
This solution seems rather hacky to me. I think I need to understand better the problem. Let me rephrase:

So a new layer is created in WGS84. But the desired reference system is a different reference system? So changing the projection to XXX using the CRS Dialog changes the CRS on the layer but not the underlying resource. That is correct behaviour at the moment.

2 questions.

1. Is the situation, the layer is created accidently with the incorrect CRS and you wish to update the CRS so that it is correct. In this case (at least through the UI) the only solution is to re-create the feature type with the correct CRS 2. If the situation is that you are creating the FeatureType programmatically you have to choose the correct CRS when you create the FeatureType.



Ok that is what my understanding is from the emails. Please inform me where I am misunderstanding.

Jesse

On 22-Oct-08, at 4:58 PM, andrea antonello wrote:

I had this issue time ago and I solved it by creating a subtype:
http://jgrasstechtips.blogspot.com/2008/01/how-to-create-temporary-layer-with.html

Hope that helps,
Andrea


On Wed, Oct 22, 2008 at 4:35 PM, Jürgen Jacob <zoid.berg@xxxxxx> wrote:
I'm using several temporary resources in my application. These temporary
layers are created on a Map with CRS = WGS84.

Objects in my layers are Features on lat/lon and the edit tools are working.

Then I change the CRS to e.g. WGS84 47N using the Coordinate Systems dialog. Using an edit tool again, example polygon tool for creating a new polygon
results in this exception:

org.geotools.referencing.operation.projection.PointOutsideEnvelopeException:
Longitude 1425336°19.9'W is out of range (±180°).
      at
org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:621)
      at
org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:678)
      at org.geotools.geometry.jts.JTS.xform(JTS.java:274)
      at org.geotools.geometry.jts.JTS.transform(JTS.java:168)
      at
org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:230)
      at
net.refractions.udig.project.internal.impl.LayerImpl.getBounds(LayerImpl.java:2008)
      at
net.refractions.udig.render.internal.feature.basic.BasicFeatureRenderer.validateBounds(BasicFeatureRenderer.java:407)
      at
net.refractions.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:229)
      at
net.refractions.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:199)
      at
net.refractions.udig.project.internal.render.impl.RenderJob.startRendering(RenderJob.java:103)
      at
net.refractions.udig.project.internal.render.impl.RenderJob.run(RenderJob.java:203)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



I checked my code and found

featureBuilder.addType(AttributeTypeFactory.newAttributeType(GEOMETRY_IDENTIFIER,
myGeometry, true, Integer.MAX_VALUE, null,DefaultGeographicCRS.WGS84));

I replaced DefaultGeographicCRS.WGS84 with null but the problem still
exists.

Can someone explain me this behaviour? Is it not possible to change the CRS
on temporary layers?

Thank you, Jürgen


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel




Back to the top