GISCRIPT2015 's first introductory tutorial-using UbuntuKylin15.04

Source: Internet
Author: User

GISCRIPT2015 is a general-purpose GIS scripting library that can help with the processing and analysis of geospatial data, improve the efficiency of data processing, and help with the research of geography science. GISCRIPT2015 is an open source project that has built git repositories and virtual team, groups (two: Giscript languages, giscript developers).

The difference between GIScript2015 and Giscript is that the 2015 version is fully encapsulated in SIP and has good compatibility with Qt and PYQT, and interfaces can be consistent with C + +, thus reducing the package maintenance resources and increasing ease of use. GISCRIPT2015 has now completed the Windows/linux 64-bit base version, which can be run on UbuntuKylin15.04.

GISCRIPT2015 can support the Python parallel framework celery (which I have tested) for distributed data processing scheduling operations. This with Hadoop and Spark should also be able to hook up to run, interested students can try. In addition, the UGC-based library can support MongoDB, which is a powerful tool for storing and processing big data.

Now, let's start with a simple routine, feel the process of giscript running, and experience the "Lazy man mode" of scripting.

Giscript is completely green software, copy-ready, without the need for a special complex installation, using Python3.

But, the UGC SIP package because all open source comes out, if is obtains the original project, needs own advanced LINUX64-GCC4.9/SIP/UGC this directory to run Make/make installs to compile and install (if is the version which the specific operating system is compiled, Then the copy is available). Because SIP encapsulation is used, it is necessary to compile and install SIP first. Need to know the detailed content can see here: http://my.oschina.net/u/2306127/blog/470102. This is an open support library mode, you can also write a C + + library, refer to this encapsulation process made python to use, to integrate different functions together.

into the system directory.

#运行gis. SH, enter python3./gis.sh

Or, run a test directly.

./gisrun.sh/testbed/test.py

Let's look at the contents of gisrun.sh first.

#!/bin/shecho  "========================================================" echo  "*GIScript---Scripting  The World.                        * "echo " ******************************************* "echo " *giscript starting...                                    * "echo " *project: https://git.oschina.net/supergis/ giscript2015* "echo " *devteam: https://team.oschina.net/giscript/tweet       * "echo " ======================================================== "#set  the  enviroment-variable.export supermap_home=/home/supermap/giscript/giscript2015/linux64-gcc4.9export  Ld_library_path= $LD _library_path: $SUPERMAP _home/bin#start run python script.if [ x$1 != x ]then     echo  "Run file:"  $1    python3 $1else     echo  "usage: gisrun.sh myprocess.py" fi

This script will set the environment variable and then start Python3 to run a python file.

If the installation path of the GIScript2015 is different from the above supermap_home, modify the change path.

Let's look at what's inside test.py:

#!/usr/bin/python# -*- coding: utf-8 -*-import sysimport osimport pyugcfrom  pyugc import ugcfrom pyugc import ogdcif __name__== ' __main__ ':     DS = UGC. Ugdatasourcemanager.createdatasource (UGC). UDB)     con = ds. Getconnectioninfo ()     strtemp = ogdc. Ogdcmbstring ("/home/supermap/giscript/giscript2015/data/world.udb")     ogdc. Mbstring2unicode (Strtemp, con.m_strserver)     bopen = ds. Open ()     if bOpen[0] == 1:         Print ("Open Data source succeeded!! ")     else:        print (" Failed to open Data source!! ")     strfilename = ogdc. Ogdcunicodestring ()     strtemp = ogdc. Ogdcmbstring ("/home/supermap/giscript/giscript2015/data/grid_INT32.GRD ")     ogdc. Mbstring2unicode (Strtemp, strfilename)     importparams = ugc. Ugexchangeparamsmanager.makeimportparams (UGC). Ugfiletype.aiasciigrid)     importparams.setimportmode (UGC). Ugimportparams.modegrid)     importparams.setfilepathname (strFileName)          DATAEXCHANGE = UGC. Ugdataexchange ()     dataexchange.attachdatasource (DS)     bissuccss  = dataexchange.import (Importparams)     if bIsSuccss == 1:         print ("Data import successful!! ")     else:        print (" Data import failed!! ")         pass    del importParams     ds. Close ()     del ds    pass

This routine opens a data source and then imports a raster file into it.

According to this example, you can write a batch data import script to achieve fast data import.



GISCRIPT2015 's first introductory tutorial-using UbuntuKylin15.04

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.