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

Cannot set the PROJECTION value correctly #63

Closed
janpisl opened this issue Jul 22, 2018 · 2 comments
Closed

Cannot set the PROJECTION value correctly #63

janpisl opened this issue Jul 22, 2018 · 2 comments

Comments

@janpisl
Copy link

@janpisl janpisl commented Jul 22, 2018

This is (a part of) code I use to open a template of a MapFile and set some values:

import mappyfile

d = mappyfile.open('test.map')


d["NAME"] = "testpg1"
d["PROJECTION"] = "init=epsg:4326" 

This is (a part of) the resulting MapFile:

MAP
    NAME "testpg1"
    PROJECTION
        "i"
        "n"
        "i"
        "t"
        "="
        "e"
        "p"
        "s"
        "g"
        ":"
        "4"
        "3"
        "2"
        "6"
    END

For some reason, the value I set for PROJECTION appears in the MapFile like this - each character on a new line. All the other parameters I set (like NAME) are ok. I have tried with several different MapFiles and it behaved the same way.

I am new to MapServer and mappyfile so there might be something very obvious that I am overlooking.

@geographika
Copy link
Owner

@geographika geographika commented Jul 22, 2018

Hi,

The following should work:
d["PROJECTION"] = ["init=epsg:4326"]

There is an issue in that both lists and strings should be allowed, so I will need to fix the pretty printer to allow this - thanks for reporting it.

The list option is to allow projection blocks such as:


  PROJECTION
    "proj=utm"
    "zone=12"
    "ellps=WGS84"
    "towgs84=1,0,0"
  END

@geographika
Copy link
Owner

@geographika geographika commented Jul 24, 2018

Fixed in 0.7.2 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.