Plotting Storm Prediction Center (SPC) Shapefile using Python? The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraUsing ogr2ogr to convert GML to shapefile in Python?R - Plotting shapefile with geographical (raster) datamark points on shapefile using pythonIncorrect lat / lon conversion from utmHow to read geographic coordinates when the Shapefile has a projected spatial referenceConvert shapefile from projected coordinates using PythonI have converted to ESPG 4326, but I am still getting an error that my coordinate system is wrong?Can't import shapefile in PythonSaving geographic minimum spanning tree in KML and shapefile using Python?Plotting XY data from newly created shapefile in ArcMap?Points to shapefile, with curved lines given center and radius (QGIS)

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

What is the role of 'For' here?

Why doesn't a hydraulic lever violate conservation of energy?

Do warforged have souls?

What happens to a Warlock's expended Spell Slots when they gain a Level?

How do you keep chess fun when your opponent constantly beats you?

Visa regaring travelling European country

Can I visit the Trinity College (Cambridge) library and see some of their rare books

Can we generate random numbers using irrational numbers like π and e?

Can each chord in a progression create its own key?

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

Single author papers against my advisor's will?

Is 'stolen' appropriate word?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

How to type a long/em dash `—`

Why can't devices on different VLANs, but on the same subnet, communicate?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Would an alien lifeform be able to achieve space travel if lacking in vision?

60's-70's movie: home appliances revolting against the owners

Did the new image of black hole confirm the general theory of relativity?

Can withdrawing asylum be illegal?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

What's the point in a preamp?

Proving the given two groups are isomorphic



Plotting Storm Prediction Center (SPC) Shapefile using Python?



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraUsing ogr2ogr to convert GML to shapefile in Python?R - Plotting shapefile with geographical (raster) datamark points on shapefile using pythonIncorrect lat / lon conversion from utmHow to read geographic coordinates when the Shapefile has a projected spatial referenceConvert shapefile from projected coordinates using PythonI have converted to ESPG 4326, but I am still getting an error that my coordinate system is wrong?Can't import shapefile in PythonSaving geographic minimum spanning tree in KML and shapefile using Python?Plotting XY data from newly created shapefile in ArcMap?Points to shapefile, with curved lines given center and radius (QGIS)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this code to try to read the data.



 from mpl_toolkits.basemap import Basemap
#draw basemap
m=Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,llcrnrlon=-130,
urcrnrlon=-60,resolution='c')
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.drawmapboundary(fill_color='#FFFFFF')
shp_info = m.readshapefile('..day1otlk_20140709_2000_cat','thunder')


But then I get ValueError: Shapefile must have lat/lon vertices - it appears this one
has vertices in map projection coordinates. Convert the shapefile to
geographic coordinates using the shpproj utility from the shapelib
tools.



I am pretty new to this but I understand I need to convert this shapefile to geographic coordinates but the error message is too vague and I have no idea how.










share|improve this question
























  • What software are you using? QGIS, ArcGIS, etc? And version

    – GISKid
    Jul 10 '14 at 15:17












  • Given the m.readshapefile and other commands, looks like Matlab.

    – Erica
    Jul 10 '14 at 16:06











  • Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

    – wolfpack
    Jul 10 '14 at 16:09











  • The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

    – Erica
    Jul 10 '14 at 16:19











  • Do I run shpproj with Python or do I need something else?

    – wolfpack
    Jul 10 '14 at 16:24

















2















I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this code to try to read the data.



 from mpl_toolkits.basemap import Basemap
#draw basemap
m=Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,llcrnrlon=-130,
urcrnrlon=-60,resolution='c')
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.drawmapboundary(fill_color='#FFFFFF')
shp_info = m.readshapefile('..day1otlk_20140709_2000_cat','thunder')


But then I get ValueError: Shapefile must have lat/lon vertices - it appears this one
has vertices in map projection coordinates. Convert the shapefile to
geographic coordinates using the shpproj utility from the shapelib
tools.



I am pretty new to this but I understand I need to convert this shapefile to geographic coordinates but the error message is too vague and I have no idea how.










share|improve this question
























  • What software are you using? QGIS, ArcGIS, etc? And version

    – GISKid
    Jul 10 '14 at 15:17












  • Given the m.readshapefile and other commands, looks like Matlab.

    – Erica
    Jul 10 '14 at 16:06











  • Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

    – wolfpack
    Jul 10 '14 at 16:09











  • The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

    – Erica
    Jul 10 '14 at 16:19











  • Do I run shpproj with Python or do I need something else?

    – wolfpack
    Jul 10 '14 at 16:24













