Re: [Geoserver-users] Feature chaining / app-schema

2019-10-14 Thread Nuno Oliveira
Hi,
The structured produced by App-Schema is dictated by the target GML
schema, the pattern you see:
> 
>  I understand that it is a valid xsd file, but it is possible to include
> some
> better description of elements?
Describe feature type for complex features will reference whatever XSD
schema you declared on the App-Schema mappings file.
That say, those declared schema should use a valid URL, for example:
> http://www.w3.org/2001/XMLSchema";
> xmlns:lge="http://test/lge";
> xmlns:ptv="http://palvelutietovaranto.suomi.fi/ptv";
> elementFormDefault="qualified" targetNamespace="http://test/lge";>
> 
> schemaLocation="file:/D:/geoServer/2.15.2/data_dir/workspaces/lge/xsd/s
> chema.xsd"/>
> 
... unless the invoker has the schema in file:/D:/geoServer/2.15.2/data
_dir/workspaces/lge/xsd/schema.xsd that's not a valid XSD schema :)
Regarding:

> GetFeature has problem with geometry type, the element is empty:
You probably need to define the default geometry explicitly [2], check
the defaultGeometry option.
Hope it helps,
Nuno Oliveira
[1] http://portal.opengeospatial.org/files/?artifact_id=20509
[2] https://docs.geoserver.org/stable/en/user/data/app-schema/mapping-f
ile.html#typemappings-and-featuretypemapping
On Sun, 2019-10-06 at 13:12 -0700, lge.geo wrote:
> Hi, I'm trying to create a "app-schema" layer, but have some unclear issues. 
> 
> As a data source I'm using Postgre, where I have defined three tables:
> "Service" ("Id" uuid, "Code" text);
> "ServiceAddress" ("Id" uuid, "ServiceId" uuid, "streetAddress" text,
> "Location" geometry(POINT, 4326));
> "ServiceDescription" ("Id" uuid, "ServiceId" uuid, "languageCode" text,
> "Description" text);
> 
> I have a data source "serviceDescription", mapping is defined:
> 
> 
> datastore
> ServiceDescription
> lge:serviceDescription
> true
> 
> 
> lge:serviceDescription
> Id
> 
> 
> lge:description
> 
> Description
> 
> 
> languageCode
> LanguageCode
> 
> true
> 
> 
> FEATURE_LINK
> 
> ServiceId
> 
> 
> 
> 
> 
> Then i have data source "service", where is defined chaining to
> "serviceDescription":
> 
> 
> datastore
> viewService
> lge:service
> true
> 
> 
> lge:service
> ServiceId
> 
> 
> lge:code
> 
> Code
> 
> true
> 
> 
> lge:address
> 
> StreetAddress
> 
> true
> 
> 
>
> lge:descriptions/lge:description
>  
> ServiceId
> lge:serviceDescription
> FEATURE_LINK
> 
> true
> 
> 
> lge:location4326
> 
> Location4326
> 
>  true
> 
> 
> 
> 
> Test call of GetFeature works fine, result is like:
> 
> 
> service2
> s2 - street address
> 
> 
>  gml:id="479d6a3d-1e9f-4eaf-bb44-ea08bb770998">
> service 2 - description
> in cz
> 
> 
> 
>  gml:id="dd914bb0-007e-4fea-a337-ff23d078d793">
> service 2 - description
> in de
> 
> 
> 
>  gml:id="e6294093-b140-4d42-a800-6eda02b7db8a">
> service 2 - description
> in en
> 
> 
> 
> 
>  srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
> ">
> 50.0413 14.4275
> 
> 
> 
> ...
> 
> BUT .. Is it possible to simplify the result somehow, eg. to reduce element
> , so nesting of description would be "easier":
> 
> 
> 
> service 2 - description in
> cz
> 
> 
> 
> service 2 - description in
> de
>  
> ...
> 
> Or even better (since glm:ids are not important for me, but i do understand
> that it will not work without a linking field):
> 
> 
> service 2 - description in
> cz
> service 2 - description in
> de
> ...
> 
> Another question is related to DescribeFeatureType. The request returns
> just:
> 
> http://www.w3.org/2001/XMLSchema";
> "
> xmlns:lge="http://test/lge";
> "
> xmlns:ptv="http://palvelutietovaranto.suomi.fi/ptv";
> "
> elementFormDefault="qualified" targetNamespace="http://test/lge";>
> ">
>  
> schemaLocation="file:/D:/geoServer/2.15.2/data_dir/workspaces/lge/xsd/schema.xsd"/>
> 
> 
> I understand that it is a valid xsd file, but it is possible to include some
> better description of elements?
> 
> I found some Schema customization approach, but I do not know if it is
> possible to use it for app-schema.
> When I add the schema.xsd file to layer folder, the DescribeFeatureType
> retu

