glob3mobile / g3m

The multiplatform advanced visualization framework
http://www.glob3mobile.com/
Other
116 stars 56 forks source link

Shape distortion when rendering GeoJSON around the north pole #117

Open hjoliveira opened 9 years ago

hjoliveira commented 9 years ago

Hello,

I've run into an issue when trying to render a GeoJSON polygon that includes the North Pole on the globe. The shape appears distorted as in the attached image (it should be a perfect circle).

screen shot 2015-06-08 at 11 59 37

If I have a shape that includes the North Pole precisely as one of vertices, the shape simply isn't rendered.

Could this be a bug or am I doing something wrong?

Thank you!

Henrique

DiegoGomezDeck commented 9 years ago

hi @hjoliveira

Ohhh, the poles madness again!!!! :P

Can you post here the sample shape?

BTW, which projection are you using for the ground-layers?

hjoliveira commented 9 years ago

Hi @DiegoGomezDeck

This is the shape:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            15.48674899355316,
                            56.56052331874932
                        ],
                        [
                            7.47009414628575,
                            56.73315533175821
                        ],
                        [
                            -0.571391943016722,
                            57.24815587197174
                        ],
                        [
                            -8.665993500029963,
                            58.09687469155806
                        ],
                        [
                            -16.84930918897867,
                            59.26499647009454
                        ],
                        [
                            -25.16905724174466,
                            60.73262429052682
                        ],
                        [
                            -33.69165370551051,
                            62.47424725914873
                        ],
                        [
                            -42.51195281218509,
                            64.45840841361095
                        ],
                        [
                            -51.76854792532615,
                            66.64675899046371
                        ],
                        [
                            -61.66876867936151,
                            68.99193209393829
                        ],
                        [
                            -72.53009204819159,
                            71.43315671184006
                        ],
                        [
                            -84.84632019565215,
                            73.88752856642208
                        ],
                        [
                            -99.37506226286493,
                            76.23325691605947
                        ],
                        [
                            -117.160942002192,
                            78.28111477772049
                        ],
                        [
                            -139.1125734438554,
                            79.74554543848507
                        ],
                        [
                            -164.5132510064468,
                            80.29008497468658
                        ],
                        [
                            170.0860714309619,
                            79.74554543848502
                        ],
                        [
                            148.1344399892984,
                            78.28111477772049
                        ],
                        [
                            130.3485602499713,
                            76.23325691605952
                        ],
                        [
                            115.8198181827586,
                            73.88752856642213
                        ],
                        [
                            103.503590035298,
                            71.43315671184008
                        ],
                        [
                            92.64226666646789,
                            68.99193209393829
                        ],
                        [
                            82.74204591243252,
                            66.64675899046371
                        ],
                        [
                            73.48545079929147,
                            64.45840841361102
                        ],
                        [
                            64.66515169261687,
                            62.47424725914878
                        ],
                        [
                            56.14255522885105,
                            60.73262429052684
                        ],
                        [
                            47.82280717608504,
                            59.26499647009461
                        ],
                        [
                            39.63949148713636,
                            58.09687469155811
                        ],
                        [
                            31.5448899301231,
                            57.2481558719718
                        ],
                        [
                            23.50340384082065,
                            56.73315533175823
                        ],
                        [
                            15.48674899355316,
                            56.56052331874932
                        ]
                    ]
                ]
            },
            "properties": {
                "name": "test",
                "stroke": "0000ff",
                "stroke-opacity": 1,
                "fill-opacity": 0
            }
        }
    ]
}

It's simple longitude/latitude coordinates. I'm loading it with a custom symbolizer that renders everything in white.

Thanks,

Henrique

hjoliveira commented 9 years ago

Hi @DiegoGomezDeck

Thanks for your initial answer. Do you have any idea how this could be fixed?

DiegoGomezDeck commented 9 years ago

Hi @hjoliveira

Can you tell me which Layers are you using? Are they mercator?

hjoliveira commented 9 years ago

Hi @DiegoGomezDeck

It's EPSG:3995

I also tried setting the crs element on the feature, but it didn't work:

"crs": {
    "type": "name",
    "properties": {
         "name": "urn:ogc:def:crs:EPSG:3995"
    }
}

Would it help to use another projection?