02 2014 档案
摘要:今天一个同事反映,使用curl发起https请求的时候报错:“SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed”很明显,验证证书的时候出现了问题。使用curl如果想发起的https请求正常的话有2种做法:方法一、设定为不验证证书和host。在执行curl_exec()之前。设置option$ch = curl_init();......curl_seto
阅读全文
摘要:from:http://www.oklinux.cn/html/developer/shell/20070626/31550.htmlawk中使用的shell命令,有2种方法:一。使用所以system()awk程序中我们可以使用system() 函数去调用shell命令如:awk 'BEGIN{system("echo abc")}' fileecho abc 就会做为“命令行”,由shell来执行,所以我们会得到以下结果:root@ubuntu:~# awk 'BEGIN{system("echo abc")}'abcr
阅读全文
摘要:setTimeout()在js类中的使用方法setTimeout (表达式,延时时间)setTimeout(表达式,交互时间)延时时间/交互时间是以豪秒为单位的(1000ms=1s)setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次setTimeout 在执行时,它从载入后,每隔指定的时间就执行一次表达式1,基本用法: 执行一段代码: var i=0; setTimeout("i+=1;alert(i)",1000); 执行一个函数: var i=0; setTimeout(function(){i+=1;alert(i);},1000)
阅读全文
摘要:跟java里的split函数的用法是很相像的,举例如下:Theawkfunctionsplit(s,a,sep) splits a stringsinto anawkarrayausing the delimitersep.set time = 12:34:56set hr = `echo $time | awk '{split($0,a,":" ); print a[1]}'` # = 12set sec = `echo $time | awk '{split($0,a,":" ); print a[3]}'` # =
阅读全文
摘要:awk 里的substr函数用法举例:要截取要截取的内容1:F115!16201!1174113017250745 10.86.96.41 211.140.16.1 200703180718F125!16202!1174113327151715 10.86.96.42 211.140.16.2 200703180728F235!16203!1174113737250745 10.86.96.43 211.140.16.3 200703180738F245!16204!1174113847250745 10.86.96.44 211.140.16.4 200703180748F355!16205
阅读全文
摘要:awk用法:awk'pattern{action}'变量名 含义ARGC 命令行变元个数ARGV 命令行变元数组FILENAME 当前输入文件名FNR 当前文件中的记录号FS 输入域分隔符,默认为一个空格RS 输入记录分隔符NF 当前记录里域个数NR 到目前为止记录数OFS 输出域分隔符ORS 输出记录分隔符1、awk'/101/'file显示文件file中包含101的匹配行。awk'/101/,/105/'fileawk'$1==5'fileawk'$1=="CT"'file注意必须带双引号a
阅读全文
摘要:So I have 25 shapefiles with data for 25 counties, and I want to merge them all into one shapefile.Using OGR,you can merge 2 files like this:ogr2ogr merge.shp file1.shpogr2ogr -update -append merged.shp file2.shp -nln mergeYou create a new shapefilemergedand copy the contents offile1into the new sha
阅读全文
摘要:1、system(执行shell 命令)相关函数 fork,execve,waitpid,popen表头文件 #include定义函数 int system(const char * string);函数说明 system()会调用fork()产生子进程,由子进程来调用/bin/sh-cstring来执行参数string字符串所代表的命令,此命令执行完后随即返回原调用的进程。在调用system()期间SIGCHLD 信号会被暂时搁置,SIGINT和SIGQUIT 信号则会被忽略。返回值 如果system()在调用/bin/sh时失败则返回127,其他失败原因返回-1。若参数string为空指针
阅读全文
摘要:linux下运行,因为大部分shapefile 文件,在使用时都没有指定字符集,所以qgis只能从环境变量中获取设置环境变量中获取SHAPE_ENCODING。目前唯一的解决办法就是设置环境变量$ SHAPE_ENCODING=UTF-8$ export SHAPE_ENCODING$ qgisI insist that this is a QGIS issue.GDAL 1.9.0 (and newer) is trying to interpret the encoding setting from the shape file itself. When creating a new sh
阅读全文
摘要:OGR 官方文档http://www.gdal.org/ogr/index.htmlThe OGR Simple Features Library is a C++open sourcelibrary (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB for
阅读全文
摘要:This document is intended to document using the OGR C++ classes to read and write data from a file. It is strongly advised that the read first review theOGR Architecturedocument describing the key classes and their roles in OGR.It also includes code snippets for the corresponding functions in C and
阅读全文
摘要:ESRI Shapefiles (SHP)Also known as ESRI ArcView Shapefiles or ESRI Shapefiles. ESRI is the company that introduced this format. ArcView was the first product to use shapefiles.File listingShapefiles are made up of a minimum of three similarly named files, with different suffixes:Countries_area.dbfCo
阅读全文
摘要:摘要: 属性选择与空间选择都可以看作是OGR内置的选择功能,这两种功能可以解决大部分实际中的问题。但是也有这种时候,就是进行查询时的条件比较复杂。针对这种情况,OGR也提供了更加灵活的解决方案:支持使用SQL语句进行查询。 例如执行SQL查询语句ExecuteSQL(...属性选择与空间选择都可以看作是OGR内置的选择功能,这两种功能可以解决大部分实际中的问题。但是也有这种时候,就是进行查询时的条件比较复杂。针对这种情况,OGR也提供了更加灵活的解决方案:支持使用SQL语句进行查询。例如执行SQL查询语句ExecuteSQL(),凭借SQL的强大功能,可以执行更复杂的任务。例如下面这段代码,是
阅读全文
摘要:其计算公式应是:任何一个十进制数表示的经、纬度数,其整数即是度数,其小数部分乘以60得到的数的整数部分即是分数,再用该数的小数部分乘以60 得到的数就是秒数。例:36.12432314转换成度分秒的数是:其度数是"36",其分是"0.12432314×60=7.4593884"的整 数"7",其秒是"0.4593884×60=27.5639304","27.6"----36°7′27.6〃。计算原理:保留取整部分,小数×60 经度: 14° 0.
阅读全文
浙公网安备 33010602011771号