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

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

Projects

None yet

3 participants

@yjacolin
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 unicolet was assigned Dec 28, 2012
@unicolet unicolet added a commit to unicolet/mapserver that referenced this issue Jan 29, 2013
@unicolet unicolet add missing functions to outputformatObj that allow iterating over th…
…e format's OPTIONS #4553
a52c440
@unicolet
Contributor

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

@yjacolin
Contributor

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

@unicolet
Contributor

Documented the new methods in the docs:

mapserver/docs@9db4135

@yjacolin
Contributor

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
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
Contributor
yjacolin commented Feb 1, 2013

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

Y.

@yjacolin
Contributor
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
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
Contributor
unicolet commented Feb 2, 2013

Closed in pull request referenced above

@unicolet unicolet closed this Feb 2, 2013
@mkofahl mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
@unicolet unicolet add missing functions to outputformatObj that allow iterating over th…
…e format's OPTIONS #4553
6dd0df8
@tbonfort
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
Member

re-milestoning to 6.4

@tbonfort tbonfort closed this Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment