FOSS4G 2009 code sprint: geometry transformations

5 messages Options
Embed this post
Permalink
aaime

FOSS4G 2009 code sprint: geometry transformations

Reply Threaded More More options
Print post
Permalink
Hi,
during the first day of code sprint at FOSS4G 2009
I sat down with Jody to discuss the idea of geometry
transformations in SLD, and then worked towards a sample
implementation.

At the end of the first day we had a working patch that
could draw buffered geometries starting with plain lines
by just wrapping the Symbolizer geometry reference
into a filter function. During the following days we
improve the patch a little more and fleshed out better
when and how the transformations can be applied

I've put toghether a patch and a wiki page to explain it:
http://docs.codehaus.org/display/GEOTOOLS/Geometry+transformations+in+SLD

My dream would be to finish the job, commit to trunk
and backport to 2.6.x.
The backport is disputable thought, as the patch requires
changes to the GeoTools symbolizer interfaces. At the same time,
the functionality provided breaks new interesting grounds
and, afaik, we're the only implementors of the Symbolizer
interfaces anyways.

Feedback appreciated

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: FOSS4G 2009 code sprint: geometry transformations

Reply Threaded More More options
Print post
Permalink
This isn't the most profound feedback Andrea, but I just wanted to say
it looks very cool !

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: FOSS4G 2009 code sprint: geometry transformations

Reply Threaded More More options
Print post
Permalink
In reply to this post by aaime
The back port is okay; the StyleFactory interface was set up with this  
"extension" in mind. Indeed I was trying to contact you about this one  
as 2.6.0 was going out ...

Jody

On 06/11/2009, at 9:35 PM, andrea aime wrote:

> Hi,
> during the first day of code sprint at FOSS4G 2009
> I sat down with Jody to discuss the idea of geometry
> transformations in SLD, and then worked towards a sample
> implementation.
>
> At the end of the first day we had a working patch that
> could draw buffered geometries starting with plain lines
> by just wrapping the Symbolizer geometry reference
> into a filter function. During the following days we
> improve the patch a little more and fleshed out better
> when and how the transformations can be applied
>
> I've put toghether a patch and a wiki page to explain it:
> http://docs.codehaus.org/display/GEOTOOLS/Geometry+transformations+in+SLD
>
> My dream would be to finish the job, commit to trunk
> and backport to 2.6.x.
> The backport is disputable thought, as the patch requires
> changes to the GeoTools symbolizer interfaces. At the same time,
> the functionality provided breaks new interesting grounds
> and, afaik, we're the only implementors of the Symbolizer
> interfaces anyways.
>
> Feedback appreciated
>
> Cheers
> Andrea
>
> --
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Geotools-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Justin Deoliveira

Re: FOSS4G 2009 code sprint: geometry transformations

Reply Threaded More More options
Print post
Permalink
Can you be more specific about what exactly kind of api has to change? I
think any additions are fine sicne I can't really see those interfaces
being implemented by client code. But any other changes would seem
strange after 2.6.0 has already been released.

Jody Garnett wrote:

> The back port is okay; the StyleFactory interface was set up with this  
> "extension" in mind. Indeed I was trying to contact you about this one  
> as 2.6.0 was going out ...
>
> Jody
>
> On 06/11/2009, at 9:35 PM, andrea aime wrote:
>
>> Hi,
>> during the first day of code sprint at FOSS4G 2009
>> I sat down with Jody to discuss the idea of geometry
>> transformations in SLD, and then worked towards a sample
>> implementation.
>>
>> At the end of the first day we had a working patch that
>> could draw buffered geometries starting with plain lines
>> by just wrapping the Symbolizer geometry reference
>> into a filter function. During the following days we
>> improve the patch a little more and fleshed out better
>> when and how the transformations can be applied
>>
>> I've put toghether a patch and a wiki page to explain it:
>> http://docs.codehaus.org/display/GEOTOOLS/Geometry+transformations+in+SLD
>>
>> My dream would be to finish the job, commit to trunk
>> and backport to 2.6.x.
>> The backport is disputable thought, as the patch requires
>> changes to the GeoTools symbolizer interfaces. At the same time,
>> the functionality provided breaks new interesting grounds
>> and, afaik, we're the only implementors of the Symbolizer
>> interfaces anyways.
>>
>> Feedback appreciated
>>
>> Cheers
>> Andrea
>>
>> --
>> Andrea Aime
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and  
>> focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Geotools-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Geotools-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
aaime

Re: FOSS4G 2009 code sprint: geometry transformations

Reply Threaded More More options
Print post
Permalink
Justin Deoliveira ha scritto:
> Can you be more specific about what exactly kind of api has to change? I
> think any additions are fine sicne I can't really see those interfaces
> being implemented by client code. But any other changes would seem
> strange after 2.6.0 has already been released.

It boils down to three changes:
- an override of the getGeometryPropertyName() in the GeoTools
   Symbolizer interface that explains it is actually a shortcut
   for the more general getGeometry() method (so, the override
   is there just for javadoc sake)
- the setGeometryPropertyName() that was defined in all sub-interfaces
   of gt2 Symbolizer was pushed up to Symbolizer
- two new methods, getGeometry() and setGeometry() have been added
   to allow dealing with a generic Expression instead of a String:

Index:
modules/library/api/src/main/java/org/geotools/styling/Symbolizer.java
===================================================================
---
modules/library/api/src/main/java/org/geotools/styling/Symbolizer.java
(revisione 34254)
+++
modules/library/api/src/main/java/org/geotools/styling/Symbolizer.java
(copia locale)
@@ -20,8 +20,11 @@
  import javax.measure.quantity.Length;
  import javax.measure.unit.Unit;

+import org.opengis.filter.expression.Expression;
+import org.opengis.filter.expression.PropertyName;


+
  /**
   * This is the parent interface of all Symbolizers.
   *
@@ -103,4 +106,42 @@
       */
      void setName( String name );

+    /**
+     * A shortcut to get the geometry property name in the case the
geometry
+     * expression is a PropertyName. In case the geometry expression is
null,
+     * and in the case the geometry expression is not a PropertyName, this
+     * method will return null.
+     */
+    String getGeometryPropertyName();
+
+    /**
+     * A shortcut to define the geometry expression as a {@link
PropertyName}
+     * Typically, features only have one geometry so, in general, the
need to
+     * select one is not required. Note: this moves a little away from
the SLD
+     * spec which provides an XPath reference to a Geometry object, but
does
+     * follow it in spirit.
+     */
+    void setGeometryPropertyName(String geometryPropertyName);
+
+    /**
+     * This defines the geometry to be used for styling.<br>
+     * The property is optional and if it is absent (null) then the
"default"
+     * geometry property of the feature should be used.<br>
+     * Typically, features only have one geometry so, in general, the
need to
+     * select one is not required.<br>
+     * The expression can also build a new geometry out of existing
attributes
+     * or transform an existing geometry. For geometry transformations that
+     * do change the geometry locations or that make up geometries out of
+     * non geometric attributes it is advised that the Expression
implements
+     * the SpatialTransformationFunction interface
+     */
+    Expression getGeometry();
+
+    /**
+     * Sets the expression used for styling. See {@link #getGeometry()}
for further
+     * details.
+     * @param geometry
+     */
+    void setGeometry(Expression geometry);
+
  }


Hope this helps

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel