[Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

Hello everyone,

I'd like to enhance WFS responses in JSON/JSONP format. In some of our Web GIS Applications, one may download up to several thousand Simple Features through WFS. Some Layers may have between 400 and 500 columns.

Although JSON produces much smaller responses than XML/GML, such responses quickly have sizes between 60 and 120 MB (uncompressed).

The idea is to remove some redundancy from the GeoJSON format, which provides a feature's attributes in a key/value map (JSON Object):

{
    "type":"FeatureCollection",
    "features":[
       {
          "type":"Feature",
          "id":"bugsites.3",
          "geometry":{
             "type":"Point",
             "coordinates":[
                590529,
                4914625
             ]
          },
          "geometry_name":"the_geom",
          "properties":{
             "cat":3,
             "str1":"Beetle site"
          }
       },
       {
          "type":"Feature",
          "id":"bugsites.4",
          "geometry":{
             "type":"Point",
             "coordinates":[
                590546,
                4915353
             ]
          },
          "geometry_name":"the_geom",
          "properties":{
             "cat":4,
             "str1":"Beetle site"
          }
       }
    ],
    "totalFeatures":2,
    "numberMatched":2,
    "numberReturned":2,
    "timeStamp":"2022-09-13T08:44:45.118Z",
    "crs":{
       "type":"name",
       "properties":{
          "name":"urn:ogc:def:crs:EPSG::26713"
       }
    }
}

Also, the "geometry_name" property is repeated for every feature returned.

With lots of features and columns (the latter do not necessarily have short names), this repeated schema information can quickly become the dominating factor regarding the size of the response. (Of course, that also depends on the type and complexity of the geometry.)

Likely the repeated "type":"Feature" could be omitted as well. It's just there in order to satisfy the GeoJSON specs. Maybe the "level of compaction" could be specified for a request.

By including schema information only once in the FeatureCollection object, a more compact form of the JSON response may look like this:

{
    "type":"FeatureCollection",
    "features":[
       {
          "type":"Feature",
          "id":"bugsites.3",
          "geometry":{
             "type":"Point",
             "coordinates":[
                590529,
                4914625
             ]
          },
          "geometry_name":"the_geom",
          "properties":[
             3,
             "Beetle site"
          ]
       },
       {
          "type":"Feature",
          "id":"bugsites.4",
          "geometry":{
             "type":"Point",
             "coordinates":[
                590546,
                4915353
             ]
          },
          "properties":[
             4,
             "Beetle site"
          ]
       }
    ],
    "totalFeatures":2,
    "numberMatched":2,
    "numberReturned":2,
    "timeStamp":"2022-09-13T08:44:45.118Z",
    "crs":{
       "type":"name",
       "properties":{
          "name":"urn:ogc:def:crs:EPSG::26713"
       }
    },
    "schema":{
       "geometry_name":"the_geom",
       "properties":[
          "cat",
          "str1"
       ]
    }
}

Here, a new "schema" object in the root "FeatureCollection" object contains the name of the geometry field as well as the names of the other properties as an array. The "properties" object in the "Feature" objects have become arrays as well, containing the property values only.

Both arrays are "parallel", that is:

Key: "schema"."properties"[0] => cat
Val: features[N]."properties"[0] => 3 or 4 (depending on N)

Key: "schema"."properties"[1] => str1
Val: features[N]."properties"[1] => Beetle site

In the above example with only two short-named fields savings are almost zero. However, with requests getting some thousand features, each having 300+ fields, savings may be quite significant.

The new compact format is not GeoJSON, of course. However, what GeoServer currently returns is already not really compatible with GeoJSON specs, which, for example, only permit EPGS:4326 coordinates. In any case, that format is likely much smaller for requests described above.

On the wire, these responses are typically compressed (deflate, brotli etc.). However, compressing smaller amounts of data typically results in smaller compressed junks. Also, it is not only about transferring the data; the data must be created and compressed by GeoServer and must be decompressed and parsed in the client. After all, smaller junks of data seem to be less resource consuming than larger ones.

I'd like to add this new compact format directly into GeoServer's core WFS JSON code:

gs-wfs: org.geoserver.wfs.json.GeoJSONGetFeatureResponse

More or less, only method encodeSimpleFeatures must be modified in order to implement this new compact JSON format.

However, that method iterates over a list of FeatureCollection objects (argument List<FeatureCollection> resultsList). Could there be more than one FeatureCollection is the request returns simple features only? Shouldn't all simple features requested through WFS be of the same type? In other words, must I expect to deal with several distinct "schema" objects when requesting simple features? (don't think so)

Since using this format, of course, is optional, I need a mechanism to tell the server whether to return compact JSON or not (and maybe the level of compaction it should use).

One quite obvious option is to use vendor parameter "format_options". Here, a parameter like "json:compact" could trigger responding with compact JSON. This seems quite simple to implement.

Another idea is to use different outputFormat MIME types or MIME types with additional parameters:

application/json; type=compact; omitTypes=true
text/javascript; type=compact

Although distinguishing the format via the MIME type may be some more work to do, I do prefer this approach over the "format_options" way.

What else do I have to consider?

Many thanks in advance for your ideas on this :slight_smile:

Regards, Carsten

I would suggest calling it something other than GeoJSON since if it strays too far from the spec clients will become confused.

Ian

···

Ian Turton

Sorry hit send too soon!

I would also prefer it if it was an extension rather than part of the core GeoServer.

Ian

···

Ian Turton

Agreed, it should start as a community module. Happy to review changes to make subclassing the existing GeoJSON
producer easier. Or you can just copy and modify, if you like, to get prototyping moving on faster.

If you are interested in a ready made compact and efficient format instead, I suggest looking into flatgeobuf, it already
has a Javascript reader library and GeoServer has a community module to generate it as a WFS output format.

Cheers
Andrea

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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

Hi Ian and Andrea,

thanks for your input and recommendations. I'll try to create a community extension (using flatgeobuf and others as a starting point / boilerplate). I'm using Eclipse and still struggling with Maven. However, things are moving...

I will also have a look at the flatgeobuf format.

Still not sure whether subclassing requires changes in the existing GeoJSON producer (and which). I guess, with no changes I'll lose support for JSONP, unless I'm also overriding the write method (using my own jsonp field). Likely removing the final modifier from the jsonp field in existing GeoJSON producer whould be helpful.

Cheers
Carsten

On Tue, Sep 13, 2022 at 2:20 PM Andrea Aime wrote:

Agreed, it should start as a community module. Happy to review changes to make subclassing the existing GeoJSON
producer easier. Or you can just copy and modify, if you like, to get prototyping moving on faster.

If you are interested in a ready made compact and efficient format instead, I suggest looking into flatgeobuf <https://github.com/flatgeobuf/flatgeobuf&gt;, it already
has a Javascript reader library and GeoServer has a community module to generate it as a WFS output format.

Cheers
Andrea

On Tue, Sep 13, 2022 at 1:54 PM Ian Turton <ijturton@anonymised.com <mailto:ijturton@anonymised.com>> wrote:

    Sorry hit send too soon!

    I would also prefer it if it was an extension rather than part of
    the core GeoServer.

    Ian

    On Tue, 13 Sept 2022 at 12:52, Ian Turton <ijturton@anonymised.com
    <mailto:ijturton@anonymised.com>> wrote:

        I would suggest calling it something other than GeoJSON since if
        it strays too far from the spec clients will become confused.

        Ian

Hello there,

now, I've managed to setup a community module project with Maven, created and Eclipse project, which I additionally linked to project 'gs-wfs', so I can make changes to the existing GeoJSON producer Andrea mentioned.

After linking my new project 'gs-compactjson' to project 'gs-web-app', I can start and debug my module from Eclipse. Really cool...

