[OpenLayers-Dev] projection on geometry

Tim Schaub tschaub at opengeo.org
Wed Nov 12 02:39:24 EST 2008


Hey-

bartvde at osgis.nl wrote:
> Hey Tim,
> 
> are you saying that when a projection is set on a Polygon, it will be set
> on all the LinearRings as well? Is this really necessary? Or maybe I've
> misunderstood your approach ....

I could have been over thinking it.  Since geometry.components is an API 
property, I have no idea when people are grabbing points from polygons 
(for example).  I was also sort of thinking it might come in to play 
when writing with a format - but now don't think that is a real issue 
either.

So, maybe we just say if you are tearing apart geometries, you are 
responsible for setting the projection property.

Tim

> 
> To me it seems unlikely we will have a collection of geometries with
> different projections.
> 
> Best regards,
> Bart
> 
>> Hey-
>>
>> Picking up on the thread that Bart just referenced:
>> http://www.mail-archive.com/dev@openlayers.org/msg02523.html
>>
>> I agree, we should keep track of projection at the geometry level.
>>
>> There are plenty of times that you have a geometry without a feature or
>> a layer, and you want to maintain the srs info for that geometry.
>>
>> I've always thought this change would come with 3.0.  But it probably
>> makes sense to start working it in to see how things go.
>>
>> Seems to me like we need a setter and getter.  So the following would
>> work:
>>
>> polygon.setProjection(foo);
>> polygon.components[0].components[0].getProjection(); // foo
>>
>> And it makes sense to me to push the work on to the setter (setting the
>> same on all components), making access less work.
>>
>> I think it also makes sense to me that the layer does not set the
>> geometry projection.  We assume that geometry projection is properly set
>> before a feature is added to a layer.  This pushes the setting or
>> transforming closer to the parsing (where it makes sense that you'd know
>> the projection).
>>
>> In some cases, a format would do the transform (assuming
>> internal/externalProjection are set).  In other cases, a strategy could
>> do the transform (since it knows the map projection and the layer
>> projection - where the layer projection should be set to match the
>> source).
>>
>> I'm sure there's lots more to talk about.  This is what a sprint is good
>> for.  Without that, it probably makes sense to get some code going and
>> see where it takes us.  To this end, I've created a new sandbox [1].  I
>> won't have any time for a bit to work on it, but I'll be happy to comment.
>>
>> Tim
>>
>> [1] http://svn.openlayers.org/sandbox/projection
>>
>>
>> --
>> Tim Schaub
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>
> 
> 


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list