[Geoserver-users] Feature chaining / app-schema

2019-10-06 Thread lge.geo
Hi, I'm trying to create a "app-schema" layer, but have some unclear issues. 

As a data source I'm using Postgre, where I have defined three tables:
"Service" ("Id" uuid, "Code" text);
"ServiceAddress" ("Id" uuid, "ServiceId" uuid, "streetAddress" text,
"Location" geometry(POINT, 4326));
"ServiceDescription" ("Id" uuid, "ServiceId" uuid, "languageCode" text,
"Description" text);

I have a data source "serviceDescription", mapping is defined:


datastore
ServiceDescription
lge:serviceDescription
true


lge:serviceDescription
Id


lge:description

Description


languageCode
LanguageCode

true


FEATURE_LINK

ServiceId





Then i have data source "service", where is defined chaining to
"serviceDescription":


datastore
viewService
lge:service
true


lge:service
ServiceId


lge:code

Code

true


lge:address

StreetAddress

true


   
lge:descriptions/lge:description
 
ServiceId
lge:serviceDescription
FEATURE_LINK

true


lge:location4326

Location4326

 true




Test call of GetFeature works fine, result is like:


service2
s2 - street address



service 2 - description
in cz




service 2 - description
in de




service 2 - description
in en




http://www.opengis.net/gml/srs/epsg.xml#4326";>
50.0413 14.4275



...

BUT .. Is it possible to simplify the result somehow, eg. to reduce element
, so nesting of description would be "easier":



service 2 - description in
cz



service 2 - description in
de
 
...

Or even better (since glm:ids are not important for me, but i do understand
that it will not work without a linking field):


service 2 - description in
cz
service 2 - description in
de
...

Another question is related to DescribeFeatureType. The request returns
just:

http://www.w3.org/2001/XMLSchema";
xmlns:lge="http://test/lge";
xmlns:ptv="http://palvelutietovaranto.suomi.fi/ptv";
elementFormDefault="qualified" targetNamespace="http://test/lge";>



I understand that it is a valid xsd file, but it is possible to include some
better description of elements?

I found some Schema customization approach, but I do not know if it is
possible to use it for app-schema.
When I add the schema.xsd file to layer folder, the DescribeFeatureType
returns better "explanation" of type, but there is used some substitution,
and gml mapping does not work correctly:

DescribeFeatureType header:

http://www.w3.org/2001/XMLSchema"; 
xmlns:Q1="http://www.opengis.net/gml";   <--- WHY Q1, not gml
?? 
xmlns:lge="http://test/lge"; 
elementFormDefault="qualified" 
targetNamespace="http://test/lge";>  

GetFeature has problem with geometry type, the element is empty:


<- Q1 instead of gml namespace ??
service2
s2 - street address

 <--- this element is empty



Since I have no real experiences with GeoServer and app-schema I really
appreciate each advice, how to work with it.

I'm trying to upload all needed files, so i hope it will work.
lge.zip   

Thanks a lot, 
Lange 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html


___
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

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users