Currently the new CompactJSON module only adds to new outputFormats:

application/json; format=compact
text/javascript; format=compact

These formats are now listed in WFS GetCapabilities response. That all actually worked when I first start GeoServer with my new module from Eclipse.

In order to subclass GeoJSONGetFeatureResponse properly, some changes are required for this class. I've added a new protected constructor to be used by subclasses only. This additionally takes the value of the jsonp variable and the LOGGER of the subclass.

/**
   * Constructor to be used by subclasses.
   *
   * @param outputFormat The well-known name of the format, not
                         <code>null</code>
   * @param jsonp <code>true</code> if specified format uses JSONP
   * @param logger the logger created by the subclass
   */
protected GeoJSONGetFeatureResponse(GeoServer gs, String format,
   boolean jsonp, Logger logger) {
     super(gs, format);
     this.jsonp = jsonp;
     this.LOGGER = logger != null ? logger
        : org.geotools.util.logging.Logging.getLogger(this.getClass());
}

Also, I've changed the LOGGER variable from private to protected, in order to use it from the subclass.

Can you agree?

I will now start implementing the compact JSON format for Simple Features.

All my changes and the new project are in my local Git repository so later, I could create a CR (or two) with both the changes made to the GeoJSONGetFeatureResponse class and the new CompatJSON module.

Cheers
Carsten

On Tue, Sep 13, 2022 at 2:20 PM Andrea Aime wrote:

Agreed, it should start as a community module. Happy to review changes to make subclassing the existing GeoJSON
producer easier. Or you can just copy and modify, if you like, to get prototyping moving on faster.

If you are interested in a ready made compact and efficient format instead, I suggest looking into flatgeobuf <https://github.com/flatgeobuf/flatgeobuf&gt;, it already
has a Javascript reader library and GeoServer has a community module to generate it as a WFS output format.

Cheers
Andrea

On Tue, Sep 13, 2022 at 1:54 PM Ian Turton <ijturton@anonymised.com <mailto:ijturton@anonymised.com>> wrote:

    Sorry hit send too soon!

    I would also prefer it if it was an extension rather than part of
    the core GeoServer.

    Ian

    On Tue, 13 Sept 2022 at 12:52, Ian Turton <ijturton@anonymised.com
    <mailto:ijturton@anonymised.com>> wrote:

        I would suggest calling it something other than GeoJSON since if
        it strays too far from the spec clients will become confused.

        Ian

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On 14-09-2022 10:57, Carsten Klein wrote:

 this\.LOGGER = logger \!= null ? logger
    : org\.geotools\.util\.logging\.Logging\.getLogger\(this\.getClass\(\)\);

}

Also, I've changed the LOGGER variable from private to protected, in order to use it from the subclass.

Don't do this, just create a private LOGGER in your subclass; it will make life easier than when passing one around.

also I'm not sure I understand the reason for injecting the jsonp boolean as it is a protected variable you can just access it in the subclass to do what you need?..

Hello Mark,

just wanted to ensure that the actual class responsible for writing the WFS response pops up in the logs consistently. However, that's not really a requirement so, I could as well log only the bits happening in my class with my private logger and let my parent class log in its own name.

I do not need to access jspnp (that's done in my parent class only) bit I must set it accordingly. Since it's final i cannot set it after calling the super constructor.

Why must ´I´ set it? Because the existing parent class cannot do that in that case. The flag gets true if the format is "text/javascript" (and false if the format is "application/json"). My formats, however, are "text/javascript; format=compact" and "application/json; format=compact" so, the parent class will never set it to true, since "text/javascript; format=compact" is not equal to "text/javascript".

In my constructor, I do remove the params after the ; (in private static helper method parseMimeType) and compute the state of the jsonp flag on my own.

That's my constructor: (still passing the LOGGER)

public CompactJSONGetFeatureResponse(GeoServer gs, String format) {
     super(gs, format, JSONType.isJsonpMimeType(parseMimeType(format)),
             org.geotools.util.logging.Logging.getLogger(
                 CompactJSONGetFeatureResponse.class));
}

private static String parseMimeType(String format) {
     int pos = format.indexOf(';');
     return pos != -1 ? format.substring(0, pos).trim() : format;
}

On Wed, Sep 14, 2022 at 12:41 PM Mark Prins wrote> On 14-09-2022 10:57, Carsten Klein wrote:

 this\.LOGGER = logger \!= null ? logger
    : org\.geotools\.util\.logging\.Logging\.getLogger\(this\.getClass\(\)\);

}

Also, I've changed the LOGGER variable from private to protected, in order to use it from the subclass.

Don't do this, just create a private LOGGER in your subclass; it will make life easier than when passing one around.

also I'm not sure I understand the reason for injecting the jsonp boolean as it is a protected variable you can just access it in the subclass to do what you need?..

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hello there,

the new WFS output format CompactJSON, implemented as a community extension, is ready and works as expected. With our mentioned WFS responses (1.000+ features, 450 columns each), compared to standard GeoJSON, savings are between ~30% and ~70% (uncompressed) and between ~20% and ~50% with gzip content encoding. (see ´Statistics´ and ´Conclusion´ below)

What are the next steps in order to contribute/publish the new community extension? Shall I commit all the stuff to my forked ´geoserver´ repository and issue a CR including all changes required in existing core code (that is the existing JSON producer)?

One last question: some of the WFS format extensions have one or more GeoServerApplication.properties files, which seem to provide human readable names for the actual MIME types or formats. Should I provide these, too? Where are these texts used? What are the rules?

Cheers
Carsten

Statistics

Given two layers A and B, both having ~450 columns. Layer A's geometry contains polygons (~300 vertices each). Layer B has point geometries (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

Querying only ~1,000 and all ~10,000 features/rows from both layers:

Layer A (heavy polygons)
------------------------

~1,000 rows bytes raw bytes gzip

GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

Layer A (heavy polygons)
------------------------

~10,000 rows bytes raw bytes gzip

GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

Layer B (lightweight points)
----------------------------

~1,000 rows bytes raw bytes gzip

GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

Layer B (lightweight points)
----------------------------

~10,000 rows bytes raw bytes gzip

GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

Conclusion

Savings mainly depend on the ratio between schema information and data. That is, savings are small if features have much more data than schema information. Typically, geometries may get quite large, so savings depend on the size/complexity of the feature's geometries. (e. g. tests where done using complex polygons vs. simple point objects)

