We can only draw polygons with the GUI framework polygon function. Once this is done, we have a set of shapes, polygons and mutipolygons. To read the shapefile and extract the shapes it contains, we will use the pyshp library. Polygons and multipolygons are defined as a set of points (longitude, latitude) on the earth. For a map, there are two types of shapes: polygons and multipolygons. A shapefile (.shp) is a file that describes vector data as a set of shapes. To draw the polygons, we need their coordinates. In the extended version, besides the import of shapefiles, nodes and links can be created on the map by importing an Excel file (an example is available in the 'PyGISS/projects' folder).Ī pyEarth project can then be exported to Google Earth (a KML file is created).Īs shown below with Italy, a map can be represented as a set of polygons. Extended version (extended_pyEarth.py, < 300 lines) pressing space will start a continuous rotation of the earth.Ī few shapefiles are available for testing in the 'pyEarth/shapefiles' folder (world countries, US).the right-click button moves the view in the 3-dimensional space (like a viewfinder).the left-click button rotates the earth in any direction.the scroll wheel for zooming in and out.Maps can be created by importing shapefiles, and the following bindings are implemented: The standard version implements pyEarth in less than 150 lines of code. PyEarth versions Standard version (pyEarth.py, < 150 lines) create objects (nodes or links) using Excel.import shapefiles to visualize maps in 3D.PyEarth is a lightweight 3D visualization of the Earth implemented with pyQt and OpenGL: it is the 3D counterpart of pyGISS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |