-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEOS-11461: Support MapML embedded viewer on HTML for WFS GetFeature #369
Conversation
} else if (rawKvp.containsKey("SRS")) { | ||
srs = (String) rawKvp.get("SRS"); | ||
} else { | ||
srs = "EPSG:4326"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we default to OSMTILE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gather that because OSMTILE does not include the poles, that Andrea prefers to use WGS84. I can live with that. On the other hand, "OSMTILE" is the default map projection used by the <mapml-viewer> if you don't specify the projection
attribute. That shouldn't impact GeoServer though, since as Andrea points out the OSMTILE can't cover all earthly data.
WGS84
could be the default here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actual live mapml should be served as text/mapml
. The preview application is (now, in WMS) served as text/html; subtype=mapml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we default to OSMTILE?
I should be more clear: I think we should default to WGS84 to be consistent with how it's done on the WMS side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we are defaulting to WGS84 indeed.
@@ -31,6 +33,9 @@ public final class MapMLConstants { | |||
/** format name */ | |||
public static final String FORMAT_NAME = "MAPML"; | |||
|
|||
/** format name needed to have a parseable format in WFS 1.0.0 capabilities */ | |||
public static final String HTML_FORMAT_NAME = "MAPML-HTML"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WFS 1.0.0 requires a simple format name to be reported in the capabilities document.
This will reported in 1.1.0 and 2.0.0 too, together with the text/html; subtype=mapml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about text/html; subtype=mapml? This was used in the WMS preview for example. The important thing is to serve content (when asked for mapml) as text/mapml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. We are indeed using "text/html; subtype=mapml" to serve WFS as HTML (doing the same thing that WMS does).
The problem is in WFS 1.0.0 that is not supporting that as element name for the capabilities due to this check.
So we ended up exposing it as MAPML-HTML
as well as text/html; subtype=mapml
(where the first one makes WFS 1.0.0 capabilities happy).
The WFS KML output format does a similar thing, using KML for WFS 1.0.0 (see above screenshot)
This will result in having variations of the same output listed in WFS 1.1.0 and 2.0.0.
Check the below 1.1.0 WFS capabilities document where KML output is listed with the 3 variations (marked in red) and MapML-HTML in 2 variations (marked in yellow)
Long story short:
When requesting WFS for MAPML
, it will indeed serve content as text/mapml
When requesting WFS 1.0.0 for MAPML-HTML
or text/html; subtype=mapml
it will indeed serve the Mapml client as text/html; subtype=mapml
.
Does it clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does, thank you very much! So the MAPML value gets sent under the text/mapml
Content-type: text/mapml. Curious why text/csv didn't get caught by that rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's just that the CSV rule is implemented but the MAPML rule not quite yet, perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I understand now but in no case do we see text/mapml
in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed you don't, it's already the case in an un-modified GeoServer, e.g.:
Map<String, Object> rawKvp = Dispatcher.REQUEST.get().getRawKvp(); | ||
String value = (String) rawKvp.get("SRSNAME"); | ||
if (value == null) value = (String) rawKvp.get("SRS"); | ||
throw new ServiceException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we are using the same logic that is applied by WMS when producing the HTML. Only the 4 MapML supported CRSs will be accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having time to get into the code, I must point out that we currently can serve any WFS SRS into MapML, realizing that we can't view that content without a custom TCRS definition, but it still may be useful to serve it for completeness' sake. The technique I've used in the viewer is to disallow / throw on projection
values that contain a :
colon. So when serving a text/mapml document as EPSG:1234 for example, we could create a custom TCRS definition for EPSG1234
and serve that. If the projection is unknown i.e. no custom TCRS definition exists, the viewer reports a different problem. The purpose of this is to avoid having people think that EPSG:codes code be uses as TCRS names directly. i.e. you need the extra defintional stuff provided by a TCRS, it's not the same thing as an EPSG:code.
52f9fed
to
c7c612d
Compare
Hi @prushforth , based on your feedbacks, I will create the official PR in GeoServer if no changes are required. |
I apologize I have been looking at Joseph's PR, I will just build this one before I give the thumb's up :-) |
Sounds good. Apart from the defaulting to OSMTILE, I am quite happy with this! edit: maybe I'm wrong about it defaulting to osmtile. Now I'm thinking it's working. I think the content negotiation based on links was fooling me. |
Ok. Note that we weren't proposing to default to OSMTILE. That was a question since we were defaulting to WGS84. |
Sorry its confusion on my part due to getting up at 3:30 am this week please proceed, lgtm |
Dang, merged by mistake. Will clean up the history of the geosolutions fork. |
GEOS-11461
Checklist
main
branch (backports managed later; ignore for branch specific issues).For core and extension modules:
[GEOS-XYZWV] Title of the Jira ticket
.Notes:
The exisiting MapML HTML Embedded Viewer for WMS will thrown an invalid SRS exception if the requested SRS is not one of the 4 supported by MapML. The same logic has been applied when building the MapML HTML Embedded viewer for WFS.
WFS 1.0.0 requires a simple format name to be reported in the capabilities document (i.e. MAPML-HTML). This will reported in 1.1.0 and 2.0.0 too, together with the text/html; subtype=mapml