Tomas,
please check that you are using the same GML version everywhere in your
schema, your mapping, and that your WFS output format produces the same
GML version.
Mismatches between GML versions can cause strange problems in encoded
output because GeoServer will make a "best effort" attempt to encode
Java objects to XML even when they do not make sense. For example, if
you have a GML 3.1.1 application schema and request WFS 2.0 output with
the default output format (GML 3.2.1), some elements may be missing
because the geometry types for GML 3.1.1 and GML 3.2.1 are in different
namespaces and the encoder configuration for GML 3.2.1 lacks bindings
for GML 3.1.1 objects. GeoServer tries hard and encodes things like
xs:string that are present in both but cannot encode types with no
binding. It never makes sense to mix GML versions. See:
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html
What is the GML version of your application schema and mapping? (I guess
3.1.1 because of your use of _Feature).
What WFS version did you use to make the failing request? Use WFS 1.1.0
(which defaults to GML 3.1.1 output) or WFS 2.0.0 with outputFormat=GML3
to obtain GML 3.1.1 output.
Kind regards,
Ben.
On 22/11/17 21:31, Tomas L. wrote:
Hi, im so sorry, but everything enclosed in tag <raw></raw> disappeared :-(
@Ben Caradoc-Davies: Simple feature works correctly, postgis column is lowercase
('singlegeom'), but view is 'camel'.
In geometry_column i can see:
"f_table_name" = geoCoordinateWithSrid
"f_geometry_column" = singlegeom
"coord_dimension" = 2
"srid" = 3857
"type" = POINT
Here is content of files, which was not visible in my first mail:
schema.xsd:
<xs:element name="AddressCoordinate" type="ct:AddressCoordinateType"
substitutionGroup="gml:_Feature" />
<xs:complexType name="AddressCoordinateType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="AddressId" type="xs:string" />
<xs:element name="Geom" type="gml:PointPropertyType"
maxOccurs="1" minOccurs="0" nillable="true" />
<!--<xs:element name="Geom" type="gml:MultiPointPropertyType"
maxOccurs="1" minOccurs="0" nillable="true" />-->
<!--<xs:element name="Geom" type="gml:GeometryPropertyType"
maxOccurs="1" minOccurs="0" nillable="true" />-->
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
App schema mapping is defined as:
<targetTypes>
<FeatureType>
<schemaUri>source.xsd</schemaUri>
</FeatureType>
</targetTypes>
<typeMappings>
<FeatureTypeMapping>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>geoCoordinateWithSrid</sourceType>
<targetElement>ct:AddressCoordinate</targetElement>
<attributeMappings>
<AttributeMapping>
<targetAttribute>ct:AddressId</targetAttribute>
<sourceExpression>
<OCQL>AddressId</OCQL>
</sourceExpression>
<encodeIfEmpty>true</encodeIfEmpty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>ct:Geom</targetAttribute>
<sourceExpression>
<OCQL>singlegeom</OCQL>
</sourceExpression>
<encodeIfEmpty>true</encodeIfEmpty>
</AttributeMapping>
</attributeMappings>
</FeatureTypeMapping>
</typeMappings>
But when a call WFS service, there is empty Geom element in the result:
<ct:AddressCoordinate
gml:id="geoCoordinateWithSrid.fid-1919b616_15fe079d669_-7ff9">
<ct:AddressId>f0e307f0-2e76-4172-8f20-a6e70c99943b</ct:AddressId>
<ct:Geom/>
</ct:AddressCoordinate>
Thanks a lot,
Tomas
*Sent:* Wednesday, November 22, 2017 at 2:39 AM
*From:* "Ben Caradoc-Davies" <b...@transient.nz>
*To:* geseus <ges...@email.com>, geoserver-users@lists.sourceforge.net
*Subject:* Re: [Geoserver-users] Mapping PostGis geometry to app schema
Tomas,
I see no mapping or database schema in your email (no images or text).
postgis geometry types are supported in app-schema the same as for
simple features.
Your postgis column name must be lowercase in the app-schema mapping file.
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#database-identifiers
Are you able to publish the source view as a GeoTools simple feature
type? Did you remember to register the column type in geometry_columns
in the postgis database?
http://docs.geoserver.org/latest/en/user/data/database/postgis.html#publishing-a-postgis-view
Kind regards,
Ben.
On 22/11/17 10:45, geseus wrote:
> Hi,
> is it possible to use geometry type from PostGis in app schema?
>
> I have view in postgre db:
>
>
> Then i have schema:
>
>
>
> App schema mapping is defined as:
>
>
>
> But when a call WFS service, there is empty Geom element in the result:
>
>
> So, how can i map postGis geometry type to element in app schema?
>
> Thanks a lot,
> Tomas
>
>
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html
>
>
------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to this
list:
> - Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand
--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users