Re: [Geoserver-users] WFS nesting

2017-11-02 Thread Ben Caradoc-Davies

Tomas,

to conform to the object-property pattern, in your schema introduce a 
property type that has, for example, an Email element (for simplicity I 
omit namespaces):








To name properties with this type and be able to reference it, add an 
element with this type:




Then, inside your definition of Person, reference the property element:



Now you should be able to use app-schema feature chaining to define a 
multivalued "email" property and encode Person/email/Email.


There are several concrete examples amongst the GML schemas. Search for 
"PropertyType".


Kind regards,
Ben.

On 03/11/17 10:15, Tomas L. wrote:

Hi, thanks a lot for reply ..
Would you please be so kind and show/explain me how to change the schemas?
Just now, i have mappings like this:
mapping file ct_email.xml takes data from table "Emails" and contains definition
of FEATURE_LINK:
..
datastore
Email
ct:Email
...

FEATURE_LINK
   
 PersonId
   

The same approach I have for web.
In mapping for person, I include both ct_email.xml and ct_web.xml, and define
mapping like:
datastore
Person
ct:Person
...

Email

  Id
ct:Email
  FEATURE_LINK
  


  Web
  
Id
  ct:Web
  FEATURE_LINK
  

In case, i would like to add ContactInfoProperty, do i need to create extra
mapping file(s) (eg. ct_contactInfoProperty.xml),
which contains mapping of emails and webs? What would be datastore in this case?
And how should I link Person -> ContactInfoProperty -> ContactInfo ->
Emails/WebPages?
I have tables/viewsw for person, email and web in postgre db, and there is link
via person.Id -> email.PersonId, web.PersonId.
Do i need something similar for ContactInfoProperty/ContactInfo also?
Or is it set just in schema files?
Thanks for any advice,
Tomas
*Sent:* Tuesday, October 31, 2017 at 4:20 PM
*From:* "Gavin Medley" 
*To:* "Tomas L." 
*Cc:* "Ben Caradoc-Davies" , geoserver-users

*Subject:* Re: [Geoserver-users] WFS nesting

Hi Tomas,

As Ben alluded to, I think you should first make sure that your goal is GML
compliant. That means it follows the Object-Property-Value model (or GML
striping rule). That is, GML compliant XML always consists of an Object, which
contains Properties. An object may have 0 to n properties “nested” on the same
level, like so:

|   ...  |

Each property must contain at most 1 value in GML. I believe this is where your
schema may violate the model. The value of a property may be simple, e.g.
|foovalue| or the value may itself be an object, like:

|......
  ... |

In your context, || would be an object and || would be a
property (potentially one of many). However, that property cannot contain
|| /and/ || as values (objects) since a property may only have a
single value. One way around this could be to skip the || property
and use || and || as properties of ||. Another would be to
create a || element so that your output would look like:

|
   
|

Any solution will require changing your schema to be GML compliant since that is
the root of the problem.

HTH

-Gavin

​
On Tue, Oct 31, 2017 at 4:48 AM, Tomas L. > wrote:

 Hi, thanks for reply. Im so sorry, but i do not understand, what exactly 
you
 mean.
 How i wrote in my first question, im able to chain features exactly as you
 described:
 
 
 
 content for email 1
 
 
 content for email 2
 
 [...]
 I attached all my files as a ZIP, so you can see the output in 
"___output.xml".
 But i would like to "nest" emails/webs to special elements, so the output
 should be like this:
 
 
 .. person info
 <-  one more "nested" element
   <-  another "nested" element

  ... email 1

  
   <- ... another "nested"" element

   web 1

  

 ..
 

 I suppose it could be set in schema (xsd) files somehow, but i do not know
 how exactly it should be done.
 So i would really appreciate any help.
 Thanks a lot,
 Tomas
 *Sent:* Monday, October 30, 2017 at 9:24 PM
 *From:* "Ben Caradoc-Davies" >
 *To:* "Tomas L." >
 *Cc:* "Nuno Oliveira" >,
 geoserver-users@lists.sourceforge.net
 
 *Subject:* Re: [Geoserver-users] WFS nesting
 Tomas,

 for app-schema feature chaining to work properly, your XML schema must
 conform to the GML object/property model ("striping"). The encoded XML
 will be TypeName/propertyName/TypeName/propertyName/... . For example,
 with a multivalued "email" 

Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

2017-11-02 Thread Ben Caradoc-Davies

Bart,

thanks for the update.

If you think the mapping problem could have been detected by app-schema, 
please file a Jira issue including details. Better error reporting may 
have helped you in this case.


Kind regards,
Ben.

On 02/11/17 23:58, Verbeeck Bart wrote:

Thanks ben, there was indeed a subtle problem in the mapping.

Outlook voor iOS downloaden

From: Ben Caradoc-Davies 
Sent: Wednesday, November 1, 2017 8:44:09 PM
To: Verbeeck Bart; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

Bart,

WMS should be supported. Does WFS work for this layer? I suspect either
a subtle problem in your mapping or a bug in the app-schema joining
implementation.

Kind regards,
Ben.

On 31/10/17 20:13, Verbeeck Bart wrote:

Hi again

I moved my data to postgresql and I received the same error doing a getmap 
request. So this problem is not sqlserver related.

Is it a wrong idea to do wms requests to an application scheme based layer?


Geoserver sends the following query to my postgis database, and it has an error at "AND 
"uidn" FROM "public"."bekken"

SELECT "public"."bekken"."ogc_fid",encode(ST_AsEWKB("public"."bekken"."wkb_geometry"),'base64') as 
"wkb_geometry","public"."bekken"."uidn","public"."bekken"."oidn"
FROM "public"."bekken" INNER JOIN ( SELECT DISTINCT "oidn" FROM 
"public"."bekken"
WHERE "wkb_geometry" && ST_GeomFromText('POLYGON ((-80016.3310434809 -54667.64601825603, 
-80016.3310434809 322203.1650796655, 391530.2915944371 322203.1650796655, 391530.2915944371 
-54667.64601825603, -80016.3310434809 -54667.64601825603))', 31370) ) "temp_alias_used_for_filter"
ON ( "bekken"."oidn" = "temp_alias_used_for_filter"."oidn" AND "uidn" FROM 
"public"."bekken"
WHERE "wkb_geometry" && ST_GeomFromText('POLYGON ((-80016.3310434809 -54667.64601825603, 
-80016.3310434809 322203.1650796655, 391530.2915944371 322203.1650796655, 391530.2915944371 
-54667.64601825603, -80016.3310434809 -54667.64601825603))', 31370) ) "temp_alias_used_for_filter"
ON ( "bekken"."uidn" = "temp_alias_used_for_filter"."uidn" )  ORDER BY "public"."bekken"."oidn" ASC, 
"public"."bekken"."uidn" ASC, "public"."bekken"."ogc_fid"

-Original Message-
From: Verbeeck Bart [mailto:bart.verbe...@kb.vlaanderen.be]
Sent: dinsdag 31 oktober 2017 7:35
To: Ben Caradoc-Davies ; 
geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

Thanks Ben

Yes, I have configured the secondary namespace. The problem occurs with " 
=gml3", not with " =gml32"
I will follow up the GEOS-8250 issue. Hopefully it will be solved in a future 
release

Bart

-Original Message-
From: Ben Caradoc-Davies [mailto:b...@transient.nz]
Sent: maandag 30 oktober 2017 21:02
To: Verbeeck Bart ; 
geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

Bart,

I have no experience with sqlserver, but in relation to the null GML namespace, 
have you configured a secondary namespace for GML 3.2.1?
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html#secondary-namespace-for-gml-3-2-1-required

The DescribeFeatureType problem is reported here:

[GEOS-8250] WFS 2.0 DescribeFeatureType responses for app-schema types contain 
a spurious WFS 2.0 jar import
https://osgeo-org.atlassian.net/browse/GEOS-8250

Kind regards,
Ben.

On 30/10/17 23:22, Verbeeck Bart wrote:

Hi List

In our organization we try to use geoserver (2.11) to serve harmonized services 
using the application scheme extension.
Our data is stored in a SQLSERVER db. The documentation refers to postgres and 
oracle databases, not to sqlserver.

The wfs services seem to work, although

 *   there is the null namespace problem (null:identifier [ 
xmlns:null=http://www.opengis.net/gml/3.2 
codeSpace=http://inspire.ec.europa.eu/ids ])
 *   the describefeaturetype (2.0.0) result is not as I would expect, 
schemaLocation="jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.0/webapps/overdrachtdiensten/WEB-INF/lib/gt-xsd-wfs-17.2.jar!/org/geotools/wfs/v2_0/wfs.xsd

The wms getfeaturetype result is ok, but the getmap request causes an
erroneous sql request (at "FROM") (see below) The wms getmap result is 
successful on a shapefile based layer.

Does anyone have experience using the app scheme on a sql server database?

Thanks

Bart


SELECT "RT"."BEKKEN"."OBJECTID","RT"."BEKKEN"."UIDN","RT"."BEKKEN"."SHAPE" as 
"SHAPE","RT"."BEKKEN"."OIDN"
  FROM "RT"."BEKKEN"
  INNER JOIN (
SELECT DISTINCT "OIDN"
FROM "RT"."BEKKEN"
WHERE "SHAPE".Filter(geometry::STGeomFromText('POLYGON 
((12127.108205075114 2103.1082012057304, 12127.108205075114 395097.58538683876, 267800.38165359845 
395097.58538683876, 267800.38165359845 2103.1082012057304, 

Re: [Geoserver-users] libjpeg-turbo plugin may have a virus

2017-11-02 Thread Ben Caradoc-Davies
Russ, thank you for the report. This warning also affects all other 
releases I viewed on SourceForge: 2.11.3, 2.12-RC1, and 2.10.5. I


I tested three recent plugins from SourceForge and they have the same 
SHA-512 sum as the original from the Boundless build server 
:


geoserver-2.11.3-libjpeg-turbo-plugin.zip
geoserver-2.12-RC1-libjpeg-turbo-plugin.zip
geoserver-2.12.0-libjpeg-turbo-plugin.zip

ClamAV does not report any malware in these files.

I suspect a Bitdefender false positive. I have submitted a report to 
Bitdefender.


Kind regards,
Ben.


On 03/11/17 10:17, Russ Hore wrote:

I was just looking through the plugins and noticed a red triangle next to eh 
jpegturbo plugin. Hovering over it I get the message”This file may be infected 
with malware”

Browser is Firefox




--
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 
Director
Transient Software Limited 
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


[Geoserver-users] libjpeg-turbo plugin may have a virus

2017-11-02 Thread Russ Hore
I was just looking through the plugins and noticed a red triangle next to eh 
jpegturbo plugin. Hovering over it I get the message”This file may be infected 
with malware”

Browser is Firefox

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


Re: [Geoserver-users] WFS nesting

2017-11-02 Thread Tomas L.

Hi, thanks a lot for reply ..

 

Would you please be so kind and show/explain me how to change the schemas?

Just now, i have mappings like this:

 

mapping file ct_email.xml takes data from table "Emails" and contains definition of FEATURE_LINK:
..
datastore
Emailpe>
ct:Email
...

  FEATURE_LINK
     
       PersonId
     


 

The same approach I have for web.

 

In mapping for person, I include both ct_email.xml and ct_web.xml, and define mapping like:

 

datastore
Person
ct:Person
...

  Email
  
    Id
      ct:Email
        FEATURE_LINK
    


    Web
    
      Id
        ct:Web
        FEATURE_LINK
    


 

In case, i would like to add ContactInfoProperty, do i need to create extra mapping file(s) (eg. ct_contactInfoProperty.xml),
which contains mapping of emails and webs? What would be datastore in this case?

 

And how should I link Person -> ContactInfoProperty -> ContactInfo -> Emails/WebPages?

 

I have tables/viewsw for person, email and web in postgre db, and there is link via person.Id -> email.PersonId, web.PersonId.

Do i need something similar for ContactInfoProperty/ContactInfo also?

 

Or is it set just in schema files?

 

Thanks for any advice,
Tomas

 

 

Sent: Tuesday, October 31, 2017 at 4:20 PM
From: "Gavin Medley" 
To: "Tomas L." 
Cc: "Ben Caradoc-Davies" , geoserver-users 
Subject: Re: [Geoserver-users] WFS nesting




Hi Tomas,

As Ben alluded to, I think you should first make sure that your goal is GML compliant. That means it follows the Object-Property-Value model (or GML striping rule). That is, GML compliant XML always consists of an Object, which contains Properties. An object may have 0 to n properties “nested” on the same level, like so:


  
  
  ...



Each property must contain at most 1 value in GML. I believe this is where your schema may violate the model. The value of a property may be simple, e.g. foovalue or the value may itself be an object, like:

...
  

  
  ...

  
...


In your context,  would be an object and  would be a property (potentially one of many). However, that property cannot contain  and  as values (objects) since a property may only have a single value. One way around this could be to skip the  property and use  and  as properties of . Another would be to create a  element so that your output would look like:

 
   
 
   
   

   



Any solution will require changing your schema to be GML compliant since that is the root of the problem.

HTH

-Gavin

​



 
On Tue, Oct 31, 2017 at 4:48 AM, Tomas L.  wrote:






Hi, thanks for reply. Im so sorry, but i do not understand, what exactly you mean.
How i wrote in my first question, im able to chain features exactly as you described:

 




content for email 1


content for email 2

[...]

 

I attached all my files as a ZIP, so you can see the output in "___output.xml".

 

But i would like to "nest" emails/webs to special elements, so the output should be like this:

 



   .. person info
   <-  one more "nested" element
     <-  another "nested" element
  
    ... email 1
  
    
     <- ... another "nested"" element
  
     web 1
  
    
  
..



I suppose it could be set in schema (xsd) files somehow, but i do not know how exactly it should be done.
So i would really appreciate any help.

Thanks a lot,
Tomas
 

 

Sent: Monday, October 30, 2017 at 9:24 PM
From: "Ben Caradoc-Davies" 
To: "Tomas L." 
Cc: "Nuno Oliveira" , geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] WFS nesting

Tomas,

for app-schema feature chaining to work properly, your XML schema must
conform to the GML object/property model ("striping"). The encoded XML
will be TypeName/propertyName/TypeName/propertyName/... . For example,
with a multivalued "email" property:




content for email 1


content for email 2

[...]

This is required by GML. The pattern is as for GeometryPropertyType and
similar. The reason is that this allows naming of properties and
encoding of their concrete type (polymorphism). If your schema follows
these rules, you will be able to use feature chaining to encode
multivalued properties.

Kind regards,
Ben.

On 30/10/17 23:50, Tomas L. wrote:
> Thanks for answer. I know about app schema, im using it. Im able to join
> elements through FEATURE_LINK, but have no luck with nesting of joined elements.
> BR,
> Tomas.
> *Sent:* Monday, October 30, 2017 at 10:54 AM
> *From:* "Nuno Oliveira" 
> *To:* geoserver-users@lists.sourceforge.net
> *Subject:* Re: [Geoserver-users] WFS nesting
> Hi,
>
> The only way I know of achieving this in GeoServer is using App-Schema:
> http://docs.geoserver.org/stable/en/user/data/app-schema/index.html
>
> This extension will allow you mappings between 

Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

2017-11-02 Thread Verbeeck Bart
Thanks ben, there was indeed a subtle problem in the mapping.

Outlook voor iOS downloaden

From: Ben Caradoc-Davies 
Sent: Wednesday, November 1, 2017 8:44:09 PM
To: Verbeeck Bart; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver

Bart,

WMS should be supported. Does WFS work for this layer? I suspect either
a subtle problem in your mapping or a bug in the app-schema joining
implementation.

Kind regards,
Ben.

On 31/10/17 20:13, Verbeeck Bart wrote:
> Hi again
>
> I moved my data to postgresql and I received the same error doing a getmap 
> request. So this problem is not sqlserver related.
>
> Is it a wrong idea to do wms requests to an application scheme based layer?
>
>
> Geoserver sends the following query to my postgis database, and it has an 
> error at "AND "uidn" FROM "public"."bekken"
>
> SELECT 
> "public"."bekken"."ogc_fid",encode(ST_AsEWKB("public"."bekken"."wkb_geometry"),'base64')
>  as "wkb_geometry","public"."bekken"."uidn","public"."bekken"."oidn"
> FROM "public"."bekken" INNER JOIN ( SELECT DISTINCT "oidn" FROM 
> "public"."bekken"
> WHERE "wkb_geometry" && ST_GeomFromText('POLYGON ((-80016.3310434809 
> -54667.64601825603, -80016.3310434809 322203.1650796655, 391530.2915944371 
> 322203.1650796655, 391530.2915944371 -54667.64601825603, -80016.3310434809 
> -54667.64601825603))', 31370) ) "temp_alias_used_for_filter"
> ON ( "bekken"."oidn" = "temp_alias_used_for_filter"."oidn" AND "uidn" FROM 
> "public"."bekken"
> WHERE "wkb_geometry" && ST_GeomFromText('POLYGON ((-80016.3310434809 
> -54667.64601825603, -80016.3310434809 322203.1650796655, 391530.2915944371 
> 322203.1650796655, 391530.2915944371 -54667.64601825603, -80016.3310434809 
> -54667.64601825603))', 31370) ) "temp_alias_used_for_filter"
> ON ( "bekken"."uidn" = "temp_alias_used_for_filter"."uidn" )  ORDER BY 
> "public"."bekken"."oidn" ASC, "public"."bekken"."uidn" ASC, 
> "public"."bekken"."ogc_fid"
>
> -Original Message-
> From: Verbeeck Bart [mailto:bart.verbe...@kb.vlaanderen.be]
> Sent: dinsdag 31 oktober 2017 7:35
> To: Ben Caradoc-Davies ; 
> geoserver-users@lists.sourceforge.net
> Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver
>
> Thanks Ben
>
> Yes, I have configured the secondary namespace. The problem occurs with " 
> =gml3", not with " =gml32"
> I will follow up the GEOS-8250 issue. Hopefully it will be solved in a future 
> release
>
> Bart
>
> -Original Message-
> From: Ben Caradoc-Davies [mailto:b...@transient.nz]
> Sent: maandag 30 oktober 2017 21:02
> To: Verbeeck Bart ; 
> geoserver-users@lists.sourceforge.net
> Subject: Re: [Geoserver-users] inspire-appscheme-wms-sqlserver
>
> Bart,
>
> I have no experience with sqlserver, but in relation to the null GML 
> namespace, have you configured a secondary namespace for GML 3.2.1?
> http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html#secondary-namespace-for-gml-3-2-1-required
>
> The DescribeFeatureType problem is reported here:
>
> [GEOS-8250] WFS 2.0 DescribeFeatureType responses for app-schema types 
> contain a spurious WFS 2.0 jar import
> https://osgeo-org.atlassian.net/browse/GEOS-8250
>
> Kind regards,
> Ben.
>
> On 30/10/17 23:22, Verbeeck Bart wrote:
>> Hi List
>>
>> In our organization we try to use geoserver (2.11) to serve harmonized 
>> services using the application scheme extension.
>> Our data is stored in a SQLSERVER db. The documentation refers to postgres 
>> and oracle databases, not to sqlserver.
>>
>> The wfs services seem to work, although
>>
>> *   there is the null namespace problem (null:identifier [ 
>> xmlns:null=http://www.opengis.net/gml/3.2 
>> codeSpace=http://inspire.ec.europa.eu/ids ])
>> *   the describefeaturetype (2.0.0) result is not as I would expect, 
>> schemaLocation="jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.0/webapps/overdrachtdiensten/WEB-INF/lib/gt-xsd-wfs-17.2.jar!/org/geotools/wfs/v2_0/wfs.xsd
>>
>> The wms getfeaturetype result is ok, but the getmap request causes an
>> erroneous sql request (at "FROM") (see below) The wms getmap result is 
>> successful on a shapefile based layer.
>>
>> Does anyone have experience using the app scheme on a sql server database?
>>
>> Thanks
>>
>> Bart
>>
>>
>> SELECT "RT"."BEKKEN"."OBJECTID","RT"."BEKKEN"."UIDN","RT"."BEKKEN"."SHAPE" 
>> as "SHAPE","RT"."BEKKEN"."OIDN"
>>  FROM "RT"."BEKKEN"
>>  INNER JOIN (
>>SELECT DISTINCT "OIDN"
>>FROM "RT"."BEKKEN"
>>WHERE "SHAPE".Filter(geometry::STGeomFromText('POLYGON 
>> ((12127.108205075114 2103.1082012057304, 12127.108205075114 
>> 395097.58538683876, 267800.38165359845 395097.58538683876, 
>> 267800.38165359845 2103.1082012057304, 12127.108205075114 
>> 2103.1082012057304))', 31370)) = 1 )