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

We can't get option in outputformat obj in MapScript #4553

Closed
yjacolin opened this issue Dec 28, 2012 · 11 comments
Closed

We can't get option in outputformat obj in MapScript #4553

yjacolin opened this issue Dec 28, 2012 · 11 comments
Assignees
Milestone

Comments

@yjacolin
Copy link
Contributor

Outputformat obj can contains FORMATOPTION parameters. In python we can't get any list of existing FORMATOPTION, so we should know which are used:

>>> map = mapscript.mapObj('data/world_mapfile.map')
>>> of = map.getOutputFormatByName('png24')
>>> of.getOption("QUANTIZE_FORCE") 
'on'
@unicolet
Copy link
Contributor

@yjacolin Can you take a look at the above pr before I merge it?

@yjacolin
Copy link
Contributor Author

@unicolet sorry I have not tested this yet. I will try it tonight.

@unicolet
Copy link
Contributor

Documented the new methods in the docs:

MapServer/MapServer-documentation@9db4135

@yjacolin
Copy link
Contributor Author

I think I built successfully Python/MapScript, but:

import mapscript
map  = mapscript.mapObj("mapfile.map")
of = map.getOutputFormatByName('png24')
dir(of)

but I have no getNumformatoptions() or getOptionAt() methods.

mapscript.MS_VERSION shows 6.3-dev
and I used: git://github.com/unicolet/mapserver.git

Y.

@unicolet
Copy link
Contributor

unicolet commented Feb 1, 2013

Works for me. Did you run make install?

Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapscript
>>> map = mapObj('../../tests/test.map')
>>> of = map.getOutputFormat(0)
>>> of.getOptionAt(0)

@yjacolin
Copy link
Contributor Author

yjacolin commented Feb 1, 2013

yes I did it. I will do more test this week-end. Sorry for this delay.

Y.

@yjacolin
Copy link
Contributor Author

yjacolin commented Feb 2, 2013

@unicolet I successfuly build mapserver and test your new method (note to myself: please use the correct branch next time). Here are my comments:

  • your doc is not correct for getNumformatoptions() and getNumoutputformats(): numformatoptions and numoutputformats are the correct properties to use.
  • with my mapfile, I get
option = of.getOptionAt(0)
print option
None

dir(option) don't show any property, am I wrong?

@unicolet
Copy link
Contributor

unicolet commented Feb 2, 2013

Can you share a meaningful map file together with the expected list of options?

As per the methods names I am pretty sure I got them right in the docs, I will run some more python tests soon.

@unicolet
Copy link
Contributor

unicolet commented Feb 2, 2013

Closed in pull request referenced above

@unicolet unicolet closed this as completed Feb 2, 2013
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
@tbonfort
Copy link
Member

@unicolet this issue is milestoned for 6.2.1 but has only been applied to master. Should the milestone be updated or should I backport ?

@tbonfort tbonfort reopened this Apr 13, 2013
@tbonfort
Copy link
Member

re-milestoning to 6.4

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

No branches or pull requests

3 participants