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;
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
add a comment |
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
What software are you using? QGIS, ArcGIS, etc? And version
– GISKid
Jul 10 '14 at 15:17
Given them.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
Theshpproj
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
add a comment |
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
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
python shapefile
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 them.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
Theshpproj
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
add a comment |
What software are you using? QGIS, ArcGIS, etc? And version
– GISKid
Jul 10 '14 at 15:17
Given them.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
Theshpproj
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
add a comment |
2 Answers
2
active
oldest
votes
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.)
add a comment |
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.)
add a comment |
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.)
add a comment |
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.)
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.)
edited Apr 13 '17 at 12:34
Community♦
1
1
answered Nov 17 '14 at 5:25
LlavesLlaves
2,85921939
2,85921939
add a comment |
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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