2












2








2








I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this code to try to read the data.



 from mpl_toolkits.basemap import Basemap
#draw basemap
m=Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,llcrnrlon=-130,
urcrnrlon=-60,resolution='c')
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.drawmapboundary(fill_color='#FFFFFF')
shp_info = m.readshapefile('..day1otlk_20140709_2000_cat','thunder')


But then I get ValueError: Shapefile must have lat/lon vertices - it appears this one
has vertices in map projection coordinates. Convert the shapefile to
geographic coordinates using the shpproj utility from the shapelib
tools.



I am pretty new to this but I understand I need to convert this shapefile to geographic coordinates but the error message is too vague and I have no idea how.










share|improve this question
















I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this code to try to read the data.



 from mpl_toolkits.basemap import Basemap
#draw basemap
m=Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,llcrnrlon=-130,
urcrnrlon=-60,resolution='c')
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.drawmapboundary(fill_color='#FFFFFF')
shp_info = m.readshapefile('..day1otlk_20140709_2000_cat','thunder')


But then I get ValueError: Shapefile must have lat/lon vertices - it appears this one
has vertices in map projection coordinates. Convert the shapefile to
geographic coordinates using the shpproj utility from the shapelib
tools.



I am pretty new to this but I understand I need to convert this shapefile to geographic coordinates but the error message is too vague and I have no idea how.







python shapefile






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 7 at 8:14









PolyGeo

53.9k1782246




53.9k1782246










asked Jul 10 '14 at 14:48









wolfpackwolfpack

112




112












  • What software are you using? QGIS, ArcGIS, etc? And version

    – GISKid
    Jul 10 '14 at 15:17












  • Given the m.readshapefile and other commands, looks like Matlab.

    – Erica
    Jul 10 '14 at 16:06











  • Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

    – wolfpack
    Jul 10 '14 at 16:09











  • The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

    – Erica
    Jul 10 '14 at 16:19











  • Do I run shpproj with Python or do I need something else?

    – wolfpack
    Jul 10 '14 at 16:24

















  • What software are you using? QGIS, ArcGIS, etc? And version

    – GISKid
    Jul 10 '14 at 15:17












  • Given the m.readshapefile and other commands, looks like Matlab.

    – Erica
    Jul 10 '14 at 16:06











  • Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

    – wolfpack
    Jul 10 '14 at 16:09











  • The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

    – Erica
    Jul 10 '14 at 16:19











  • Do I run shpproj with Python or do I need something else?

    – wolfpack
    Jul 10 '14 at 16:24
















What software are you using? QGIS, ArcGIS, etc? And version

– GISKid
Jul 10 '14 at 15:17






What software are you using? QGIS, ArcGIS, etc? And version

– GISKid
Jul 10 '14 at 15:17














Given the m.readshapefile and other commands, looks like Matlab.

– Erica
Jul 10 '14 at 16:06





Given the m.readshapefile and other commands, looks like Matlab.

– Erica
Jul 10 '14 at 16:06













Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

– wolfpack
Jul 10 '14 at 16:09





Right now I am only using Python. Is there another way to do it? I am not familiar with QGIS or ArcGIS

– wolfpack
Jul 10 '14 at 16:09













The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

– Erica
Jul 10 '14 at 16:19





The shpproj utility referred to in the error message can be downloaded here. It looks like a pretty straightforward tool (documentation), although I've never tried it and can't vouch for its usability.

– Erica
Jul 10 '14 at 16:19













Do I run shpproj with Python or do I need something else?

– wolfpack
Jul 10 '14 at 16:24





Do I run shpproj with Python or do I need something else?

– wolfpack
Jul 10 '14 at 16:24










2 Answers
2






active

oldest

votes


















1














You can use ogr2ogr to reproject the shapefile. I would probably just write a shell script to call ogr2ogr before calling your python script, but there is a Python interface to ogr2ogr. It's explained here. (That example is how to convert gml to shapefile. Near the bottom of this page you can find an example of how to reproject, though not the python part.)






share|improve this answer
































    0














    Looking at the shapefiles here all they contain is a field DN with numeric values.
    There is no X or Y coordinate. In order to plot anything spatially there needs to be a reference. In python I am not sure if you can do this. The shapefiles provided are polygons and lines which are meant to overlay a basemap or surface of America.



    However, if you are using a software solution like ArcGIS you can add these shapefiles and they will project on the fly.



    If I'm looking at the wrong dataset please let me know - or perhaps attach it to your post so I can be more useful.






    share|improve this answer























    • Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

      – wolfpack
      Jul 10 '14 at 16:49











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "79"
    ;
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2fgis.stackexchange.com%2fquestions%2f106788%2fplotting-storm-prediction-center-spc-shapefile-using-python%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You can use ogr2ogr to reproject the shapefile. I would probably just write a shell script to call ogr2ogr before calling your python script, but there is a Python interface to ogr2ogr. It's explained here. (That example is how to convert gml to shapefile. Near the bottom of this page you can find an example of how to reproject, though not the python part.)






    share|improve this answer





























      1














      You can use ogr2ogr to reproject the shapefile. I would probably just write a shell script to call ogr2ogr before calling your python script, but there is a Python interface to ogr2ogr. It's explained here. (That example is how to convert gml to shapefile. Near the bottom of this page you can find an example of how to reproject, though not the python part.)






      share|improve this answer



























        1












        1








        1







        You can use ogr2ogr to reproject the shapefile. I would probably just write a shell script to call ogr2ogr before calling your python script, but there is a Python interface to ogr2ogr. It's explained here. (That example is how to convert gml to shapefile. Near the bottom of this page you can find an example of how to reproject, though not the python part.)






        share|improve this answer















        You can use ogr2ogr to reproject the shapefile. I would probably just write a shell script to call ogr2ogr before calling your python script, but there is a Python interface to ogr2ogr. It's explained here. (That example is how to convert gml to shapefile. Near the bottom of this page you can find an example of how to reproject, though not the python part.)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:34









        Community

        1




        1










        answered Nov 17 '14 at 5:25









        LlavesLlaves

        2,85921939




        2,85921939























            0














            Looking at the shapefiles here all they contain is a field DN with numeric values.
            There is no X or Y coordinate. In order to plot anything spatially there needs to be a reference. In python I am not sure if you can do this. The shapefiles provided are polygons and lines which are meant to overlay a basemap or surface of America.



            However, if you are using a software solution like ArcGIS you can add these shapefiles and they will project on the fly.



            If I'm looking at the wrong dataset please let me know - or perhaps attach it to your post so I can be more useful.






            share|improve this answer























            • Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

              – wolfpack
              Jul 10 '14 at 16:49















            0














            Looking at the shapefiles here all they contain is a field DN with numeric values.
            There is no X or Y coordinate. In order to plot anything spatially there needs to be a reference. In python I am not sure if you can do this. The shapefiles provided are polygons and lines which are meant to overlay a basemap or surface of America.



            However, if you are using a software solution like ArcGIS you can add these shapefiles and they will project on the fly.



            If I'm looking at the wrong dataset please let me know - or perhaps attach it to your post so I can be more useful.






            share|improve this answer























            • Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

              – wolfpack
              Jul 10 '14 at 16:49













            0












            0








            0







            Looking at the shapefiles here all they contain is a field DN with numeric values.
            There is no X or Y coordinate. In order to plot anything spatially there needs to be a reference. In python I am not sure if you can do this. The shapefiles provided are polygons and lines which are meant to overlay a basemap or surface of America.



            However, if you are using a software solution like ArcGIS you can add these shapefiles and they will project on the fly.



            If I'm looking at the wrong dataset please let me know - or perhaps attach it to your post so I can be more useful.






            share|improve this answer













            Looking at the shapefiles here all they contain is a field DN with numeric values.
            There is no X or Y coordinate. In order to plot anything spatially there needs to be a reference. In python I am not sure if you can do this. The shapefiles provided are polygons and lines which are meant to overlay a basemap or surface of America.



            However, if you are using a software solution like ArcGIS you can add these shapefiles and they will project on the fly.



            If I'm looking at the wrong dataset please let me know - or perhaps attach it to your post so I can be more useful.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 10 '14 at 15:23









            GISKidGISKid

            2,6201235




            2,6201235












            • Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

              – wolfpack
              Jul 10 '14 at 16:49

















            • Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

              – wolfpack
              Jul 10 '14 at 16:49
















            Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

            – wolfpack
            Jul 10 '14 at 16:49





            Yes this is the right dataset. Obviously the set is updated and renamed every few hours but the idea is still the same. I was able to plot it on a US map in QGIS, but I was hoping to have something a little more automated.

            – wolfpack
            Jul 10 '14 at 16:49

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


            • 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%2fgis.stackexchange.com%2fquestions%2f106788%2fplotting-storm-prediction-center-spc-shapefile-using-python%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

            Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

            រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

            Ромео және Джульетта Мазмұны Қысқаша сипаттамасы Кейіпкерлері Кино Дереккөздер Бағыттау мәзірі