[gdal-dev] gdal Info Options Python

lorenzoNais lorenzo.bernardi at nais-solutions.it
Wed Mar 29 07:45:15 PDT 2017


You can try subprocess.check_output with -json option.
It will save a structure with your desidered information.

https://docs.python.org/2/library/subprocess.html

2017-03-29 16:18 GMT+02:00 Even Rouault-2 [via OSGeo.org] <
ml-node+s1560n5314820h56 at n6.nabble.com>:

> On mercredi 29 mars 2017 06:51:11 CEST Johan de Braak wrote:
>
> > Hi all,
>
> >
>
> > Using gdal.Info in Python, I would like to have my result as a dictionary
>
> > instead of a string. I found that in gdal.InfoOptions I am able to
> specify
>
> > 'format'. By default, this is set to 'text', however changing this to
> 'dict'
>
> > (or anything really) does still result in a string.
>
> >
>
> > Is there a way to get the gdal.Info result as something else than a
> string?
>
>
>
> Yes: format = 'json'
>
>
>
> >
>
> > Johan
>
> >
>
> >
>
> >
>
> > --
>
> > View this message in context:
>
> > http://osgeo-org.1560.x6.nabble.com/gdal-Info-Options-
> Python-tp5314816.html
>
> > Sent from the GDAL - Dev mailing list archive at Nabble.com.
>
> > _______________________________________________
>
> > gdal-dev mailing list
>
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5314820&i=0>
>
> > https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>
> _______________________________________________
> gdal-dev mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5314820&i=1>
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://osgeo-org.1560.x6.nabble.com/gdal-Info-Options-
> Python-tp5314816p5314820.html
> To start a new topic under GDAL - Dev, email ml-node+s1560n3742093h19 at n6.
> nabble.com
> To unsubscribe from GDAL - Dev, click here
> <http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3742093&code=bG9yZW56by5iZXJuYXJkaUBuYWlzLXNvbHV0aW9ucy5pdHwzNzQyMDkzfDE4MzMwMjYwMDc=>
> .
> NAML
> <http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 

Lorenzo Bernardi

NAIS Srl (www.nais-solutions.it)
Via Andrea Noale 345/A
00155 Rome – Italy




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-Info-Options-Python-tp5314816p5314824.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170329/42d7099d/attachment.html>


More information about the gdal-dev mailing list