Also remarkable is that CompactJSON produces not much bigger responses (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses do not compress very well and are bigger than compressed CompactJSON in all (and even bigger than compressed GeoJSON if geometries are heavy in some) cases.

Hello there,

the new WFS output format CompactJSON, implemented as a community
extension, is ready and works as expected. With our mentioned WFS
responses (1.000+ features, 450 columns each), compared to standard
GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
~20% and ~50% with gzip content encoding. (see ´Statistics´ and
´Conclusion´ below)

What are the next steps in order to contribute/publish the new community
extension? Shall I commit all the stuff to my forked ´geoserver´
repository and issue a CR including all changes required in existing
core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the relevant docs.
For reference, here it is:

https://github.com/geoserver/geoserver/blob/main/.github/PULL_REQUEST_TEMPLATE.md

One last question: some of the WFS format extensions have one or more
GeoServerApplication.properties files, which seem to provide human
readable names for the actual MIME types or formats. Should I provide
these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the format dropdown
you can find in the layer preview page. We don’t have a list of rules, checking
what the other formats do and mimicking it, is the de-facto approach when adding
a new output format.

Statistics

Given two layers A and B, both having ~450 columns. Layer A’s geometry
contains polygons (~300 vertices each). Layer B has point geometries
(created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

Querying only ~1,000 and all ~10,000 features/rows from both layers:

Layer A (heavy polygons)

~1,000 rows bytes raw bytes gzip

GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

Layer A (heavy polygons)

~10,000 rows bytes raw bytes gzip

GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

Layer B (lightweight points)

~1,000 rows bytes raw bytes gzip

GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

Layer B (lightweight points)

~10,000 rows bytes raw bytes gzip

GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

Conclusion

Savings mainly depend on the ratio between schema information and data.
That is, savings are small if features have much more data than schema
information. Typically, geometries may get quite large, so savings
depend on the size/complexity of the feature’s geometries. (e. g. tests
where done using complex polygons vs. simple point objects)

Also remarkable is that CompactJSON produces not much bigger responses
(aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
do not compress very well and are bigger than compressed CompactJSON in
all (and even bigger than compressed GeoJSON if geometries are heavy in
some) cases.

Interesting finding indeed.

Cheers
Andrea

···

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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

Hello Andrea,

I've just issued a PR on GitHub. The format and community module has been renamed to "Slim GeoJSON". "Slim" is shorter and likely easier to pronounce than compact (together with GeoJSON).

Sorry for struggling and messing around with Git. However, the final version of the PR should be OK for merging.

There are still some issues with QA checks and build checks (a test failed on Mac). I've written some more remarks on that in the PR on GitHub.

Cheers
Carsten

On Thu, Sep 29, 2022 at 10:17 AM Andrea Aime wrote

On Thu, Sep 22, 2022 at 10:08 AM Carsten Klein <c.klein@anonymised.com <mailto:c.klein@anonymised.com>> wrote:

    Hello there,

    the new WFS output format CompactJSON, implemented as a community
    extension, is ready and works as expected. With our mentioned WFS
    responses (1.000+ features, 450 columns each), compared to standard
    GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
    ~20% and ~50% with gzip content encoding. (see ´Statistics´ and
    ´Conclusion´ below)

    What are the next steps in order to contribute/publish the new
    community
    extension? Shall I commit all the stuff to my forked ´geoserver´
    repository and issue a CR including all changes required in existing
    core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the relevant docs.
For reference, here it is:

https://github.com/geoserver/geoserver/blob/main/.github/PULL_REQUEST_TEMPLATE.md

    One last question: some of the WFS format extensions have one or more
    GeoServerApplication.properties files, which seem to provide human
    readable names for the actual MIME types or formats. Should I provide
    these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the format dropdown
you can find in the layer preview page. We don't have a list of rules, checking
what the other formats do and mimicking it, is the de-facto approach when adding
a new output format.

    Statistics
    ==========

    Given two layers A and B, both having ~450 columns. Layer A's geometry
    contains polygons (~300 vertices each). Layer B has point geometries
    (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

    Querying only ~1,000 and all ~10,000 features/rows from both layers:

    Layer A (heavy polygons)
    ------------------------

    ~1,000 rows bytes raw bytes gzip

    GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

    CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

    FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

    Layer A (heavy polygons)
    ------------------------

    ~10,000 rows bytes raw bytes gzip

    GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

    CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

    FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

    Layer B (lightweight points)
    ----------------------------

    ~1,000 rows bytes raw bytes gzip

    GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

    CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

    FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

    Layer B (lightweight points)
    ----------------------------

    ~10,000 rows bytes raw bytes gzip

    GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

    CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

    FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

    Conclusion
    ==========

    Savings mainly depend on the ratio between schema information and data.
    That is, savings are small if features have much more data than schema
    information. Typically, geometries may get quite large, so savings
    depend on the size/complexity of the feature's geometries. (e. g. tests
    where done using complex polygons vs. simple point objects)

    Also remarkable is that CompactJSON produces not much bigger responses
    (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
    do not compress very well and are bigger than compressed CompactJSON in
    all (and even bigger than compressed GeoJSON if geometries are heavy in
    some) cases.

Interesting finding indeed.

Cheers
Andrea

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-usfor more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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

Hi,

I would consider some other name because this format is not GeoJSON. OGC is using name "OGC Features and geometries JSON" in its own project for enhancing GeoJSON https://docs.ogc.org/DRAFTS/21-045.html. Perhaps your format could be something like "Slim JSON for features".
Maybe you could contact also other open source projects for collecting more opinions and suggestions. A short announcement on the gdal-dev mailing list might be a good start.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 16.47
Vastaanottaja: Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

Hello Andrea,

I've just issued a PR on GitHub. The format and community module has been renamed to "Slim GeoJSON". "Slim" is shorter and likely easier to pronounce than compact (together with GeoJSON).

Sorry for struggling and messing around with Git. However, the final version of the PR should be OK for merging.

There are still some issues with QA checks and build checks (a test failed on Mac). I've written some more remarks on that in the PR on GitHub.

Cheers
Carsten

On Thu, Sep 29, 2022 at 10:17 AM Andrea Aime wrote

On Thu, Sep 22, 2022 at 10:08 AM Carsten Klein <c.klein@anonymised.com
<mailto:c.klein@anonymised.com>> wrote:

    Hello there,

    the new WFS output format CompactJSON, implemented as a community
    extension, is ready and works as expected. With our mentioned WFS
    responses (1.000+ features, 450 columns each), compared to standard
    GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
    ~20% and ~50% with gzip content encoding. (see ´Statistics´ and
    ´Conclusion´ below)

    What are the next steps in order to contribute/publish the new
    community
    extension? Shall I commit all the stuff to my forked ´geoserver´
    repository and issue a CR including all changes required in existing
    core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the
relevant docs.
For reference, here it is:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
ub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST_
TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7
Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%7
C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD
AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;s
data=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
hub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST
_TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%
7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%
7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;
sdata=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=
0>

    One last question: some of the WFS format extensions have one or more
    GeoServerApplication.properties files, which seem to provide human
    readable names for the actual MIME types or formats. Should I provide
    these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the format
dropdown you can find in the layer preview page. We don't have a list
of rules, checking what the other formats do and mimicking it, is the
de-facto approach when adding a new output format.

    Statistics
    ==========

    Given two layers A and B, both having ~450 columns. Layer A's geometry
    contains polygons (~300 vertices each). Layer B has point geometries
    (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

    Querying only ~1,000 and all ~10,000 features/rows from both layers:

    Layer A (heavy polygons)
    ------------------------

    ~1,000 rows bytes raw bytes gzip

    GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

    CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

    FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

    Layer A (heavy polygons)
    ------------------------

    ~10,000 rows bytes raw bytes gzip

    GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

    CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

    FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

    Layer B (lightweight points)
    ----------------------------

    ~1,000 rows bytes raw bytes gzip

    GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

    CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

    FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

    Layer B (lightweight points)
    ----------------------------

    ~10,000 rows bytes raw bytes gzip

    GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

    CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

    FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

    Conclusion
    ==========

    Savings mainly depend on the ratio between schema information and data.
    That is, savings are small if features have much more data than schema
    information. Typically, geometries may get quite large, so savings
    depend on the size/complexity of the feature's geometries. (e. g. tests
    where done using complex polygons vs. simple point objects)

    Also remarkable is that CompactJSON produces not much bigger responses
    (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
    do not compress very well and are bigger than compressed CompactJSON in
    all (and even bigger than compressed GeoJSON if geometries are heavy in
    some) cases.

Interesting finding indeed.

Cheers
Andrea

GeoServer Professional Services from the experts!

Visit
https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.l
y%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslait
os.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571
b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;res
erved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
ly%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslai
tos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a57
1b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%
7C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;re
served=0>for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitta
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWI
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
.geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;
reserved=0>

https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwitt
er.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitta
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWI
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwit
ter.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;
reserved=0>

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

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
Geoserver-devel@lists.sourceforge.net
https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fgeoserver-devel&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|be7e5c20e1084a56a2b608daa7a15866|c4f8a63255804a1c92371d5a571b71fa|0|0|638006608655183714|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=ffja8d8IVyD5RHbrMvqlAb9%2Fu1w7Or9bbaS4EMKCj24%3D&amp;reserved=0

Hi Jukka,

you suggest a different name (e. g. "OGC Features and geometries JSON"). What parts of the module/format would you like to be renamed? Module name? Class name? outputFormat name? Name and description of the format/module in README.md?

GeoServer actually has a class named GeoJSONGetFeatureResponse for emitting JSON. My class SlimGeoJSONGetFeatureResponse is just an extension adding the slim capability. Also, in Format-DropDown on the Layer Preview page, JSON is announced as

...
GeoJSON
GeoJSON(JSONP)
...

On the other hand, after having read only some parts of the OGC draft document, does GeoServer really return JSON-FG? At first glance, GeoServer extends GeoJSON (it's no official GeoJSON) but it's still far from JSON-FG, isn't it? Maybe naming it "OGC Features and geometries JSON" isn't much more apt?

I just wanted to stay as close as possible with GeoServer as I'm extending *its* current JSON capabilities. GeoServer docs state:

https://docs.geoserver.org/latest/en/user/services/wfs/outputformats.html#json-and-jsonp-output

The JSON output format (and JSONP if enabled) return feature content as GeoJSON document. Here is an
example of a simple GeoJSON file;

The "GeoJSON" is a link to http://geojson.org/

I do not know how GeoServer serializes complex features in JSON. Maybe that is closer to JSON-FG. For me, however, simple features encoded in JSON seem quite close to GeoJSON with the additon of a "crs" object (as initially recommended by GeoJSON in [GJ2008] and removed later due do interoperability concerns).

Although I'm open for changes, I believe that this small extension should likely not change much of the class it derives from (including terms and names), except that it removes space wasting redundancy (the "Slim" aspect).

Asking the gdal-dev list may be an option. However, this could start a very long running process with really lots of different opinions. For my mind, if someone is concerned whether GeoServer delivers GeoJSON, CRS-extended GeoJSON or even JSPN-FG - this should first be clairified (and possibly be changed) in GeoServer core. Later, extensions and modules could adapt these changes in a second step.

Cheers
Carsten

Am 06.10.2022 um 16:26 schrieb Rahkonen Jukka:

Hi,

I would consider some other name because this format is not GeoJSON. OGC is using name "OGC Features and geometries JSON" in its own project for enhancing GeoJSON https://docs.ogc.org/DRAFTS/21-045.html. Perhaps your format could be something like "Slim JSON for features".
Maybe you could contact also other open source projects for collecting more opinions and suggestions. A short announcement on the gdal-dev mailing list might be a good start.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 16.47
Vastaanottaja: Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

Hello Andrea,

I've just issued a PR on GitHub. The format and community module has been renamed to "Slim GeoJSON". "Slim" is shorter and likely easier to pronounce than compact (together with GeoJSON).

Sorry for struggling and messing around with Git. However, the final version of the PR should be OK for merging.

There are still some issues with QA checks and build checks (a test failed on Mac). I've written some more remarks on that in the PR on GitHub.

Cheers
Carsten

On Thu, Sep 29, 2022 at 10:17 AM Andrea Aime wrote

On Thu, Sep 22, 2022 at 10:08 AM Carsten Klein <c.klein@anonymised.com
<mailto:c.klein@anonymised.com>> wrote:

     Hello there,

     the new WFS output format CompactJSON, implemented as a community
     extension, is ready and works as expected. With our mentioned WFS
     responses (1.000+ features, 450 columns each), compared to standard
     GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
     ~20% and ~50% with gzip content encoding. (see ´Statistics´ and
     ´Conclusion´ below)

     What are the next steps in order to contribute/publish the new
     community
     extension? Shall I commit all the stuff to my forked ´geoserver´
     repository and issue a CR including all changes required in existing
     core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the
relevant docs.
For reference, here it is:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
ub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST_
TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7
Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%7
C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD
AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;s
data=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
hub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST
_TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%
7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%
7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;
sdata=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=
0>

     One last question: some of the WFS format extensions have one or more
     GeoServerApplication.properties files, which seem to provide human
     readable names for the actual MIME types or formats. Should I provide
     these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the format
dropdown you can find in the layer preview page. We don't have a list
of rules, checking what the other formats do and mimicking it, is the
de-facto approach when adding a new output format.

     Statistics
     ==========

     Given two layers A and B, both having ~450 columns. Layer A's geometry
     contains polygons (~300 vertices each). Layer B has point geometries
     (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

     Querying only ~1,000 and all ~10,000 features/rows from both layers:

     Layer A (heavy polygons)
     ------------------------

     ~1,000 rows bytes raw bytes gzip

     GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

     CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

     FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

     Layer A (heavy polygons)
     ------------------------

     ~10,000 rows bytes raw bytes gzip

     GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

     CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

     FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

     Layer B (lightweight points)
     ----------------------------

     ~1,000 rows bytes raw bytes gzip

     GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

     CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

     FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

     Layer B (lightweight points)
     ----------------------------

     ~10,000 rows bytes raw bytes gzip

     GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

     CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

     FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

     Conclusion
     ==========

     Savings mainly depend on the ratio between schema information and data.
     That is, savings are small if features have much more data than schema
     information. Typically, geometries may get quite large, so savings
     depend on the size/complexity of the feature's geometries. (e. g. tests
     where done using complex polygons vs. simple point objects)

     Also remarkable is that CompactJSON produces not much bigger responses
     (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
     do not compress very well and are bigger than compressed CompactJSON in
     all (and even bigger than compressed GeoJSON if geometries are heavy in
     some) cases.

Interesting finding indeed.

Cheers
Andrea

GeoServer Professional Services from the experts!

Visit
https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.l
y%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslait
os.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571
b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;res
erved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
ly%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslai
tos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a57
1b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%
7C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;re
served=0>for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitta
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWI
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
.geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;
reserved=0>

https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwitt
er.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitta
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWI
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwit
ter.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;
reserved=0>

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

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
Geoserver-devel@lists.sourceforge.net
https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fgeoserver-devel&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|be7e5c20e1084a56a2b608daa7a15866|c4f8a63255804a1c92371d5a571b71fa|0|0|638006608655183714|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=ffja8d8IVyD5RHbrMvqlAb9%2Fu1w7Or9bbaS4EMKCj24%3D&amp;reserved=0

Hi,

I suggest to use something/anything else than "GeoJSON" in the name of the community module or as a common name of the format because this JSON variant is not valid GeoJSON https://www.rfc-editor.org/rfc/rfc7946. In my previous mail I used the OGC draft about the "JSON for features and geometries" as an example because it does not contain "GeoJSON" in the name for making it clear that it is not written by the authors of GeoJSON. And that despite the fact that actually JSON-FG (or whatever it will be called) is also valid GeoJSON because it only adds new features into the GeoJSON specification. I did not mean that Geoserver is delivering JSON-FG, it does not. Sorry for the confusion.

If you definitely want to use the name "Slim GeoJSON" as a name of the format it would be polite to contact the authors of the GeoJSON specification and ask their opinion. All the authors are named in the beginning of the RFC document but maybe Howard Butler or Sean Gilles are the best first contacts. Otherwise it is fine for me if you prefer to write your format just by yourself.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 20.09
Vastaanottaja: Rahkonen Jukka <jukka.rahkonen@anonymised.com>; Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

Hi Jukka,

you suggest a different name (e. g. "OGC Features and geometries JSON").
What parts of the module/format would you like to be renamed? Module name? Class name? outputFormat name? Name and description of the format/module in README.md?

GeoServer actually has a class named GeoJSONGetFeatureResponse for emitting JSON. My class SlimGeoJSONGetFeatureResponse is just an extension adding the slim capability. Also, in Format-DropDown on the Layer Preview page, JSON is announced as

...
GeoJSON
GeoJSON(JSONP)
...

On the other hand, after having read only some parts of the OGC draft document, does GeoServer really return JSON-FG? At first glance, GeoServer extends GeoJSON (it's no official GeoJSON) but it's still far from JSON-FG, isn't it? Maybe naming it "OGC Features and geometries JSON" isn't much more apt?

I just wanted to stay as close as possible with GeoServer as I'm extending *its* current JSON capabilities. GeoServer docs state:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.geoserver.org%2Flatest%2Fen%2Fuser%2Fservices%2Fwfs%2Foutputformats.html%23json-and-jsonp-output&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=ec1%2BnAsT0UIx4fdO0CQN3Hox0wrLjHF%2Fnz0Mg3SYOYY%3D&amp;reserved=0

The JSON output format (and JSONP if enabled) return feature content
as GeoJSON document. Here is an example of a simple GeoJSON file;

The "GeoJSON" is a link to https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeojson.org%2F&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=rGQjaaiJWl89NvfMs8t%2BFJqJF4Gc2MDJgmrOjdkBgHw%3D&amp;reserved=0

I do not know how GeoServer serializes complex features in JSON. Maybe that is closer to JSON-FG. For me, however, simple features encoded in JSON seem quite close to GeoJSON with the additon of a "crs" object (as initially recommended by GeoJSON in [GJ2008] and removed later due do interoperability concerns).

Although I'm open for changes, I believe that this small extension should likely not change much of the class it derives from (including terms and names), except that it removes space wasting redundancy (the "Slim" aspect).

Asking the gdal-dev list may be an option. However, this could start a very long running process with really lots of different opinions. For my mind, if someone is concerned whether GeoServer delivers GeoJSON, CRS-extended GeoJSON or even JSPN-FG - this should first be clairified (and possibly be changed) in GeoServer core. Later, extensions and modules could adapt these changes in a second step.

Cheers
Carsten

Am 06.10.2022 um 16:26 schrieb Rahkonen Jukka:

Hi,

I would consider some other name because this format is not GeoJSON. OGC is using name "OGC Features and geometries JSON" in its own project for enhancing GeoJSON https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.ogc.org%2FDRAFTS%2F21-045.html&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=7KYdte0FMaaaUNIZ7mqVV6nwkzBfMnljjVHD%2FO%2FrazE%3D&amp;reserved=0. Perhaps your format could be something like "Slim JSON for features".
Maybe you could contact also other open source projects for collecting more opinions and suggestions. A short announcement on the gdal-dev mailing list might be a good start.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 16.47
Vastaanottaja: Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response
in new more compact JSON/JSONP format

Hello Andrea,

I've just issued a PR on GitHub. The format and community module has been renamed to "Slim GeoJSON". "Slim" is shorter and likely easier to pronounce than compact (together with GeoJSON).

Sorry for struggling and messing around with Git. However, the final version of the PR should be OK for merging.

There are still some issues with QA checks and build checks (a test failed on Mac). I've written some more remarks on that in the PR on GitHub.

Cheers
Carsten

On Thu, Sep 29, 2022 at 10:17 AM Andrea Aime wrote

On Thu, Sep 22, 2022 at 10:08 AM Carsten Klein <c.klein@anonymised.com
<mailto:c.klein@anonymised.com>> wrote:

     Hello there,

     the new WFS output format CompactJSON, implemented as a community
     extension, is ready and works as expected. With our mentioned WFS
     responses (1.000+ features, 450 columns each), compared to standard
     GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
     ~20% and ~50% with gzip content encoding. (see ´Statistics´ and
     ´Conclusion´ below)

     What are the next steps in order to contribute/publish the new
     community
     extension? Shall I commit all the stuff to my forked ´geoserver´
     repository and issue a CR including all changes required in existing
     core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the
relevant docs.
For reference, here it is:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
h
ub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST
_
TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%
7
Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%
7
C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
D
AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;
s
data=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=
0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi
t
hub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUES
T
_TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi
%
7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa
%
7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
M
DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp
;
sdata=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved

0>

     One last question: some of the WFS format extensions have one or more
     GeoServerApplication.properties files, which seem to provide human
     readable names for the actual MIME types or formats. Should I provide
     these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the
format dropdown you can find in the layer preview page. We don't have
a list of rules, checking what the other formats do and mimicking it,
is the de-facto approach when adding a new output format.

     Statistics
     ==========

     Given two layers A and B, both having ~450 columns. Layer A's geometry
     contains polygons (~300 vertices each). Layer B has point geometries
     (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

     Querying only ~1,000 and all ~10,000 features/rows from both layers:

     Layer A (heavy polygons)
     ------------------------

     ~1,000 rows bytes raw bytes gzip

     GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

     CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

     FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

     Layer A (heavy polygons)
     ------------------------

     ~10,000 rows bytes raw bytes gzip

     GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

     CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

     FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

     Layer B (lightweight points)
     ----------------------------

     ~1,000 rows bytes raw bytes gzip

     GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

     CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

     FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

     Layer B (lightweight points)
     ----------------------------

     ~10,000 rows bytes raw bytes gzip

     GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

     CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

     FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

     Conclusion
     ==========

     Savings mainly depend on the ratio between schema information and data.
     That is, savings are small if features have much more data than schema
     information. Typically, geometries may get quite large, so savings
     depend on the size/complexity of the feature's geometries. (e. g. tests
     where done using complex polygons vs. simple point objects)

     Also remarkable is that CompactJSON produces not much bigger responses
     (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
     do not compress very well and are bigger than compressed CompactJSON in
     all (and even bigger than compressed GeoJSON if geometries are heavy in
     some) cases.

Interesting finding indeed.

Cheers
Andrea

GeoServer Professional Services from the experts!

Visit
https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
l%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C7e9bb
4668f3048d0800908daa7bd8852%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C
0%7C638006729727251264%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdat
a=vvvpwIKpew14rnJvNcg5Z63FaDnxVtSIK8lRKmMBS2o%3D&amp;reserved=0
y%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslai
t
os.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a57
1
b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
4
wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%
7
C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;re
s
erved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
ly%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittausla
i
tos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a5
7
1b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
C
4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C
%
7C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;r
e
served=0>for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
a
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
I
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7
C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;
r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w
.geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmit
t
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c923
7
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJ
W
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
%
7C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp
;
reserved=0>

https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwit
t
er.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
a
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
I
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7
C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;
r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwi
t
ter.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmit
t
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c923
7
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJ
W
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
%
7C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp
;
reserved=0>

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

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
Geoserver-devel@lists.sourceforge.net
https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.sourceforge.net%2Flists%2Flistinfo%2Fgeoserver-devel&amp;data=05%7C0
1%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C7e9bb4668f3048d0800908daa7
bd8852%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638006729727251264
%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I
k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=xYL6KJHWeYrwrxGIwW4LNi
x4C7yYF6wW62xUsQ%2FpZDE%3D&amp;reserved=0

Hello Jukka and Andrea,

Jukka, apparently I misunderstood you. GeoServer's JSON is GeoJSON as its (backwards-) compatible with GeoJSON (the addition of the inofficial "crs" object does not prevent GeoJSON clients form reading the format). The same is true for OGC's JSON-FG.

The new Slim format is NOT compatible with GeoJSON as GeoJSON clients will fail reading it (expecting an object and not an array for the "properties" key).

Actually, I did not intend to invent a completely new format at all. The idea was just to address a shortcomming (for my mind) of GeoJSON and do some small optimizations. However, technically that is a new and incompatible format. I didn't really get this yesterday. Sorry for that.

As a Porsche *Cabrio* is still a Porsche, I'm sure that a name including the term GeoJSON will still be the best option. However, this assumes that the GeoJSON inventors actually specify that new variant (or support it, at least). Since we have several new formats like BrokJSON and JSON-FG *without* the term "Geo" in it, I guess that the GeoJSON guys are not really open to such a new variant. Jukka, you seem to know them quite a bit, what do you think about it? Is is worth asking them?

Otherwiese people have to deal with "meaningless" (sorry for that term) format names like "BrokJSON". What is it? Storing Broks in JSON? Is it about geodata? What are Broks? Do you know what people are behind BrokJSON?

Andrea recommended to also maintain a publicly visible site with some specifications for the new format like https://www.brokjson.dev/. That would be cool, of course. However, I'm first of all running a software company and have a couple of B2B projects using such huge GetFeature responses. I'm just looking for a *simple* solution which is available in the next days (not weeks or months). You know what I mean?

I think about just implementing BrokJSON with the new module. However, I guess that there are more changes in the client's reader required than with my current format. Also, BrokJSON seems not to preserve/include the actual "geometry_name", which may be required if the client has to filter some requests by geometries. Instead one has to relay on what DescribeFeatureTypes returned, only.

One last thing: currently the new module "falls back" to GeoServer's normal response for complex features. With a really new format (whether it's BrokJSON or something new), the format should just reject/fail if someone requests complex features in that new format, right?

What are your suggestions?

Cheers
Carsten

Am 06.10.2022 um 21:05 schrieb Rahkonen Jukka:

Hi,

I suggest to use something/anything else than "GeoJSON" in the name of the community module or as a common name of the format because this JSON variant is not valid GeoJSON https://www.rfc-editor.org/rfc/rfc7946. In my previous mail I used the OGC draft about the "JSON for features and geometries" as an example because it does not contain "GeoJSON" in the name for making it clear that it is not written by the authors of GeoJSON. And that despite the fact that actually JSON-FG (or whatever it will be called) is also valid GeoJSON because it only adds new features into the GeoJSON specification. I did not mean that Geoserver is delivering JSON-FG, it does not. Sorry for the confusion.

If you definitely want to use the name "Slim GeoJSON" as a name of the format it would be polite to contact the authors of the GeoJSON specification and ask their opinion. All the authors are named in the beginning of the RFC document but maybe Howard Butler or Sean Gilles are the best first contacts. Otherwise it is fine for me if you prefer to write your format just by yourself.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 20.09
Vastaanottaja: Rahkonen Jukka <jukka.rahkonen@anonymised.com>; Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

Hi Jukka,

you suggest a different name (e. g. "OGC Features and geometries JSON").
What parts of the module/format would you like to be renamed? Module name? Class name? outputFormat name? Name and description of the format/module in README.md?

GeoServer actually has a class named GeoJSONGetFeatureResponse for emitting JSON. My class SlimGeoJSONGetFeatureResponse is just an extension adding the slim capability. Also, in Format-DropDown on the Layer Preview page, JSON is announced as

...
GeoJSON
GeoJSON(JSONP)
...

On the other hand, after having read only some parts of the OGC draft document, does GeoServer really return JSON-FG? At first glance, GeoServer extends GeoJSON (it's no official GeoJSON) but it's still far from JSON-FG, isn't it? Maybe naming it "OGC Features and geometries JSON" isn't much more apt?

I just wanted to stay as close as possible with GeoServer as I'm extending *its* current JSON capabilities. GeoServer docs state:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.geoserver.org%2Flatest%2Fen%2Fuser%2Fservices%2Fwfs%2Foutputformats.html%23json-and-jsonp-output&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=ec1%2BnAsT0UIx4fdO0CQN3Hox0wrLjHF%2Fnz0Mg3SYOYY%3D&amp;reserved=0

The JSON output format (and JSONP if enabled) return feature content
as GeoJSON document. Here is an example of a simple GeoJSON file;

The "GeoJSON" is a link to https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeojson.org%2F&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=rGQjaaiJWl89NvfMs8t%2BFJqJF4Gc2MDJgmrOjdkBgHw%3D&amp;reserved=0

I do not know how GeoServer serializes complex features in JSON. Maybe that is closer to JSON-FG. For me, however, simple features encoded in JSON seem quite close to GeoJSON with the additon of a "crs" object (as initially recommended by GeoJSON in [GJ2008] and removed later due do interoperability concerns).

Although I'm open for changes, I believe that this small extension should likely not change much of the class it derives from (including terms and names), except that it removes space wasting redundancy (the "Slim" aspect).

Asking the gdal-dev list may be an option. However, this could start a very long running process with really lots of different opinions. For my mind, if someone is concerned whether GeoServer delivers GeoJSON, CRS-extended GeoJSON or even JSPN-FG - this should first be clairified (and possibly be changed) in GeoServer core. Later, extensions and modules could adapt these changes in a second step.

Cheers
Carsten

Am 06.10.2022 um 16:26 schrieb Rahkonen Jukka:

Hi,

I would consider some other name because this format is not GeoJSON. OGC is using name "OGC Features and geometries JSON" in its own project for enhancing GeoJSON https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.ogc.org%2FDRAFTS%2F21-045.html&amp;data=05|01|jukka.rahkonen%40maanmittauslaitos.fi|7e9bb4668f3048d0800908daa7bd8852|c4f8a63255804a1c92371d5a571b71fa|0|0|638006729727251264|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&amp;sdata=7KYdte0FMaaaUNIZ7mqVV6nwkzBfMnljjVHD%2FO%2FrazE%3D&amp;reserved=0. Perhaps your format could be something like "Slim JSON for features".
Maybe you could contact also other open source projects for collecting more opinions and suggestions. A short announcement on the gdal-dev mailing list might be a good start.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Carsten Klein <c.klein@anonymised.com>
Lähetetty: torstai 6. lokakuuta 2022 16.47
Vastaanottaja: Andrea Aime <andrea.aime@anonymised.com>
Kopio: geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response
in new more compact JSON/JSONP format

Hello Andrea,

I've just issued a PR on GitHub. The format and community module has been renamed to "Slim GeoJSON". "Slim" is shorter and likely easier to pronounce than compact (together with GeoJSON).

Sorry for struggling and messing around with Git. However, the final version of the PR should be OK for merging.

There are still some issues with QA checks and build checks (a test failed on Mac). I've written some more remarks on that in the PR on GitHub.

Cheers
Carsten

On Thu, Sep 29, 2022 at 10:17 AM Andrea Aime wrote

On Thu, Sep 22, 2022 at 10:08 AM Carsten Klein <c.klein@anonymised.com
<mailto:c.klein@anonymised.com>> wrote:

      Hello there,

      the new WFS output format CompactJSON, implemented as a community
      extension, is ready and works as expected. With our mentioned WFS
      responses (1.000+ features, 450 columns each), compared to standard
      GeoJSON, savings are between ~30% and ~70% (uncompressed) and between
      ~20% and ~50% with gzip content encoding. (see ´Statistics´ and
      ´Conclusion´ below)

      What are the next steps in order to contribute/publish the new
      community
      extension? Shall I commit all the stuff to my forked ´geoserver´
      repository and issue a CR including all changes required in existing
      core code (that is the existing JSON producer)?

Yes, make a Pull Request and send a CLA to OSGeo. When opening the PR
you have a checklist that needs to be satisfied, with links to the
relevant docs.
For reference, here it is:

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
h
ub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUEST
_
TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%
7
Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa%
7
C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
D
AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;
s
data=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved=
0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi
t
hub.com%2Fgeoserver%2Fgeoserver%2Fblob%2Fmain%2F.github%2FPULL_REQUES
T
_TEMPLATE.md&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi
%
7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a571b71fa
%
7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
M
DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp
;
sdata=uEICQlG9TNers9r7xIDHBWy%2BeqR%2BPQqL2juv84XbkUY%3D&amp;reserved

0>

      One last question: some of the WFS format extensions have one or more
      GeoServerApplication.properties files, which seem to provide human
      readable names for the actual MIME types or formats. Should I provide
      these, too? Where are these texts used? What are the rules?

It would be nice if you could add it, yes. They are used in the
format dropdown you can find in the layer preview page. We don't have
a list of rules, checking what the other formats do and mimicking it,
is the de-facto approach when adding a new output format.

      Statistics
      ==========

      Given two layers A and B, both having ~450 columns. Layer A's geometry
      contains polygons (~300 vertices each). Layer B has point geometries
      (created as a view of layer A with ST_Centroid(the_geom) AS the_geom).

      Querying only ~1,000 and all ~10,000 features/rows from both layers:

      Layer A (heavy polygons)
      ------------------------

      ~1,000 rows bytes raw bytes gzip

      GeoJSON: 19,098,924 (100%) 5,361,536 (100%)

      CompactJSON: 12,586,758 ( 66%) 4,234,995 ( 79%)

      FlatGeobuf: 10,093,224 ( 53%) 7,006,365 (130%)

      Layer A (heavy polygons)
      ------------------------

      ~10,000 rows bytes raw bytes gzip

      GeoJSON: 174,686,637 (100%) 45,414,569 (100%)

      CompactJSON: 109,700,539 ( 63%) 35,677,456 ( 78%)

      FlatGeobuf: 86,031,048 ( 49%) 58,857,835 (130%)

      Layer B (lightweight points)
      ----------------------------

      ~1,000 rows bytes raw bytes gzip

      GeoJSON: 9,443,980 (100%) 2,236,172 (100%)

      CompactJSON: 2,931,814 ( 31%) 1,174,942 ( 53%)

      FlatGeobuf: 3,710,902 ( 39%) 2,044,614 ( 91%)

      Layer B (lightweight points)
      ----------------------------

      ~10,000 rows bytes raw bytes gzip

      GeoJSON: 92,394,763 (100%) 18,923,302 (100%)

      CompactJSON: 27,408,665 ( 30%) 9,720,941 ( 51%)

      FlatGeobuf: 32,588,230 ( 35%) 16,824,845 ( 89%)

      Conclusion
      ==========

      Savings mainly depend on the ratio between schema information and data.
      That is, savings are small if features have much more data than schema
      information. Typically, geometries may get quite large, so savings
      depend on the size/complexity of the feature's geometries. (e. g. tests
      where done using complex polygons vs. simple point objects)

      Also remarkable is that CompactJSON produces not much bigger responses
      (aka is not much worse) than FlatGeobuf. However, FlatGeobuf responses
      do not compress very well and are bigger than compressed CompactJSON in
      all (and even bigger than compressed GeoJSON if geometries are heavy in
      some) cases.

Interesting finding indeed.

Cheers
Andrea

GeoServer Professional Services from the experts!

Visit
https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
l%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C7e9bb
4668f3048d0800908daa7bd8852%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C
0%7C638006729727251264%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC
JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdat
a=vvvpwIKpew14rnJvNcg5Z63FaDnxVtSIK8lRKmMBS2o%3D&amp;reserved=0
y%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittauslai
t
os.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a57
1
b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
4
wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%
7
C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;re
s
erved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbit.
ly%2Fgs-services-us&amp;data=05%7C01%7Cjukka.rahkonen%40maanmittausla
i
tos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c92371d5a5
7
1b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
C
4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C
%
7C&amp;sdata=aixKL%2FMfJ78fvCvg9icTQH%2FRTvr7SMuaEX3ejZWzBm0%3D&amp;r
e
served=0>for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
a
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
I
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7
C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp;
r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w
.geosolutionsgroup.com%2F&amp;data=05%7C01%7Cjukka.rahkonen%40maanmit
t
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c923
7
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJ
W
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
%
7C%7C%7C&amp;sdata=vVpcWGDkUsUGZiuizBkzoVXyw2r7C3g2yo3WlWqVeTg%3D&amp
;
reserved=0>

https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwit
t
er.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmitt
a
uslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c9237
1
d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJW
I
joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
7
C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp;
r
eserved=0
<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwi
t
ter.com%2Fgeosolutions_it&amp;data=05%7C01%7Cjukka.rahkonen%40maanmit
t
auslaitos.fi%7Cbe7e5c20e1084a56a2b608daa7a15866%7Cc4f8a63255804a1c923
7
1d5a571b71fa%7C0%7C0%7C638006608655183714%7CUnknown%7CTWFpbGZsb3d8eyJ
W
IjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
%
7C%7C%7C&amp;sdata=0nUuMX0boyNwqQQ0XUsPUmKkGFiV5dIrHo08ifFLkGg%3D&amp
;
reserved=0>

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

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
Geoserver-devel@lists.sourceforge.net
https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.sourceforge.net%2Flists%2Flistinfo%2Fgeoserver-devel&amp;data=05%7C0
1%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C7e9bb4668f3048d0800908daa7
bd8852%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638006729727251264
%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I
k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=xYL6KJHWeYrwrxGIwW4LNi
x4C7yYF6wW62xUsQ%2FpZDE%3D&amp;reserved=0

GeoServer’s JSON is GeoJSON as
its (backwards-) compatible with GeoJSON (the addition of the inofficial
“crs” object does not prevent GeoJSON clients form reading the format).
The same is true for OGC’s JSON-FG.

GeoJSON is an extensible format, you can add as much as you want, as long as the bits
mandated by the specification are there. What GeoServer returns is actually “classic GeoJSON”,
the earlier public specification before the RFC one, which recognized the need for CRS support.

The new Slim format is NOT compatible with GeoJSON as GeoJSON clients
will fail reading it (expecting an object and not an array for the
“properties” key).

Which makes calling it “GeoJSON” is confusing… at the same time GeoJSON
picked the most obvious name, it’s difficult to convey that a format is spatial in nature
and doge that “Geo”. “Slim Spatial JSON” does not quite roll off the tongue,
Brokjson does roll, but unless there is some language specific inner joke that I don’t understand,
it does not recall spatial/geo. Maybe just “SpatialJSON”? Of course it would not convey
that it’s slim. Maybe “TinyGeoJSON”? As a parallel TWKB, Tiny Well Known Binary, is also not WKB.
Putting everything in a word may carry out better that it’s not GeoJSON+ but something similar,
yet not quite the original. Just thinking out loud.

As a Porsche Cabrio is still a Porsche, I’m sure that a name including
the term GeoJSON will still be the best option. However, this assumes
that the GeoJSON inventors actually specify that new variant (or support
it, at least). Since we have several new formats like BrokJSON and
JSON-FG without the term “Geo” in it, I guess that the GeoJSON guys
are not really open to such a new variant. Jukka, you seem to know them
quite a bit, what do you think about it? Is is worth asking them?

Jukka will follow up, but yeah, I would ask them.

Andrea recommended to also maintain a publicly visible site with some
specifications for the new format like https://www.brokjson.dev/. That
would be cool, of course. However, I’m first of all running a software
company and have a couple of B2B projects using such huge GetFeature
responses. I’m just looking for a simple solution which is available
in the next days (not weeks or months). You know what I mean?

Painfully aware of the situation, yes. A community module does not require a big
specification, and there is no need to wait for a public site either. Maybe just place
a big bad warning message in a documentation file for the module, stating
“it’s not really GeoJSON, format name might change” and be open to amend
as the discussion unfolds.

One last thing: currently the new module “falls back” to GeoServer’s
normal response for complex features. With a really new format (whether
it’s BrokJSON or something new), the format should just reject/fail if
someone requests complex features in that new format, right?

I would suggest throwing an exception, yes.

Cheers
Andrea

···

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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

Hi,

For my mind it is usually better to ask beforehand that to correct possible misunderstandings afterwards. The GeoJSON authors are not my family friends but I have seen that they are responsive in the web. You can for example tag “hobu” and “sgillies” in GitHub and see what happens.

-Jukka Rahkonen-

···

Lähettäjä: Andrea Aime <andrea.aime@…6887…>
Lähetetty: perjantai 7. lokakuuta 2022 10.57
Vastaanottaja: Carsten Klein c.klein@anonymised.com
Kopio: Rahkonen Jukka jukka.rahkonen@anonymised.com; geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

On Fri, Oct 7, 2022 at 8:45 AM Carsten Klein <c.klein@anonymised.com> wrote:

GeoServer’s JSON is GeoJSON as
its (backwards-) compatible with GeoJSON (the addition of the inofficial
“crs” object does not prevent GeoJSON clients form reading the format).
The same is true for OGC’s JSON-FG.

GeoJSON is an extensible format, you can add as much as you want, as long as the bits

mandated by the specification are there. What GeoServer returns is actually “classic GeoJSON”,

the earlier public specification before the RFC one, which recognized the need for CRS support.

The new Slim format is NOT compatible with GeoJSON as GeoJSON clients
will fail reading it (expecting an object and not an array for the
“properties” key).

Which makes calling it “GeoJSON” is confusing… at the same time GeoJSON

picked the most obvious name, it’s difficult to convey that a format is spatial in nature

and doge that “Geo”. “Slim Spatial JSON” does not quite roll off the tongue,

Brokjson does roll, but unless there is some language specific inner joke that I don’t understand,

it does not recall spatial/geo. Maybe just “SpatialJSON”? Of course it would not convey

that it’s slim. Maybe “TinyGeoJSON”? As a parallel TWKB, Tiny Well Known Binary, is also not WKB.

Putting everything in a word may carry out better that it’s not GeoJSON+ but something similar,

yet not quite the original. Just thinking out loud.

As a Porsche Cabrio is still a Porsche, I’m sure that a name including
the term GeoJSON will still be the best option. However, this assumes
that the GeoJSON inventors actually specify that new variant (or support
it, at least). Since we have several new formats like BrokJSON and
JSON-FG without the term “Geo” in it, I guess that the GeoJSON guys
are not really open to such a new variant. Jukka, you seem to know them
quite a bit, what do you think about it? Is is worth asking them?

Jukka will follow up, but yeah, I would ask them.

Andrea recommended to also maintain a publicly visible site with some
specifications for the new format like https://www.brokjson.dev/. That
would be cool, of course. However, I’m first of all running a software
company and have a couple of B2B projects using such huge GetFeature
responses. I’m just looking for a simple solution which is available
in the next days (not weeks or months). You know what I mean?

Painfully aware of the situation, yes. A community module does not require a big

specification, and there is no need to wait for a public site either. Maybe just place

a big bad warning message in a documentation file for the module, stating

“it’s not really GeoJSON, format name might change” and be open to amend

as the discussion unfolds.

One last thing: currently the new module “falls back” to GeoServer’s
normal response for complex features. With a really new format (whether
it’s BrokJSON or something new), the format should just reject/fail if
someone requests complex features in that new format, right?

I would suggest throwing an exception, yes.

Cheers

Andrea

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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

Hi Jukka,

is it a problem if, after typing both “hobu” and “sgillies” do not popup in the suggestion list? I’ve only found Tim Schaub there. I’m not sure whether they will actually be mentioned/informed then… We might wait forever for an answer… while (true);

Carsten

···

Am 07.10.2022 um 10:27 schrieb Rahkonen Jukka:

Hi,

For my mind it is usually better to ask beforehand that to correct possible misunderstandings afterwards. The GeoJSON authors are not my family friends but I have seen that they are responsive in the web. You can for example tag “hobu” and “sgillies” in GitHub and see what happens.

-Jukka Rahkonen-

Lähettäjä: Andrea Aime andrea.aime@anonymised.com
Lähetetty: perjantai 7. lokakuuta 2022 10.57
Vastaanottaja: Carsten Klein c.klein@anonymised.com
Kopio: Rahkonen Jukka jukka.rahkonen@anonymised.com; geoserver-devel@lists.sourceforge.net; bjorn@anonymised.com
Aihe: Re: [Geoserver-devel] Enhancement: WFS Simple Feature Response in new more compact JSON/JSONP format

On Fri, Oct 7, 2022 at 8:45 AM Carsten Klein <c.klein@anonymised.com> wrote:

GeoServer’s JSON is GeoJSON as
its (backwards-) compatible with GeoJSON (the addition of the inofficial
“crs” object does not prevent GeoJSON clients form reading the format).
The same is true for OGC’s JSON-FG.

GeoJSON is an extensible format, you can add as much as you want, as long as the bits

mandated by the specification are there. What GeoServer returns is actually “classic GeoJSON”,

the earlier public specification before the RFC one, which recognized the need for CRS support.

The new Slim format is NOT compatible with GeoJSON as GeoJSON clients
will fail reading it (expecting an object and not an array for the
“properties” key).

Which makes calling it “GeoJSON” is confusing… at the same time GeoJSON

picked the most obvious name, it’s difficult to convey that a format is spatial in nature

and doge that “Geo”. “Slim Spatial JSON” does not quite roll off the tongue,

Brokjson does roll, but unless there is some language specific inner joke that I don’t understand,

it does not recall spatial/geo. Maybe just “SpatialJSON”? Of course it would not convey

that it’s slim. Maybe “TinyGeoJSON”? As a parallel TWKB, Tiny Well Known Binary, is also not WKB.

Putting everything in a word may carry out better that it’s not GeoJSON+ but something similar,

yet not quite the original. Just thinking out loud.

As a Porsche Cabrio is still a Porsche, I’m sure that a name including
the term GeoJSON will still be the best option. However, this assumes
that the GeoJSON inventors actually specify that new variant (or support
it, at least). Since we have several new formats like BrokJSON and
JSON-FG without the term “Geo” in it, I guess that the GeoJSON guys
are not really open to such a new variant. Jukka, you seem to know them
quite a bit, what do you think about it? Is is worth asking them?

Jukka will follow up, but yeah, I would ask them.

Andrea recommended to also maintain a publicly visible site with some
specifications for the new format like https://www.brokjson.dev/. That
would be cool, of course. However, I’m first of all running a software
company and have a couple of B2B projects using such huge GetFeature
responses. I’m just looking for a simple solution which is available
in the next days (not weeks or months). You know what I mean?

Painfully aware of the situation, yes. A community module does not require a big

specification, and there is no need to wait for a public site either. Maybe just place

a big bad warning message in a documentation file for the module, stating

“it’s not really GeoJSON, format name might change” and be open to amend

as the discussion unfolds.

One last thing: currently the new module “falls back” to GeoServer’s
normal response for complex features. With a really new format (whether
it’s BrokJSON or something new), the format should just reject/fail if
someone requests complex features in that new format, right?

I would suggest throwing an exception, yes.

Cheers

Andrea

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

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