geonode icon indicating copy to clipboard operation
geonode copied to clipboard

Suspicious bounding box in maps

Open etj opened this issue 4 years ago • 3 comments

Actual Behavior

The reported BBox coordinates in most maps (both in API responses and in detail page) are not the ones used in the viewport; furthermore coords seem to be in the format ±x0, ±y0, e.g.:

curl https://development.demo.geonode.org/api/v2/maps/ | jq . | grep -a25 ll_bbox_polygon

Result:

      "ll_bbox_polygon": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -87.889539100883,
              -61.5235976928068
            ],
            [
              -87.889539100883,
              61.523275712640626
            ],
            [
              87.89171089911697,
              61.523275712640626
            ],
            [
              87.89171089911697,
              -61.5235976928068
            ],
            [
              -87.889539100883,
              -61.5235976928068
            ]
          ]
        ]
More results... # Result in development demo site
    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -87.889539100883,
            -61.5235976928068
          ],
          [
            -87.889539100883,
            61.523275712640626
          ],
          [
            87.89171089911697,
            61.523275712640626
          ],
          [
            87.89171089911697,
            -61.5235976928068
          ],
          [
            -87.889539100883,
            -61.5235976928068
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -351.56244661051113,
            -246.09367719958718
          ],
          [
            -351.56244661051113,
            246.09382151899692
          ],
          [
            351.56255338948876,
            246.09382151899692
          ],
          [
            351.56255338948876,
            -246.09367719958718
          ],
          [
            -351.56244661051113,
            -246.09367719958718
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -1.373168066067418,
            -0.960926754581178
          ],
          [
            -1.373168066067418,
            0.961680530745797
          ],
          [
            1.373413965182582,
            0.961680530745797
          ],
          [
            1.373413965182582,
            -0.960926754581178
          ],
          [
            -1.373168066067418,
            -0.960926754581178
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -21.97240890501938,
            -15.380490569400779
          ],
          [
            -21.97240890501938,
            15.38122610031599
          ],
          [
            21.972903594980615,
            15.38122610031599
          ],
          [
            21.972903594980615,
            -15.380490569400779
          ],
          [
            -21.97240890501938,
            -15.380490569400779
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -2.746482596915883,
            -1.922218072478219
          ],
          [
            -2.746482596915883,
            1.922996480036018
          ],
          [
            2.746681465584116,
            1.922996480036018
          ],
          [
            2.746681465584116,
            -1.922218072478219
          ],
          [
            -2.746482596915883,
            -1.922218072478219
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -43.94525802207355,
            -30.761342186534637
          ],
          [
            -43.94525802207355,
            30.76209100126081
          ],
          [
            43.94536697792646,
            30.76209100126081
          ],
          [
            43.94536697792646,
            -30.761342186534637
          ],
          [
            -43.94525802207355,
            -30.761342186534637
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -21.9735765060277,
            -15.380520229721002
          ],
          [
            -21.9735765060277,
            15.381196760348443
          ],
          [
            21.971735993972292,
            15.381196760348443
          ],
          [
            21.971735993972292,
            -15.380520229721002
          ],
          [
            -21.9735765060277,
            -15.380520229721002
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -87.89148604090889,
            -61.52310022288787
          ],
          [
            -87.89148604090889,
            61.523767920025655
          ],
          [
            87.88976395909114,
            61.523767920025655
          ],
          [
            87.88976395909114,
            -61.52310022288787
          ],
          [
            -87.89148604090889,
            -61.52310022288787
          ]
        ]
      ]

    "ll_bbox_polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ],
          [
            85.05112877764508,
            -179.9999999749438
          ]
        ]
      ]

Expected Behavior

The correct coordinates should be returned.

Steps to Reproduce the Problem

Either use an API call like the one in the description, or go into the detail page of a map.

Specifications

  • GeoNode version:
    • 3.3.x (develoment) has this problem
    • master: seems ok
    • 3.2.x (stable): maps returns a null bbox.

etj avatar Jan 11 '22 16:01 etj

@etj with the recent commits this issue is fixed on new maps. If you try to create a new map on development.demo now the ll_bbox is correctly set, e.g.:

https://development.demo.geonode.org/api/v2/maps?filter{title.contains}=suspic

   "bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -2.700057707232048,
                            44.5131772623323
                        ],
                        [
                            -2.700057707232048,
                            39.66902292255558
                        ],
                        [
                            19.272598542767955,
                            39.66902292255558
                        ],
                        [
                            19.272598542767955,
                            44.5131772623323
                        ],
                        [
                            -2.700057707232048,
                            44.5131772623323
                        ]
                    ]
                ]
            },
            "ll_bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -2.700057707232048,
                            44.5131772623323
                        ],
                        [
                            -2.700057707232048,
                            39.66902292255558
                        ],
                        [
                            19.272598542767955,
                            39.66902292255558
                        ],
                        [
                            19.272598542767955,
                            44.5131772623323
                        ],
                        [
                            -2.700057707232048,
                            44.5131772623323
                        ]
                    ]
                ]
            },

The bbox is also updated when you save the map:

            "bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            8.739946399877244,
                            43.89392747470173
                        ],
                        [
                            8.739946399877244,
                            45.40455203799242
                        ],
                        [
                            11.486528431127244,
                            45.40455203799242
                        ],
                        [
                            11.486528431127244,
                            43.89392747470173
                        ],
                        [
                            8.739946399877244,
                            43.89392747470173
                        ]
                    ]
                ]
            },
            "ll_bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            8.739946399877244,
                            43.89392747470173
                        ],
                        [
                            8.739946399877244,
                            45.40455203799242
                        ],
                        [
                            11.486528431127244,
                            45.40455203799242
                        ],
                        [
                            11.486528431127244,
                            43.89392747470173
                        ],
                        [
                            8.739946399877244,
                            43.89392747470173
                        ]
                    ]
                ]
            },

On master.demo instance seems to be working as espected

            "bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1039256.5749806536,
                            4142429.93414199
                        ],
                        [
                            3657034.4428605754,
                            4142429.93414199
                        ],
                        [
                            3657034.4428605754,
                            6177489.375206523
                        ],
                        [
                            -1039256.5749806536,
                            6177489.375206523
                        ],
                        [
                            -1039256.5749806536,
                            4142429.93414199
                        ]
                    ]
                ]
            },
            "ll_bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -9.335800654268267,
                            34.8419976625446
                        ],
                        [
                            32.85169934573174,
                            34.8419976625446
                        ],
                        [
                            32.85169934573174,
                            48.422831149380734
                        ],
                        [
                            -9.335800654268267,
                            48.422831149380734
                        ],
                        [
                            -9.335800654268267,
                            34.8419976625446
                        ]
                    ]
                ]
            },
            "srid": "EPSG:3857",

updated

            "bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            1077780.0369270954,
                            5249819.414250314
                        ],
                        [
                            1371298.225542172,
                            5249819.414250314
                        ],
                        [
                            1371298.225542172,
                            5376857.755260278
                        ],
                        [
                            1077780.0369270954,
                            5376857.755260278
                        ],
                        [
                            1077780.0369270954,
                            5249819.414250314
                        ]
                    ]
                ]
            },
            "ll_bbox_polygon": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            9.68186280090512,
                            42.59031071316556
                        ],
                        [
                            12.31858155090512,
                            42.59031071316556
                        ],
                        [
                            12.31858155090512,
                            43.424812159773886
                        ],
                        [
                            9.68186280090512,
                            43.424812159773886
                        ],
                        [
                            9.68186280090512,
                            42.59031071316556
                        ]
                    ]
                ]
            },
            "srid": "EPSG:3857",

afabiani avatar Mar 22 '22 09:03 afabiani

@afabiani is there a way to fix the existing maps? I guess that a script would be useful here.

etj avatar Mar 24 '22 08:03 etj

@etj saving them again once GeoNode has been updated should fix automatically the bboxes too.

afabiani avatar Mar 24 '22 09:03 afabiani