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>
<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>
<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>
<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
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
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
------------------------------------------------------------------------------ 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