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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@geographika

geographika Jul 22, 2018

Owner

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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@geographika

geographika Jul 24, 2018

Owner

Fixed in 0.7.2 release

Owner

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