Complex features - Encoding XML attributes in GeoJSON

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Complex features - Encoding XML attributes in GeoJSON

Nuno Oliveira-3
Dear all,

Currently, the complex features GeoJSON encoder [1] doesn't encode XML (GML) attributes. For example, something like:

(...)
<gsml:positionalAccuracy>
  <gsml:CGI_NumericValue>
    <gsml:principalValue uom="urn:ogc:def:uom:UCUM:m">200.0</gsml:principalValue>
  </gsml:CGI_NumericValue>
</gsml:positionalAccuracy>
(...)

Will be encoded like this in GeoJSON:

(...)
"properties": {
    "gsml:positionAccuracy": {
        "gsml:CGI_NumericValue": {
            "gsml:principalValue": 100
        }
    }
}
(...)

As far as I know, there is no standard or specification that defines how the concept of complex features attributes (GML attributes) should be encoded, the GeoJSON specification is quite permissible:
A Feature object has a member with the name "properties". 
The value of the properties member is an object (any JSON
object or a JSON null value).
My suggestion is to encode XML\GML attributes as an array of values, using the example  above:

(...)
"properties": {
    "gsml:positionAccuracy": {
        "gsml:CGI_NumericValue": {
            "gsml:principalValue": [
                100.0,
                {
                    "uom": "urn:ogc:def:uom:UCUM:m"
                }

            ]
        }
    }
}
(...)

So, simple values (like 100.0) represent the value of the node and objects (like {"uom": "urn:ogc:def:uom:UCUM:m"}) represent the attributes of the node. This keeps the semantic and doesn't add too much burden to the clients.

Any feedback \ comments on this are welcome :)

Kind regards,

Nuno Oliveira


--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.


_______________________________________________
Geoserver-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Reply | Threaded
Open this post in threaded view
|

Re: Complex features - Encoding XML attributes in GeoJSON

geowolf
On Thu, Oct 11, 2018 at 2:55 PM Nuno Oliveira GeoSolutions <[hidden email]> wrote:
My suggestion is to encode XML\GML attributes as an array of values, using the example  above:

(...)
"properties": {
    "gsml:positionAccuracy": {
        "gsml:CGI_NumericValue": {
            "gsml:principalValue": [
                100.0,
                {
                    "uom": "urn:ogc:def:uom:UCUM:m"
                }

            ]
        }
    }
}
(...)

So the expansion from single value to array is going to happen only if the particular value has attributes, right?

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.



_______________________________________________
Geoserver-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Reply | Threaded
Open this post in threaded view
|

Re: Complex features - Encoding XML attributes in GeoJSON

Nuno Oliveira-3
Yes that's the idea, if there is no attribute(s) the value will be encoded as:

     (...)
"properties": {
    "gsml:positionAccuracy": {
        "gsml:CGI_NumericValue": {
            "gsml:principalValue": 100.0
        }
    }
}
         (...)

On Thu, Oct 11, 2018 at 2:06 PM Andrea Aime <[hidden email]> wrote:
On Thu, Oct 11, 2018 at 2:55 PM Nuno Oliveira GeoSolutions <[hidden email]> wrote:
My suggestion is to encode XML\GML attributes as an array of values, using the example  above:

(...)
"properties": {
    "gsml:positionAccuracy": {
        "gsml:CGI_NumericValue": {
            "gsml:principalValue": [
                100.0,
                {
                    "uom": "urn:ogc:def:uom:UCUM:m"
                }

            ]
        }
    }
}
(...)

So the expansion from single value to array is going to happen only if the particular value has attributes, right?

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.



--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.


_______________________________________________
Geoserver-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel