Use OpenGL to draw shapefile files to accomplish the most basic GIS operations

Source: Internet
Author: User

Main Content Overview

1. Parse the Shapefile (. shp) file. ‘

2. Projection of latitude and longitude data according to Mercator (call Proj.4 Library).

3. Draw the data in OpenGL mode.

The above 3 aspects are only to complete the preliminary drawing, there is a big gap for the completion of a complex geographic information system,

Here's a simple geo-information framework I designed (for communication, progress). First, it's easier to understand the diagram.

Where the map frame contains multiple physical geographic layers, which are real layers, all the data under that layer is drawn onto the layer (that is, a picture).

The physical layer contains multiple logical layers (layer), which is a logical layer designed for use by the application layer and is used to classify map features for management

Use, the final layer contains the real map feature data, which is the data that is actually drawn for use.

In the actual application, the image data can be used as a physical layer, the vector feature data as a physical layer, and finally the two layers of the composite output.

Of course in practical applications, I added a layer, that is, the real-time drawing layer, the distance measurement, area measurement, angle measurement and so on the layer, so that the map refresh

The time to redraw the data is not much, improve the performance of the program.

First on a diagram, I am currently doing a simple GIS framework (just to meet my current needs, the main feature is fast). As shown in.

Initial completion of the above framework design, I got the above results, in this I would like to share with you is OpenGL in the processing of polygon filled area when the trouble, I will vector lines and polygons made two

Logical layer, so you can choose to display lines and polygons in both modes. In order to achieve efficiency, the biggest problem is drawing text, which is known as OpenGL without drawing text.

function, need to do their own, it used to my earlier essays, interested can be self-reference.

In order to do the bidding clubs function, in the interface spent a lot of my energy, in order to make the software for cross-platform purposes (can be used again andriod mobile platform), the interface I used OpenGL encapsulated a lightweight

Interface Library (this is not worth it), there are a lot of open-source interface library, such as Mygui,fastui,cegui, I have been useful, or in the efficiency can not meet my requirements, or occupy a larger memory,

In the end, I only wrote it myself.

Edit a variety of commonly used graphical interfaces as follows:

Finally, I added a curve template, that is, the better style can be saved as a template, the use of a direct drag-and-drop directly to the application.

as shown below.

It's done. Follow up if everyone feels OK, I will continue to write and share the code.

Use OpenGL to draw shapefile files to accomplish the most basic GIS operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.