鍦ㄦ柊鐗堟墜鏈哄湴鍥句腑錛岀煝閲忓浘灝嗘浛鎹㈠師鏈殑2D鐢婚潰涓虹敤鎴峰憟鐜板嚭鍏ㄦ柊鐨?D鐣岄潰錛岀敤鎴峰彲浠ヨ嚜鐢辯殑杞姩鍜岀緝鏀俱傛澶栫敤鎴瘋繕灝嗕細(xì)鑾峰緱紱葷嚎鍦板浘嫻忚鍔熻兘錛屼笉鐢ㄥ湪嫻忚鍦板浘鏃朵繚鎸佸湪綰跨姸鎬併?/p>
Google鐜板湪鍦ㄥ叾瀹樻柟鎵嬫満棰戦亾鍙堟斁鍑轟簡(jiǎn)涓孌電敤Nexus S榪愯鏂扮増Maps搴旂敤鐨勫叏鍔熻兘婕旂ず錛岃繖嬈捐蔣浠跺皢浼?xì)闅廚exus S涓婂競(jìng)錛屼箣鍚庢彁渚涘叾浠栬澶囨洿鏂幫紝浣嗘槸瀵規(guī)墜鏈虹‖浠舵湁涓瀹氱殑瑕佹眰錛屾柊嬈?00MHz鑷?GHz澶勭悊鍣ㄤ笖閰嶆湁涓撶敤鍥懼艦鏍稿績(jī)鐨勬墜鏈烘墠鑳芥敮鎸?D瑙嗗浘銆?/p>
new OpenLayers.Request.GET( {
url : "http://search.tianditu.com/wfs?request=GetFeature",
params: {
typeName: "DOMAIN_POI_NEW",
FEATUREID: "DOMAIN_POI_NEW.6649356"
},
callback : handler
});
//浣跨敤BBOX鏌ヨ
new OpenLayers.Request.GET( {
url : "http://search.tianditu.com/wfs?request=GetFeature",
params: {
typeName: "DOMAIN_POI_NEW",
BBOX: "105.99,29.99,106,30" //map.getExtent().toBBOX()
},
callback : handler
});
璇存槑錛?br />
url WFS鏈嶅姟鍣ㄥ湴鍧錛屽繀欏誨姞涓?request=GetFeature
typeName 鍥懼眰鍚嶇О
FEATUREID WFS鐨勫浘鍏僆D錛岄噰鐢ㄦ爣鍑嗘牸寮忥細(xì) [鍥懼眰鍚峕.[OID緙栧彿]
BBOX 鎸囧畾鍖哄煙鏌ヨ錛屾敞鎰忎笉瑕佽緗繃澶э紝鍚﹀垯嫻忚鍣ㄥ彲鑳藉け鍘誨搷搴斻?/p>
閫氳繃POST鏂瑰紡璁塊棶“澶╁湴鍥?#8221;WFS鏈嶅姟錛屽彲浠ヤ嬌鐢∣penLayers.Request.POST綾伙紝紺轟緥浠g爜濡備笅錛?/p>
var xmlPara = "<?xml version='1.0' encoding='UTF-8'?>"
+ "<wfs:GetFeature maxFeatures='100' service='WFS' version='1.0.0' "
+ "xmlns:wfs='http://www.opengis.net/wfs' "
+ "xmlns:gml='http://www.opengis.net/gml' "
+ "xmlns:ogc='http://www.opengis.net/ogc' "
+ "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
+ "xsi:schemaLocation='http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd'>"
+ "<wfs:Query typeName='iso19112:SI_Gazetteer' srsName='EPSG:4326'>"
+ "<ogc:Filter xmlns:ogc='http://www.opengis.net/ogc'>"
+ "<ogc:And><ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>"
+ "<ogc:PropertyName>STANDARDNAME</ogc:PropertyName>"
+ "<ogc:Literal>*瑙f斁紕?</ogc:Literal>"
+ "</ogc:PropertyIsLike></ogc:And></ogc:Filter>"
+ "</wfs:Query></wfs:GetFeature>";
var request = OpenLayers.Request.POST( {
url : "http://search.tianditu.com/wfs?",
data : xmlPara,
callback : handler
});
};
璇存槑錛?/p>
url WFS鏈嶅姟鍣ㄥ湴鍧
data WFS璇鋒眰姝f枃錛岃繑鍥炵殑GML鐢卞洖璋冨嚱鏁癶andler澶勭悊
handler璐熻矗澶勭悊鏈嶅姟绔繑鍥炵殑GML鏁版嵁錛屼篃灝辨槸鐭㈤噺鍖栫殑鍦板浘鏁版嵁錛屾牴鎹簲鐢ㄩ渶姹傜紪鍐欎唬鐮侊紝鑾峰彇feature鐨勯氱敤浠g爜濡備笅錛?br />
var g = new OpenLayers.Format.GML();
var features = g.read(req.responseText);
for ( var i = 0; i < features.length; ++i) {
var feature = features[i];
var geometry = feature.geometry;
var attributes = feature.attributes;
}
瀹氫箟榪囨護(hù)鏉′歡鏃惰浣跨敤STANDARDNAME瀛楁錛屼笉瑕佷嬌鐢―OMAINNAME瀛楁錛屽墠鑰呭簲璇ユ湁绱㈠紩鏀寔錛岃屽悗鑰呮病鏈夛紝鏌ヨ閫熷害宸埆寰堝ぇ銆?/p>
緇忚繃嫻嬭瘯錛宼ypeName="DOMAIN_POI_NEW"鍜宼ypeName="iso19112:SI_Gazetteer"閮借兘榪斿洖緇撴灉銆傜敱浜庣己灝戝畼鏂規(guī)枃妗h鏄庯紝涓嶇煡閬撹繖涓や釜鍥懼眰鏈変綍鍖哄埆銆?br />
灝濊瘯浣跨敤OpenLayers.Protocol.WFS鏃犳硶璁塊棶“澶╁湴鍥?#8221;WFS鏈嶅姟錛屾湇鍔″櫒榪斿洖: 璇鋒眰鍙傛暟[REQUEST]鐨勫間負(fù)絀烘垨涓嶆紜?/p>
鎻愰啋: 浣跨敤POST鏌ヨ鏃訛紝欏甸潰鏂囦歡鎴栦唬鐮佹枃浠跺姟蹇呬繚瀛樹負(fù)utf-8緙栫爜錛屽鏋滀嬌鐢╣bk銆乬b2312緙栫爜錛屾眽瀛楀湴鍚嶄細(xì)鍙樻垚涔辯爜錛屽鑷磈avascript浠g爜閿欒銆?/p>
鏁版嵁綾誨瀷 |
鏁版嵁婧?/span> |
綰у埆 |
鏈嶅姟鍦板潃 |
綰垮垝鍦板浘 |
鍏ㄧ悆1:100涓囧湴鐞嗗簳鍥?/span> |
2-10綰?/span> |
http://tile0.tianditu.com/services/A0512_EMap http://tile0.tianditu.com/services/AB0512_Anno |
鍏ㄥ浗1:25涓囧叕寮鐗堟暟瀛?/span>鍦板艦鍥?/span> |
11-12綰?/span> |
http://tile0.tianditu.com/services/B0627_EMap1112 |
|
鍏ㄥ浗杞﹁澆瀵艱埅 |
13-18綰?/span> |
http://tile0.tianditu.com/services/siwei0608 |
|
鍗槦褰卞儚 |
鍏ㄧ悆250綾沖崼鏄熷獎(jiǎng)鍍?/span> (MODIS) |
2-7綰?/span> |
http://tile0.tianditu.com/services/sbsm0210 |
鍏ㄥ浗15綾沖崼鏄熷獎(jiǎng)鍍?/span> (ETM) |
8-10綰?/span> |
||
鍏ㄥ浗2.5綾沖崼鏄熷獎(jiǎng)鍍?/span> (P5) |
11-14綰?/span> |
http://tile0.tianditu.com/services/e11 http://tile0.tianditu.com/services/e12 |
|
鍦扮駭鍩庡競(jìng)0.6綾沖崼鏄熷獎(jiǎng)鍍?/span> (QuickBird銆?/span>WorldView I銆?/span>WorldView II) |
15-18綰?/span> |
http://tile0.tianditu.com/services/sbsm1518 |
|
鏁板瓧楂樼▼妯″瀷 |
鍏ㄧ悆90X90綾蟲暟瀛楅珮紼嬫ā鍨?/span> |
|
http://tile0.tianditu.com/services/J07098 |
鍦板悕鍦板潃 |
鍏ㄧ悆1:100涓囧湴鍚嶅湴鍧 |
|
http://search.tianditu.com/wfs |
鍏ㄥ浗1:25涓囧湴鍚嶅湴鍧 |
|||
鍏ㄥ浗杞﹁澆瀵艱埅鍦板悕鍦板潃 |
GeoSurf
澶栵紝娌℃湁浠諱綍鍙樺寲銆備笉鐭ラ亾Openlayers欏圭洰緇勫氨姝や綔浣曟劅鎯熾?br />
姝e洜涓哄姝わ紝鎴戜滑鍙互鍙傝僌penLayers.Layer.TileCache鍜孫penLayers.Layer.XYZ綾伙紝緙栧啓涓涓笓鐢ㄤ簬璇誨彇“澶╁湴鍥?#8221;鐨凾DTLayer綾伙紝浣縊penlayers鑳藉鐩存帴璁塊棶“澶╁湴鍥?#8221;鐨勫湪綰垮湴鍥炬暟鎹?br />
“
澶╁湴鍥?#8221;鍦扮悊淇℃伅鏁版嵁璧勬簮鍒楄〃灝嗗湴鍥劇摝鐗囧垎涓?6綰э紙L=2-18錛夛紝鍏朵腑L=2綰ф瘮渚嬪昂鏈灝忥紝瀵瑰簲鍏ㄧ悆鍦板浘銆?br />
L=2綰у彧鏈?涓摝鐗囨枃浠訛紝鍒嗗埆鏄?/span>錛?br />
X= 0 1 2 3 0 1 2 3 Y= 0 0 0 0 1 1 1 1
L=3綰ф湁32涓摝鐗囨枃浠訛紝鍒嗗埆鏄細(xì)
X= 0-7
Y= 0-3
L=4綰ф湁128涓摝鐗囨枃浠訛紝鍒嗗埆鏄細(xì)
X= 0-15
Y= 0-7
鍏朵綑鍚勭駭浠ユ綾繪帹錛屾瘡綰х殑鐡︾墖鏂囦歡鏁版瘮鍓嶄竴綰у鍔?鍊嶏紝鍏朵腑綰垮垝鍦板浘10綰т互涓婏紝鍗槦鍦板浘8綰т互涓婂彧鎻愪緵涓浗澧冨唴鐨勬暟鎹紝娌℃湁瑕嗙洊鍏ㄧ悆銆?br />
鏌ョ湅
GeoGlobe API涓諱唬鐮?code class="jscript plain">GeoSurfJSAPI.js鏂囦歡錛堢浉褰撲簬Openlayers.js錛?/code>錛屽彲浠ヤ簡(jiǎn)瑙(x_num)銆乊(y_num)銆丩(level)鐨勭敓鎴愭柟娉曪紝浼唬鐮佸涓嬶細(xì)
level=getLevelForResolution(map.getResolution()); //璁$畻鐡︾墖綰у埆
coef=TopTileSize.w/Math.pow(2,level); //涓棿緋繪暟
x_num=this.pyramid.topTileFromX<this.pyramid.topTileToX?Math.round((bounds.left-this.pyramid.topTileFromX)/coef):Math.round((this.pyramid.topTileFromX-bounds.right)/coef);
y_num=this.pyramid.topTileFromY<this.pyramid.topTileToY?Math.round((bounds.bottom-this.pyramid.topTileFromY)/coef):Math.round((this.pyramid.topTileFromY-bounds.top)/coef);
鏍規(guī)嵁褰撳墠鍒嗚鯨鐜囪綆楀湴鍥劇摝鐗囩駭鍒?br />
function getLevelForResolution(res){
var ratio=map.getMaxResolution()/res;
if(ratio<1)return 0;
for(var level=0;ratio/2>=1;)
{level++;ratio/=2;}
return level;
}
緇忚繃綆鍗曟祴璇曪紝“澶╁湴鍥?#8221;鍜岃胺姝屽湴鍥懼湪鏁版嵁涓婂樊鍒笉澶э紝浜屾寮鍙戞柟闈㈠熷姪浜庡己澶?code class="jscript plain">
鐨凮penlayers鍦板浘瀹㈡埛绔紩鎿庝笉浼?xì)寮变簬Google Map API錛屽敮鐙湪閫熷害涓婁笌璋鋒瓕鍦板浘瀛樺湪杈冨ぇ宸窛錛岀壒鍒槸鍦板浘鏀懼ぇ鍒?3綰?18綰ф椂錛屽歡榪熷彉寰楅潪甯告槑鏄撅紝鏈夋椂鐢氳嚦鏃犳硶鏄劇ず銆?br />
浣跨敤Firebug璺熻釜榪愯鍙戠幇錛屽ぇ綰?/3鐨勫湴鍥劇摝鐗囪姹傝秴鏃訛紝瀵艱嚧瀹㈡埛绔鍙栧け璐ャ?br />
“澶╁湴鍥?#8221;鐩墠榪樺浜庢祴璇曢樁孌碉紝甯屾湜鐩稿叧鍗曚綅緇х畫鏀硅繘鍜屾彁鍗囨湇鍔″櫒绔ц兘錛屽揩閫熺ǔ瀹氱殑鍝嶅簲澶ч噺瀹㈡埛绔彂鍑虹殑騫跺彂璇鋒眰銆?br />
嫻嬭瘯涓彂鐜幫紝“澶╁湴鍥?#8221;寮鏀劇殑鍦板浘鏁版嵁鏈嶅姟鎺ュ彛浠?span lang="EN-US">tile0.tianditu.com涓鐩村埌tile7.tianditu.com銆備緷嬈ing 榪?涓湇鍔℃帴鍙o紝tile1鍒?/span>tile7鐨勫搷搴旈熷害鐩稿杈冨揩銆備慨鏀瑰鎴風(fēng)js浠g爜錛屽皢鐡︾墖鍦板浘璇鋒眰騫沖潎鍙戦佺粰tile0鍒?/span>tile7 鍏釜鏈嶅姟鎺ュ彛錛屽彲浠ユ湁鏁堝姞蹇湴鍥炬樉紺洪熷害銆?/span>“澶╁湴鍥?#8221;鎻愪緵鐨凣eoSurfJSAPI.js涓?/code>宸茬粡鍖呭惈鐩稿叧浠g爜錛岄氳繃緇橪ayer鐨刴irrorUrl灞炴ц祴鍊鹼紝鍙互鍧囪 璇誨彇鎸囧畾鐨勫涓湇鍔℃帴鍙o紝浠g爜濡備笅錛?br />
var layer3 = new GeoSurf.Layer.GlobeTile("siwei0608", "http://tile6.tianditu.com/services/siwei0608", {
transitionEffect: "resize",
topLevel: 13,
bottomLevel: 18,
maxExtent: new GeoSurf.Bounds(100, 27, 110, 34),
mirrorUrls: [
"http://tile1.tianditu.com/services/siwei0608",
"http://tile2.tianditu.com/services/siwei0608",
"http://tile3.tianditu.com/services/siwei0608",
"http://tile4.tianditu.com/services/siwei0608",
"http://tile5.tianditu.com/services/siwei0608",
"http://tile6.tianditu.com/services/siwei0608"
]
});
瀹㈡埛绔嬌鐢ㄤ笂榪拌鍙栫瓥鐣ュ悗錛屽嵆渚挎斁澶у埌17-18綰э紝鏁村箙鍦板浘涔熻兘澶熷畬鍏ㄦ樉紺猴紝閫熷害鏈夋槑鏄劇殑鎻愬崌銆?br />

]]>
Something users have asked for since the addition of WMS support itself is cascading, the ability of GeoServer to proxy for another remote WMS server like MapServer or another GeoServer. This feature has many uses such as pulling in a remote base layer and overlaying local vector data onto it or securing a locally unsecured map server. Special thanks to the University of Perugia for sponsoring this feature.
Read more about WMS cascading.
Anyone who has published a large number of layers or feature types with GeoServer has probably at some point been annoyed by the fact that every single layer is published by a single global service. WMS has the ability to group and nest layers but WFS and WCS have no such equivalent. Well now with virtual services one can create multiple service endpoints within a single physical geoserver instance.
Special thanks to Landgate for funding this work.
Read more about virtual services.
GeoServer has always been good at publishing a flat database table. But users often need to do more such as pre filter the data in a table, or join two tables together, or generate column values on the fly with a function. Before this feature the recommendation was to create a view. However views can be a maintenance burden and are at times problematic.
Now one can create a layer directly from an SQL query. And on top of that query definitions can be parameterized which allows one to create dynamic queries on the fly. These parameters can be restricted with regular expressions in order to prevent an SQL injection security hole.
Special thanks to Andrea for spending much of his personal time on this one. And also to OBIS who provided the funding for the parametric component of the work.
Read more about SQL layers.
With 2.1 and the arrival of WPS we welcome a new OGC service to the family. The Web Processing Service is an OGC service for performing geospatial analysis functions over the web. The specification is extensible in nature and allows for simple processes like buffering a geometry to more complex processes such as image processing.
Historically GeoServer has been focused primarily on data delivery without any tools for performing analysis of spatial data. WPS fills that gap making GeoServer a more compete solution for geospatial web services.
Thanks to Refractions Research for the initial contribution of the WPS module and to Andrea once again for taking personal time to bring WPS support to its current state.
Read more about WPS. Download the WPS extension now to try it out.
Support for units in SLD allows one to specify values in measurements other than pixels such as feet or meters. This adds a very powerful capability to SLD that in many cases alleviates the need for multiple scale dependent rendering rules. This has the upside of greatly simplifying complex SLD documents.
Special thanks to Milton Jonathan who did the initial GeoTools work to make unit of measure support possible and to Andrea for working with Milton to improve the initial patch. Note that this feature has also been backported to the stable 2.0.x branch. Thanks to SWECO and Malmö City of Sweden for sponsoring the backport.
Read more about UOM support.
By default GeoServer renders images at a resolution of 90 DPI. While this is acceptable for the standard screen it is not acceptable for print which requires a higher resolution. Now it is possible to supply a format option to a WMS request on the fly that controls the DPI setting.
Special thanks again to SWECO and to Malmö City of Sweden for sponsoring this work. Note also that this feature has also been backported to the stable 2.0.x branch.
Read more about DPI scaling.
娉ㄦ剰錛氫笉瑕佸湪FROM涔嬪墠鍔犲叆灞炴у瓧孌靛悕錛屽睘鎬у瓧孌靛彲娣誨姞鍦‵ROM鍚庣殑瀛愭煡璇腑錛屽涓嬫墍紺?br />"Test Map",
GEOLOC FROM (SELECT MI_PRINX AS OID, NAME AS ONAME, COLOR AS COLOR, GEOLOC AS GEOLOC FROM NAV_ROAD1) USING SRID 4326
LABEL鎴朣TYLE鐢ㄥ埌鐨勫睘鎬у瓧孌靛繀欏誨寘鍚湪SELECT瀛愭煡璇腑銆?br />
淇敼openlayers瀹㈡埛绔唬鐮?br />
var ms_layer = new OpenLayers.Layer.WMS(