Clarification on GML encoder use
--------------------------------
Key: GEOT-3605
URL: http://jira.codehaus.org/browse/GEOT-3605
Project: GeoTools
Issue Type: Bug
Components: core xml, doc
Reporter: Jody Garnett
>From email Rico Lelina writes:
-----
Hello,
I have a SimpleFeatureCollection whose SimpleFeatures have been created from a
custom GeoJSON decoder. Then I try to encode the collection into GML using the
following code:
{code}
GML encoder = new GML(GML.Version.WFS1_1);
encoder.encode(outputStream, featureCollection);
{code}
First, I found that if I do not set the namespace URI on the
SimpleFeatureTypeBuilder in my GeoJSON decoder to http://www.opengis.net/wfs,
the namespace on the properties in the encoded GML is null, e.g. (see last 2
line lines):
{code}
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ows="http://www.opengis.net/ows"
xmlns:wfs="http://www.opengis.net/wfs">
<gml:boundedBy>
<gml:Envelope>
<gml:lowerCorner>-124.1633 -34.3667</gml:lowerCorner>
<gml:upperCorner>57.7144 47.7528</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<wfs:MultiPoint gml:id="9c068ab0-b56c-40bb-8e33-b4507ed3547c">
<gml:name>Cape Town</gml:name>
<gml:boundedBy>
<gml:Envelope>
<gml:lowerCorner>18.4167 -33.9167</gml:lowerCorner>
<gml:upperCorner>18.4167 -33.9167</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<null:fillColor>#ee9900</null:fillColor>
<null:strokeColor>#000000<null:strokeColor>
etc.
{code}
So I changed my GeoJSON decoder to set the namespace URI on the builder to the
URI above. Now the properties are encoding with wfs:fillColor, wfs:strokeColor,
etc.
----
Second, I noticed that each gml:featureMember element has a gml:boundedBy
element even though there is only a single point geometry. Is this because the
geometry is actually a MultiPoint?
----
Third, during encoding I get these warning messages on the log. It may be
affecting performance when I'm encoding a huge number of features, and also I
think it should read "Could not find type..." Is there something I can do in
building the features to avoid these warning messages?
{panel}
May 19, 2011 10:23:45 AM org.geotools.gml2.bindings.GMLEncodingUtils
AbstractFeatureType_getProperties
WARNING: Could find type for Polygon in the schema, generating type from
feature.
May 19, 2011 10:23:45 AM org.geotools.gml2.bindings.GMLEncodingUtils
AbstractFeatureType_getProperties
WARNING: Could find type for MultiPoint in the schema, generating type from
feature.
{panel}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel