Skip to content
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

Fix JSON encoding #100

Merged
merged 2 commits into from
Dec 1, 2022
Merged

Fix JSON encoding #100

merged 2 commits into from
Dec 1, 2022

Conversation

kdubuc
Copy link
Contributor

@kdubuc kdubuc commented Nov 16, 2022

We experimenting bugs with JSON encoding. Double quote were not escaped correctly. GeoJSON was incorrect, while XML response was OK.

Example :

{
    "type": "FeatureCollection",
    "crs": {
        "type": "name",
        "properties": {
            "name": "urn:ogc:def:crs:EPSG::4326"
        }
    },
    "features": [
        {
            "type": "Feature",
            "properties": {
                "id": 1,
                "codepostal": 62300,
                "temperature": 11,
                "nom": \"lens\"}, "geometry":{"type":"Point","bbox":[2.831830,50.428930,2.831830,50.428930],"coordinates":[2.83183,50.42893]}}
,{"type":"Feature", "properties":{"id": 2, "codepostal": 62880, "temperature": 12, "nom": \"vendin\"}, "geometry":{"type":"Point","bbox":[2.865986,50.475517,2.865986,50.475517],"coordinates":[2.865986,50.475517]}}
,{"type":"Feature", "properties":{"id": 3, "codepostal": 62680, "temperature": 14, "nom": \"mericourt\"}, "geometry":{"type":"Point","bbox":[2.866865,50.401526,2.866865,50.401526],"coordinates":[2.866865,50.401526]}}
,{"type":"Feature", "properties":{"id": 4, "codepostal": 62000, "temperature": 13, "nom": \"arras\"}, "geometry":{"type":"Point","bbox":[2.777535,50.291002,2.777535,50.291002],"coordinates":[2.777535,50.291002]}}
,{"type":"Feature", "properties":{"id": 5, "codepostal": 20000, "temperature": 24, "nom": \"ajaccio\"}, "geometry":{"type":"Point","bbox":[-74.005941,40.712784,-74.005941,40.712784],"coordinates":[-74.005941,40.712784]}}
]}

We propose this PR to fix that.

@jmckenna
Copy link
Member

looks acceptable here, thanks @kdubuc

@jmckenna jmckenna merged commit 1e61f2b into MapServer:main Dec 1, 2022
@jmckenna jmckenna added this to the 1.2.1 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants