Is it possible to read GML or KML files with Fiona?











up vote
-1
down vote

favorite












I'd like to know if it's possible to read/write GML files (or even KML files) using Fiona.



Fiona documents don't specify what drivers we can use. I read some answers about the drivers that are avalaible but I still haven't figured out the right answer.



These two different sentences print a different number of drivers. The first one doesn't include GML o KML (in fact there are very few formats supported).



print(fiona.supported_drivers)


vs



print('n'.join(sorted(fiona.drivers().drivers())))


I know how to do it using GDAL/OGR but I want to do the same using Fiona if it's possible.










share|improve this question


























    up vote
    -1
    down vote

    favorite












    I'd like to know if it's possible to read/write GML files (or even KML files) using Fiona.



    Fiona documents don't specify what drivers we can use. I read some answers about the drivers that are avalaible but I still haven't figured out the right answer.



    These two different sentences print a different number of drivers. The first one doesn't include GML o KML (in fact there are very few formats supported).



    print(fiona.supported_drivers)


    vs



    print('n'.join(sorted(fiona.drivers().drivers())))


    I know how to do it using GDAL/OGR but I want to do the same using Fiona if it's possible.










    share|improve this question
























      up vote
      -1
      down vote

      favorite









      up vote
      -1
      down vote

      favorite











      I'd like to know if it's possible to read/write GML files (or even KML files) using Fiona.



      Fiona documents don't specify what drivers we can use. I read some answers about the drivers that are avalaible but I still haven't figured out the right answer.



      These two different sentences print a different number of drivers. The first one doesn't include GML o KML (in fact there are very few formats supported).



      print(fiona.supported_drivers)


      vs



      print('n'.join(sorted(fiona.drivers().drivers())))


      I know how to do it using GDAL/OGR but I want to do the same using Fiona if it's possible.










      share|improve this question













      I'd like to know if it's possible to read/write GML files (or even KML files) using Fiona.



      Fiona documents don't specify what drivers we can use. I read some answers about the drivers that are avalaible but I still haven't figured out the right answer.



      These two different sentences print a different number of drivers. The first one doesn't include GML o KML (in fact there are very few formats supported).



      print(fiona.supported_drivers)


      vs



      print('n'.join(sorted(fiona.drivers().drivers())))


      I know how to do it using GDAL/OGR but I want to do the same using Fiona if it's possible.







      python kml gml fiona






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 14:11









      Daniel

      123




      123
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          In order to read both KML and GML file formats the OGR binaries distributed with the Fiona implementation you're using need to be compiled against libexpat or Xerces (XML parsers). If these libraries exist in the same installation where the ogr.dll (Windows), ogr.so (Linux) used by Fiona is, then read support is most probably available. If no, then only write support will be available.






          share|improve this answer























          • Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
            – Daniel
            Nov 15 at 15:06












          • I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
            – Daniel
            Nov 15 at 17:04










          • Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
            – lusitanica
            Nov 15 at 19:27












          • ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
            – lusitanica
            Nov 15 at 22:11










          • Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
            – lusitanica
            Nov 15 at 23:36











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249561%2fis-it-possible-to-read-gml-or-kml-files-with-fiona%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          In order to read both KML and GML file formats the OGR binaries distributed with the Fiona implementation you're using need to be compiled against libexpat or Xerces (XML parsers). If these libraries exist in the same installation where the ogr.dll (Windows), ogr.so (Linux) used by Fiona is, then read support is most probably available. If no, then only write support will be available.






          share|improve this answer























          • Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
            – Daniel
            Nov 15 at 15:06












          • I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
            – Daniel
            Nov 15 at 17:04










          • Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
            – lusitanica
            Nov 15 at 19:27












          • ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
            – lusitanica
            Nov 15 at 22:11










          • Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
            – lusitanica
            Nov 15 at 23:36















          up vote
          1
          down vote













          In order to read both KML and GML file formats the OGR binaries distributed with the Fiona implementation you're using need to be compiled against libexpat or Xerces (XML parsers). If these libraries exist in the same installation where the ogr.dll (Windows), ogr.so (Linux) used by Fiona is, then read support is most probably available. If no, then only write support will be available.






          share|improve this answer























          • Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
            – Daniel
            Nov 15 at 15:06












          • I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
            – Daniel
            Nov 15 at 17:04










          • Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
            – lusitanica
            Nov 15 at 19:27












          • ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
            – lusitanica
            Nov 15 at 22:11










          • Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
            – lusitanica
            Nov 15 at 23:36













          up vote
          1
          down vote










          up vote
          1
          down vote









          In order to read both KML and GML file formats the OGR binaries distributed with the Fiona implementation you're using need to be compiled against libexpat or Xerces (XML parsers). If these libraries exist in the same installation where the ogr.dll (Windows), ogr.so (Linux) used by Fiona is, then read support is most probably available. If no, then only write support will be available.






          share|improve this answer














          In order to read both KML and GML file formats the OGR binaries distributed with the Fiona implementation you're using need to be compiled against libexpat or Xerces (XML parsers). If these libraries exist in the same installation where the ogr.dll (Windows), ogr.so (Linux) used by Fiona is, then read support is most probably available. If no, then only write support will be available.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 16 at 1:16

























          answered Nov 14 at 5:14









          lusitanica

          32319




          32319












          • Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
            – Daniel
            Nov 15 at 15:06












          • I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
            – Daniel
            Nov 15 at 17:04










          • Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
            – lusitanica
            Nov 15 at 19:27












          • ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
            – lusitanica
            Nov 15 at 22:11










          • Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
            – lusitanica
            Nov 15 at 23:36


















          • Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
            – Daniel
            Nov 15 at 15:06












          • I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
            – Daniel
            Nov 15 at 17:04










          • Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
            – lusitanica
            Nov 15 at 19:27












          • ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
            – lusitanica
            Nov 15 at 22:11










          • Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
            – lusitanica
            Nov 15 at 23:36
















          Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
          – Daniel
          Nov 15 at 15:06






          Does it mean that we should use GDAL/OGR to work with most of the vectorial formats and only use Fiona to work with the very few formats avalaible according to (fiona.supported_drivers? This way Fiona is very limited, isn't it? is there any way I can make Fiona work with other formats like GML o KML? What profesionals usually do? Thanks
          – Daniel
          Nov 15 at 15:06














          I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
          – Daniel
          Nov 15 at 17:04




          I guess Fiona's main purpose is to provide data to Shapely. As Shapely is not able to read many formats, Fiona doesn't need to write in many formats either. If we want to transform data between different vectorial formats it's better to use OGC. However, we can use OGR to provide data to Shapely too so most of the time it's worth it to work with OGC instead of working with Fiona. I would appreciate some opinions about that. Thanks
          – Daniel
          Nov 15 at 17:04












          Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
          – lusitanica
          Nov 15 at 19:27






          Fiona IS a wrapper for OGR github.com/Toblerity/Fiona
          – lusitanica
          Nov 15 at 19:27














          ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
          – lusitanica
          Nov 15 at 22:11




          ...and Shapely is a wrapper around GEOS C++. Both projects exist because original SWIG generated OGR python bindings are not very "pythonic" (there's not even a documented API, the only documentations available is OGR C++ API)
          – lusitanica
          Nov 15 at 22:11












          Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
          – lusitanica
          Nov 15 at 23:36




          Anyway, it doesn't hurt you trying to read/write a GML/KML and see what happens. Just don't go thinking that because drivers are not listed, functionality isn't there... as you said different lines are printing different drivers. Besides, drivers() lists only pertains to Read support.
          – lusitanica
          Nov 15 at 23:36


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249561%2fis-it-possible-to-read-gml-or-kml-files-with-fiona%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Full-time equivalent

          さくらももこ

          13 indicted, 8 arrested in Calif. drug cartel investigation