MapServer / MapServer-documentation

Source repository for the MapServer documentation, for the live website. Please submit pull requests to the 'main' branch.
https://mapserver.org
Other
34 stars 68 forks source link

Undocumented WEB EXTENT keyword #461

Open geographika opened 3 years ago

geographika commented 3 years ago

Currently, there is no mention of EXTENT at https://mapserver.org/mapfile/web.html

It is read at:

https://github.com/MapServer/MapServer/blob/1dd7b072be5aa307d9dcb120dd2fa7f3f0dd041b/mapfile.c#L5746

It is written out to the Mapfile at:

https://github.com/MapServer/MapServer/blob/1dd7b072be5aa307d9dcb120dd2fa7f3f0dd041b/mapfile.c#L5678

From the MapScript docs and mapserver.h comments it is used as the clipping extent. I'm not sure what this actually means though.

geographika commented 3 years ago

Trying to see how this is used. I thought it might automatically clip data, for example hiding one of the points below. However both are displayed when running mapserv QUERY_STRING="map=style_position.map&mode=map&layer=center" > temp.png

MAP

STATUS ON
EXTENT 0 0 400 300
SIZE 200 150
IMAGETYPE png24
symbolset "symbolset"

WEB
    EXTENT 0 0 100 100
END
LAYER
    NAME "center"
    TYPE POINT
    STATUS on
    CLASS
        STYLE
            COLOR 0 0 255
            SIZE 30
            WIDTH 1
            SYMBOL "circle"
        END
    END

    FEATURE POINTS 50 50 END END
    FEATURE POINTS 200 200 END END
END

END

test

sdlime commented 3 years ago

Let me document what the code is actually doing and add it to the ticket. Originally the idea was to alter the computed extent. Not clipping so much as an offset, so if one panned too far to the west it would snap it back in bounds but he scale would be preserved. I don't recall the behavior if the requested extent contains the web extent - that might just leave it alone (that would make sense to me). A more interesting test with you example might be to set the map extent to -50 0 0 50...

--Steve

From: Seth G @.> Sent: Monday, March 8, 2021 3:56 PM To: MapServer/MapServer-documentation @.> Cc: Subscribed @.***> Subject: Re: [MapServer/MapServer-documentation] Undocumented WEB EXTENT keyword (#461)

This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center.


Trying to see how this is used. I thought it might automatically clip data, for example hiding one of the points below. However both are displayed when running mapserv QUERY_STRING="map=style_position.map&mode=map&layer=center" > temp.png

MAP

STATUS ON

EXTENT 0 0 400 300

SIZE 200 150

IMAGETYPE png24

symbolset "symbolset"

WEB

EXTENT 0 0 100 100

END

LAYER

NAME "center"

TYPE POINT

STATUS on

CLASS

    STYLE

        COLOR 0 0 255

        SIZE 30

        WIDTH 1

        SYMBOL "circle"

    END

END

FEATURE POINTS 50 50 END END

FEATURE POINTS 200 200 END END

END

END

[test]https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F490840%2F110386950-41429e00-8061-11eb-8191-659c5e7772e8.png&data=04%7C01%7Csteve.lime%40state.mn.us%7C23584351e53d4cf543b008d8e27cedc1%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637508373473684617%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LA3cLkAO%2FEIyV1Ye3gXKG4BmfU8RqXwT0PPo1popAeg%3D&reserved=0

- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMapServer%2FMapServer-documentation%2Fissues%2F461%23issuecomment-793108784&data=04%7C01%7Csteve.lime%40state.mn.us%7C23584351e53d4cf543b008d8e27cedc1%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637508373473694563%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jJULFvCQ89k7oyPW2preFKOWww4C3hoYcEG31ZFLVF4%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAMGN6YELBYRDYN444AIVQLTCVBWFANCNFSM4YP2URCQ&data=04%7C01%7Csteve.lime%40state.mn.us%7C23584351e53d4cf543b008d8e27cedc1%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637508373473694563%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SGAq%2BnDKP%2Fe0dd5y7OpRjA41IDwI%2BcaWnDkLm9y9YX4%3D&reserved=0.