Simple thematic mapping of shapefile using Python? The Next CEO of Stack OverflowGenerating...

Writing differences on a blackboard

What connection does MS Office have to Netscape Navigator?

Are police here, aren't itthey?

How a 64-bit process virtual address space is divided in Linux?

Why does the flight controls check come before arming the autobrake on the A320?

How to scale a tikZ image which is within a figure environment

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

Rotate a column

Is a distribution that is normal, but highly skewed considered Gaussian?

Why isn't acceleration always zero whenever velocity is zero, such as the moment a ball bounces off a wall?

A Man With a Stainless Steel Endoskeleton (like The Terminator) Fighting Cloaked Aliens Only He Can See

What is the value of α and β in a triangle?

How did people program for Consoles with multiple CPUs?

Why do airplanes bank sharply to the right after air-to-air refueling?

Is it possible to replace duplicates of a character with one character using tr

Proper way to express "He disappeared them"

Is there always a complete, orthogonal set of unitary matrices?

Would a completely good Muggle be able to use a wand?

What happened in Rome, when the western empire "fell"?

Is there a way to save my career from absolute disaster?

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

Running a General Election and the European Elections together

How to place nodes around a circle from some initial angle?

What did we know about the Kessel run before the prequels?



Simple thematic mapping of shapefile using Python?



The Next CEO of Stack OverflowGenerating Custom Map image using Python with small installation footprint?Python Script examples for geoprocessing shapefiles without using arcpyIs it possible to look at the contents of Shapefile using Python without an ArcMap license?How to create an attractive choropleth map in R?Offline Python or C++ library for plotting locations on map?How to check what changed inside the updated shapefile?3D Polygon Layer Stack with QGISPlotting 3D Data using PythonFree 3rd party library for showing geospatial vector informationPython with ArcCatalog for Table or Geography view?Visualisation using simple plotting routines or advanced GIS packages?Python Mapping in Matplotlib Cartopy Color One Countrymark points on shapefile using pythonPlot shapefile with matplotlibMoving shapefile using Python shutil?How to read shapefile faster using Python basemap (and pickle)?Python: color Canadian provinces in a shapefile based on given valuesCan't import shapefile in PythonUsing python spectral package?Clip a NetCDF file using a shapefile with Python












35















I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map.



On the internet I found how to make a thematic map using Python:



Here is some code that I tried:



import shpUtils
import matplotlib.pyplot as plt

shpRecords = shpUtils.loadShapefile('C:\Users\shapefile.shp')

for i in range(0,len(shpRecords)):
x = []
y = []
for j in range(0,len(shpRecords[i]['shp_data']['parts'][0]['points'])):

tempx = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['x'])
tempy = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['y'])
x.append(tempx)
y.append(tempy)
plt.fill(x,y)

plt.axis('equal')
plt.title("Testing")
plt.show()


However, when I run this, it gives me random colors.



If I want to visualise one certain column of my shapefile, how can I implement this using similar code?



This is very unclear in the link provided above where he only discusses the usage of colors...



Would I perhaps need extra modules to accomplish this, like descartes and PySAL?










share|improve this question





























    35















    I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map.



    On the internet I found how to make a thematic map using Python:



    Here is some code that I tried:



    import shpUtils
    import matplotlib.pyplot as plt

    shpRecords = shpUtils.loadShapefile('C:\Users\shapefile.shp')

    for i in range(0,len(shpRecords)):
    x = []
    y = []
    for j in range(0,len(shpRecords[i]['shp_data']['parts'][0]['points'])):

    tempx = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['x'])
    tempy = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['y'])
    x.append(tempx)
    y.append(tempy)
    plt.fill(x,y)

    plt.axis('equal')
    plt.title("Testing")
    plt.show()


    However, when I run this, it gives me random colors.



    If I want to visualise one certain column of my shapefile, how can I implement this using similar code?



    This is very unclear in the link provided above where he only discusses the usage of colors...



    Would I perhaps need extra modules to accomplish this, like descartes and PySAL?










    share|improve this question



























      35












      35








      35


      34






      I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map.



      On the internet I found how to make a thematic map using Python:



      Here is some code that I tried:



      import shpUtils
      import matplotlib.pyplot as plt

      shpRecords = shpUtils.loadShapefile('C:\Users\shapefile.shp')

      for i in range(0,len(shpRecords)):
      x = []
      y = []
      for j in range(0,len(shpRecords[i]['shp_data']['parts'][0]['points'])):

      tempx = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['x'])
      tempy = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['y'])
      x.append(tempx)
      y.append(tempy)
      plt.fill(x,y)

      plt.axis('equal')
      plt.title("Testing")
      plt.show()


      However, when I run this, it gives me random colors.



      If I want to visualise one certain column of my shapefile, how can I implement this using similar code?



      This is very unclear in the link provided above where he only discusses the usage of colors...



      Would I perhaps need extra modules to accomplish this, like descartes and PySAL?










      share|improve this question
















      I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map.



      On the internet I found how to make a thematic map using Python:



      Here is some code that I tried:



      import shpUtils
      import matplotlib.pyplot as plt

      shpRecords = shpUtils.loadShapefile('C:\Users\shapefile.shp')

      for i in range(0,len(shpRecords)):
      x = []
      y = []
      for j in range(0,len(shpRecords[i]['shp_data']['parts'][0]['points'])):

      tempx = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['x'])
      tempy = float(shpRecords[i]['shp_data']['parts'][0]['points'][j]['y'])
      x.append(tempx)
      y.append(tempy)
      plt.fill(x,y)

      plt.axis('equal')
      plt.title("Testing")
      plt.show()


      However, when I run this, it gives me random colors.



      If I want to visualise one certain column of my shapefile, how can I implement this using similar code?



      This is very unclear in the link provided above where he only discusses the usage of colors...



      Would I perhaps need extra modules to accomplish this, like descartes and PySAL?







      python shapefile visualisation matplotlib






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 19 '14 at 9:24









      PolyGeo

      53.8k1781245




      53.8k1781245










      asked May 25 '13 at 15:13









      NYannickskeNYannickske

      303159




      303159






















          3 Answers
          3






          active

          oldest

          votes


















          58














          I do not know ArcPy, but I work with shapefiles and raster in Python for years




          1. For processing shapefiles in Python, there are many modules like osgeo/ogr, Fiona, Pysal or Pyshp (shpUtils is one of them and
            not the most used), and others, see Pypi: GIS and examples on gis.stackexchange and many examples on the Web (not only in English). Most of them are much older than ArcPy (or arcgisscripting)...

          2. for processing raster you can use osgeo/gdal, the standard

          3. For processing geospatial geometries, there is shapely

          4. For plotting the geometries you can use matplotlib and possibly descartes, "extension" of matplotlib for areas, but also many, many other modules, see Pypi: Plotting and modules like mayavi for 3D representation (matplotlib also)

          5. There are also modules like mapnik which give you directly the possibilities of 1) read a shapefile and 4) plotting with the module Pycairo.


          After that, it's like a GIS:




          • you use the modules 1) to open, save the shapefiles and carry out the treatments with other modules like numpy or scipy, if you want.

          • you can use shapely for manipulation and analysis of the geometric objects (buffer, etc.).

          • you can use matplotlib to plot the geometries, but matplotlib do not know what you want to plot. It is your work with modules 1) or 3) to specify what to plot (attributes, etc,.) and how.



          If I want to visualise one certain column of my shapefile, how can I implement this in the code?




          So, you must learn matplotib and the other modules. You have to learn ArcPy, it's the same...(there are lots of excellent tutorials on the web, especially for matplolib, and it's easier that ArcPy because it is pure Python).



          Some examples with Python only



          enter image description here



          Geological map (polygon shapefile) with colors based on an attribute



          enter image description here



          3D Points (PointZ shapefile) with color based on an attribute



          enter image description here



          3D points (Point shapefile with z as attribute) and 3D line (PolyLineZ shapefile) on a DEM, and on a raster draped onto the DEM surface.



          enter image description here



          Topographic profile with z values and colors based on attributes (geological formations = Cross section) of the original shapefile (Polyline shapefile)



          enter image description here



          DEM (GeoTIFF) with the module Mayavi2



          enter image description here



          DEM (ESRI ascii grid, .asc) and Point shapefiles (with z as attribute) with the module visvis



          enter image description here



          Boreholes (3D buffer of a polylineZ with colors based on an attribute (geological formations), with a grid surface calculated with the modules numpy and matplotlib from a points shapefile (with z as an attribute), visualized with the module visvis






          share|improve this answer





















          • 1





            These are some fantastic examples! Very cool.

            – Chad Cooper
            May 26 '13 at 15:18











          • Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

            – NYannickske
            May 26 '13 at 19:02



















          14














          I've had similar problems where I want to visualize shapefiles quickly, and I've always found the Matplotlib way quite a lengthy way to accomplish such a small task. Instead I developed the "Python Geographic Visualizer" module, or GeoVis for short. Update: v0.2.0 is now out with lots of new functionality.



          With it visualizing shapefiles couldn't be easier:



          import geovis
          geovis.ViewShapefile("C:/yourshapefile.shp")


          Voila, you map pops up as an image in a Tkinter window and you can also save the map to an image file. Styling, coloring, and adding multiple layers to a map is also possible, and in the newest version you can also classify based on attributes and zoom in to a particular region. In the map below geovis loaded and categorically colored all the world's GADM provinces in about 5 minutes. You can download GeoVis from here, where you can also read more about how to use it.



          enter image description here



          The aim is on easy installation as much as ease-of-use, so GeoVis can be used by anyone who has Python and does not require any other modules since it can use the builtin Tkinter Canvas as a renderer. But it is highly recommended that you have or get either Aggdraw, PIL, or PyCairo, which can also be used as renderers and are much faster and higher quality.



          Backdraw is your shapefile has to be unprojected with lat/long coordinate system--it doesn't yet handle projections or transformations.



          Hope it helps.






          share|improve this answer


























          • I will definitely give it a try!

            – NYannickske
            Feb 28 '14 at 10:02






          • 1





            @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

            – Karim Bahgat
            Apr 17 '14 at 0:02













          • @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

            – Casivio
            Jan 14 at 21:13



















          12














          I came across a number of tutorials dealing with this topic that I wanted to share:





          • So You’d Like To Make a Map Using Python - Stephan Hügel



            Choropleth map




          • How to Make a US County Thematic Map Using Free Tools - Nathan Yau



            Another choropleth map



          • A Thematic Map in Python - Daniel Lewis



          • Creating Map Visualizations in <10 lines of Python - Rob Story



            Yet another choropleth map




          You might also consider using R: How to create an attractive choropleth map in R?






          share|improve this answer


























          • Making maps with Vincent looks very promising, never heard of it before.

            – Karim Bahgat
            Jun 20 '14 at 0:33












          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%2f61862%2fsimple-thematic-mapping-of-shapefile-using-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          58














          I do not know ArcPy, but I work with shapefiles and raster in Python for years




          1. For processing shapefiles in Python, there are many modules like osgeo/ogr, Fiona, Pysal or Pyshp (shpUtils is one of them and
            not the most used), and others, see Pypi: GIS and examples on gis.stackexchange and many examples on the Web (not only in English). Most of them are much older than ArcPy (or arcgisscripting)...

          2. for processing raster you can use osgeo/gdal, the standard

          3. For processing geospatial geometries, there is shapely

          4. For plotting the geometries you can use matplotlib and possibly descartes, "extension" of matplotlib for areas, but also many, many other modules, see Pypi: Plotting and modules like mayavi for 3D representation (matplotlib also)

          5. There are also modules like mapnik which give you directly the possibilities of 1) read a shapefile and 4) plotting with the module Pycairo.


          After that, it's like a GIS:




          • you use the modules 1) to open, save the shapefiles and carry out the treatments with other modules like numpy or scipy, if you want.

          • you can use shapely for manipulation and analysis of the geometric objects (buffer, etc.).

          • you can use matplotlib to plot the geometries, but matplotlib do not know what you want to plot. It is your work with modules 1) or 3) to specify what to plot (attributes, etc,.) and how.



          If I want to visualise one certain column of my shapefile, how can I implement this in the code?




          So, you must learn matplotib and the other modules. You have to learn ArcPy, it's the same...(there are lots of excellent tutorials on the web, especially for matplolib, and it's easier that ArcPy because it is pure Python).



          Some examples with Python only



          enter image description here



          Geological map (polygon shapefile) with colors based on an attribute



          enter image description here



          3D Points (PointZ shapefile) with color based on an attribute



          enter image description here



          3D points (Point shapefile with z as attribute) and 3D line (PolyLineZ shapefile) on a DEM, and on a raster draped onto the DEM surface.



          enter image description here



          Topographic profile with z values and colors based on attributes (geological formations = Cross section) of the original shapefile (Polyline shapefile)



          enter image description here



          DEM (GeoTIFF) with the module Mayavi2



          enter image description here



          DEM (ESRI ascii grid, .asc) and Point shapefiles (with z as attribute) with the module visvis



          enter image description here



          Boreholes (3D buffer of a polylineZ with colors based on an attribute (geological formations), with a grid surface calculated with the modules numpy and matplotlib from a points shapefile (with z as an attribute), visualized with the module visvis






          share|improve this answer





















          • 1





            These are some fantastic examples! Very cool.

            – Chad Cooper
            May 26 '13 at 15:18











          • Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

            – NYannickske
            May 26 '13 at 19:02
















          58














          I do not know ArcPy, but I work with shapefiles and raster in Python for years




          1. For processing shapefiles in Python, there are many modules like osgeo/ogr, Fiona, Pysal or Pyshp (shpUtils is one of them and
            not the most used), and others, see Pypi: GIS and examples on gis.stackexchange and many examples on the Web (not only in English). Most of them are much older than ArcPy (or arcgisscripting)...

          2. for processing raster you can use osgeo/gdal, the standard

          3. For processing geospatial geometries, there is shapely

          4. For plotting the geometries you can use matplotlib and possibly descartes, "extension" of matplotlib for areas, but also many, many other modules, see Pypi: Plotting and modules like mayavi for 3D representation (matplotlib also)

          5. There are also modules like mapnik which give you directly the possibilities of 1) read a shapefile and 4) plotting with the module Pycairo.


          After that, it's like a GIS:




          • you use the modules 1) to open, save the shapefiles and carry out the treatments with other modules like numpy or scipy, if you want.

          • you can use shapely for manipulation and analysis of the geometric objects (buffer, etc.).

          • you can use matplotlib to plot the geometries, but matplotlib do not know what you want to plot. It is your work with modules 1) or 3) to specify what to plot (attributes, etc,.) and how.



          If I want to visualise one certain column of my shapefile, how can I implement this in the code?




          So, you must learn matplotib and the other modules. You have to learn ArcPy, it's the same...(there are lots of excellent tutorials on the web, especially for matplolib, and it's easier that ArcPy because it is pure Python).



          Some examples with Python only



          enter image description here



          Geological map (polygon shapefile) with colors based on an attribute



          enter image description here



          3D Points (PointZ shapefile) with color based on an attribute



          enter image description here



          3D points (Point shapefile with z as attribute) and 3D line (PolyLineZ shapefile) on a DEM, and on a raster draped onto the DEM surface.



          enter image description here



          Topographic profile with z values and colors based on attributes (geological formations = Cross section) of the original shapefile (Polyline shapefile)



          enter image description here



          DEM (GeoTIFF) with the module Mayavi2



          enter image description here



          DEM (ESRI ascii grid, .asc) and Point shapefiles (with z as attribute) with the module visvis



          enter image description here



          Boreholes (3D buffer of a polylineZ with colors based on an attribute (geological formations), with a grid surface calculated with the modules numpy and matplotlib from a points shapefile (with z as an attribute), visualized with the module visvis






          share|improve this answer





















          • 1





            These are some fantastic examples! Very cool.

            – Chad Cooper
            May 26 '13 at 15:18











          • Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

            – NYannickske
            May 26 '13 at 19:02














          58












          58








          58







          I do not know ArcPy, but I work with shapefiles and raster in Python for years




          1. For processing shapefiles in Python, there are many modules like osgeo/ogr, Fiona, Pysal or Pyshp (shpUtils is one of them and
            not the most used), and others, see Pypi: GIS and examples on gis.stackexchange and many examples on the Web (not only in English). Most of them are much older than ArcPy (or arcgisscripting)...

          2. for processing raster you can use osgeo/gdal, the standard

          3. For processing geospatial geometries, there is shapely

          4. For plotting the geometries you can use matplotlib and possibly descartes, "extension" of matplotlib for areas, but also many, many other modules, see Pypi: Plotting and modules like mayavi for 3D representation (matplotlib also)

          5. There are also modules like mapnik which give you directly the possibilities of 1) read a shapefile and 4) plotting with the module Pycairo.


          After that, it's like a GIS:




          • you use the modules 1) to open, save the shapefiles and carry out the treatments with other modules like numpy or scipy, if you want.

          • you can use shapely for manipulation and analysis of the geometric objects (buffer, etc.).

          • you can use matplotlib to plot the geometries, but matplotlib do not know what you want to plot. It is your work with modules 1) or 3) to specify what to plot (attributes, etc,.) and how.



          If I want to visualise one certain column of my shapefile, how can I implement this in the code?




          So, you must learn matplotib and the other modules. You have to learn ArcPy, it's the same...(there are lots of excellent tutorials on the web, especially for matplolib, and it's easier that ArcPy because it is pure Python).



          Some examples with Python only



          enter image description here



          Geological map (polygon shapefile) with colors based on an attribute



          enter image description here



          3D Points (PointZ shapefile) with color based on an attribute



          enter image description here



          3D points (Point shapefile with z as attribute) and 3D line (PolyLineZ shapefile) on a DEM, and on a raster draped onto the DEM surface.



          enter image description here



          Topographic profile with z values and colors based on attributes (geological formations = Cross section) of the original shapefile (Polyline shapefile)



          enter image description here



          DEM (GeoTIFF) with the module Mayavi2



          enter image description here



          DEM (ESRI ascii grid, .asc) and Point shapefiles (with z as attribute) with the module visvis



          enter image description here



          Boreholes (3D buffer of a polylineZ with colors based on an attribute (geological formations), with a grid surface calculated with the modules numpy and matplotlib from a points shapefile (with z as an attribute), visualized with the module visvis






          share|improve this answer















          I do not know ArcPy, but I work with shapefiles and raster in Python for years




          1. For processing shapefiles in Python, there are many modules like osgeo/ogr, Fiona, Pysal or Pyshp (shpUtils is one of them and
            not the most used), and others, see Pypi: GIS and examples on gis.stackexchange and many examples on the Web (not only in English). Most of them are much older than ArcPy (or arcgisscripting)...

          2. for processing raster you can use osgeo/gdal, the standard

          3. For processing geospatial geometries, there is shapely

          4. For plotting the geometries you can use matplotlib and possibly descartes, "extension" of matplotlib for areas, but also many, many other modules, see Pypi: Plotting and modules like mayavi for 3D representation (matplotlib also)

          5. There are also modules like mapnik which give you directly the possibilities of 1) read a shapefile and 4) plotting with the module Pycairo.


          After that, it's like a GIS:




          • you use the modules 1) to open, save the shapefiles and carry out the treatments with other modules like numpy or scipy, if you want.

          • you can use shapely for manipulation and analysis of the geometric objects (buffer, etc.).

          • you can use matplotlib to plot the geometries, but matplotlib do not know what you want to plot. It is your work with modules 1) or 3) to specify what to plot (attributes, etc,.) and how.



          If I want to visualise one certain column of my shapefile, how can I implement this in the code?




          So, you must learn matplotib and the other modules. You have to learn ArcPy, it's the same...(there are lots of excellent tutorials on the web, especially for matplolib, and it's easier that ArcPy because it is pure Python).



          Some examples with Python only



          enter image description here



          Geological map (polygon shapefile) with colors based on an attribute



          enter image description here



          3D Points (PointZ shapefile) with color based on an attribute



          enter image description here



          3D points (Point shapefile with z as attribute) and 3D line (PolyLineZ shapefile) on a DEM, and on a raster draped onto the DEM surface.



          enter image description here



          Topographic profile with z values and colors based on attributes (geological formations = Cross section) of the original shapefile (Polyline shapefile)



          enter image description here



          DEM (GeoTIFF) with the module Mayavi2



          enter image description here



          DEM (ESRI ascii grid, .asc) and Point shapefiles (with z as attribute) with the module visvis



          enter image description here



          Boreholes (3D buffer of a polylineZ with colors based on an attribute (geological formations), with a grid surface calculated with the modules numpy and matplotlib from a points shapefile (with z as an attribute), visualized with the module visvis







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 26 '13 at 9:23

























          answered May 25 '13 at 16:29









          genegene

          37.5k155120




          37.5k155120








          • 1





            These are some fantastic examples! Very cool.

            – Chad Cooper
            May 26 '13 at 15:18











          • Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

            – NYannickske
            May 26 '13 at 19:02














          • 1





            These are some fantastic examples! Very cool.

            – Chad Cooper
            May 26 '13 at 15:18











          • Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

            – NYannickske
            May 26 '13 at 19:02








          1




          1





          These are some fantastic examples! Very cool.

          – Chad Cooper
          May 26 '13 at 15:18





          These are some fantastic examples! Very cool.

          – Chad Cooper
          May 26 '13 at 15:18













          Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

          – NYannickske
          May 26 '13 at 19:02





          Thank you very much for your examples! I will definitely look to all those modules. Because of your images and examples, I really want to start with it! Thx!

          – NYannickske
          May 26 '13 at 19:02













          14














          I've had similar problems where I want to visualize shapefiles quickly, and I've always found the Matplotlib way quite a lengthy way to accomplish such a small task. Instead I developed the "Python Geographic Visualizer" module, or GeoVis for short. Update: v0.2.0 is now out with lots of new functionality.



          With it visualizing shapefiles couldn't be easier:



          import geovis
          geovis.ViewShapefile("C:/yourshapefile.shp")


          Voila, you map pops up as an image in a Tkinter window and you can also save the map to an image file. Styling, coloring, and adding multiple layers to a map is also possible, and in the newest version you can also classify based on attributes and zoom in to a particular region. In the map below geovis loaded and categorically colored all the world's GADM provinces in about 5 minutes. You can download GeoVis from here, where you can also read more about how to use it.



          enter image description here



          The aim is on easy installation as much as ease-of-use, so GeoVis can be used by anyone who has Python and does not require any other modules since it can use the builtin Tkinter Canvas as a renderer. But it is highly recommended that you have or get either Aggdraw, PIL, or PyCairo, which can also be used as renderers and are much faster and higher quality.



          Backdraw is your shapefile has to be unprojected with lat/long coordinate system--it doesn't yet handle projections or transformations.



          Hope it helps.






          share|improve this answer


























          • I will definitely give it a try!

            – NYannickske
            Feb 28 '14 at 10:02






          • 1





            @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

            – Karim Bahgat
            Apr 17 '14 at 0:02













          • @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

            – Casivio
            Jan 14 at 21:13
















          14














          I've had similar problems where I want to visualize shapefiles quickly, and I've always found the Matplotlib way quite a lengthy way to accomplish such a small task. Instead I developed the "Python Geographic Visualizer" module, or GeoVis for short. Update: v0.2.0 is now out with lots of new functionality.



          With it visualizing shapefiles couldn't be easier:



          import geovis
          geovis.ViewShapefile("C:/yourshapefile.shp")


          Voila, you map pops up as an image in a Tkinter window and you can also save the map to an image file. Styling, coloring, and adding multiple layers to a map is also possible, and in the newest version you can also classify based on attributes and zoom in to a particular region. In the map below geovis loaded and categorically colored all the world's GADM provinces in about 5 minutes. You can download GeoVis from here, where you can also read more about how to use it.



          enter image description here



          The aim is on easy installation as much as ease-of-use, so GeoVis can be used by anyone who has Python and does not require any other modules since it can use the builtin Tkinter Canvas as a renderer. But it is highly recommended that you have or get either Aggdraw, PIL, or PyCairo, which can also be used as renderers and are much faster and higher quality.



          Backdraw is your shapefile has to be unprojected with lat/long coordinate system--it doesn't yet handle projections or transformations.



          Hope it helps.






          share|improve this answer


























          • I will definitely give it a try!

            – NYannickske
            Feb 28 '14 at 10:02






          • 1





            @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

            – Karim Bahgat
            Apr 17 '14 at 0:02













          • @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

            – Casivio
            Jan 14 at 21:13














          14












          14








          14







          I've had similar problems where I want to visualize shapefiles quickly, and I've always found the Matplotlib way quite a lengthy way to accomplish such a small task. Instead I developed the "Python Geographic Visualizer" module, or GeoVis for short. Update: v0.2.0 is now out with lots of new functionality.



          With it visualizing shapefiles couldn't be easier:



          import geovis
          geovis.ViewShapefile("C:/yourshapefile.shp")


          Voila, you map pops up as an image in a Tkinter window and you can also save the map to an image file. Styling, coloring, and adding multiple layers to a map is also possible, and in the newest version you can also classify based on attributes and zoom in to a particular region. In the map below geovis loaded and categorically colored all the world's GADM provinces in about 5 minutes. You can download GeoVis from here, where you can also read more about how to use it.



          enter image description here



          The aim is on easy installation as much as ease-of-use, so GeoVis can be used by anyone who has Python and does not require any other modules since it can use the builtin Tkinter Canvas as a renderer. But it is highly recommended that you have or get either Aggdraw, PIL, or PyCairo, which can also be used as renderers and are much faster and higher quality.



          Backdraw is your shapefile has to be unprojected with lat/long coordinate system--it doesn't yet handle projections or transformations.



          Hope it helps.






          share|improve this answer















          I've had similar problems where I want to visualize shapefiles quickly, and I've always found the Matplotlib way quite a lengthy way to accomplish such a small task. Instead I developed the "Python Geographic Visualizer" module, or GeoVis for short. Update: v0.2.0 is now out with lots of new functionality.



          With it visualizing shapefiles couldn't be easier:



          import geovis
          geovis.ViewShapefile("C:/yourshapefile.shp")


          Voila, you map pops up as an image in a Tkinter window and you can also save the map to an image file. Styling, coloring, and adding multiple layers to a map is also possible, and in the newest version you can also classify based on attributes and zoom in to a particular region. In the map below geovis loaded and categorically colored all the world's GADM provinces in about 5 minutes. You can download GeoVis from here, where you can also read more about how to use it.



          enter image description here



          The aim is on easy installation as much as ease-of-use, so GeoVis can be used by anyone who has Python and does not require any other modules since it can use the builtin Tkinter Canvas as a renderer. But it is highly recommended that you have or get either Aggdraw, PIL, or PyCairo, which can also be used as renderers and are much faster and higher quality.



          Backdraw is your shapefile has to be unprojected with lat/long coordinate system--it doesn't yet handle projections or transformations.



          Hope it helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 16 '14 at 23:56

























          answered Feb 21 '14 at 9:35









          Karim BahgatKarim Bahgat

          684811




          684811













          • I will definitely give it a try!

            – NYannickske
            Feb 28 '14 at 10:02






          • 1





            @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

            – Karim Bahgat
            Apr 17 '14 at 0:02













          • @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

            – Casivio
            Jan 14 at 21:13



















          • I will definitely give it a try!

            – NYannickske
            Feb 28 '14 at 10:02






          • 1





            @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

            – Karim Bahgat
            Apr 17 '14 at 0:02













          • @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

            – Casivio
            Jan 14 at 21:13

















          I will definitely give it a try!

          – NYannickske
          Feb 28 '14 at 10:02





          I will definitely give it a try!

          – NYannickske
          Feb 28 '14 at 10:02




          1




          1





          @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

          – Karim Bahgat
          Apr 17 '14 at 0:02







          @NYannickske just a heads up that I've just released a new version which greatly expands on the previous one and makes it a more complete map-making lib, with features like attribute classification, zooming, text rendering, and point symbolizers.

          – Karim Bahgat
          Apr 17 '14 at 0:02















          @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

          – Casivio
          Jan 14 at 21:13





          @KarimBahgat I tried to use that module but within it seems to have several dependencies on modules that I can't find via pip install.

          – Casivio
          Jan 14 at 21:13











          12














          I came across a number of tutorials dealing with this topic that I wanted to share:





          • So You’d Like To Make a Map Using Python - Stephan Hügel



            Choropleth map




          • How to Make a US County Thematic Map Using Free Tools - Nathan Yau



            Another choropleth map



          • A Thematic Map in Python - Daniel Lewis



          • Creating Map Visualizations in <10 lines of Python - Rob Story



            Yet another choropleth map




          You might also consider using R: How to create an attractive choropleth map in R?






          share|improve this answer


























          • Making maps with Vincent looks very promising, never heard of it before.

            – Karim Bahgat
            Jun 20 '14 at 0:33
















          12














          I came across a number of tutorials dealing with this topic that I wanted to share:





          • So You’d Like To Make a Map Using Python - Stephan Hügel



            Choropleth map




          • How to Make a US County Thematic Map Using Free Tools - Nathan Yau



            Another choropleth map



          • A Thematic Map in Python - Daniel Lewis



          • Creating Map Visualizations in <10 lines of Python - Rob Story



            Yet another choropleth map




          You might also consider using R: How to create an attractive choropleth map in R?






          share|improve this answer


























          • Making maps with Vincent looks very promising, never heard of it before.

            – Karim Bahgat
            Jun 20 '14 at 0:33














          12












          12








          12







          I came across a number of tutorials dealing with this topic that I wanted to share:





          • So You’d Like To Make a Map Using Python - Stephan Hügel



            Choropleth map




          • How to Make a US County Thematic Map Using Free Tools - Nathan Yau



            Another choropleth map



          • A Thematic Map in Python - Daniel Lewis



          • Creating Map Visualizations in <10 lines of Python - Rob Story



            Yet another choropleth map




          You might also consider using R: How to create an attractive choropleth map in R?






          share|improve this answer















          I came across a number of tutorials dealing with this topic that I wanted to share:





          • So You’d Like To Make a Map Using Python - Stephan Hügel



            Choropleth map




          • How to Make a US County Thematic Map Using Free Tools - Nathan Yau



            Another choropleth map



          • A Thematic Map in Python - Daniel Lewis



          • Creating Map Visualizations in <10 lines of Python - Rob Story



            Yet another choropleth map




          You might also consider using R: How to create an attractive choropleth map in R?







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 19 mins ago









          Glorfindel

          2751311




          2751311










          answered Jun 19 '14 at 10:06









          blah238blah238

          32.3k677168




          32.3k677168













          • Making maps with Vincent looks very promising, never heard of it before.

            – Karim Bahgat
            Jun 20 '14 at 0:33



















          • Making maps with Vincent looks very promising, never heard of it before.

            – Karim Bahgat
            Jun 20 '14 at 0:33

















          Making maps with Vincent looks very promising, never heard of it before.

          – Karim Bahgat
          Jun 20 '14 at 0:33





          Making maps with Vincent looks very promising, never heard of it before.

          – Karim Bahgat
          Jun 20 '14 at 0:33


















          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%2f61862%2fsimple-thematic-mapping-of-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

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...