实例介绍
PostGIS, GeoDjango,OpenLayers 三者结合实现webgis。
OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 3 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers What's the Big Deal with GIs? a Gis- Geographic Information Systems Designed to add the whereto the what" when","how, why"of things o Uses industry standard terms and mechanism to allow people to share data dealing with location on a planet( typically, earth but works for your planet of choice) s Used to answer questions like: How many Republicans are in a voting district? - What city is my plane currently flying over? What's the average value of land in San Jose? How can i re-draw school district lines to ensure that my school isn 't overcrowded? What's the shortest route from x to y? Where is my iPhone right now? One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 4 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers GS Fundamentals One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 5 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers What is asz e Gis or Geographical Information Systems are systems that are used to capture, store, display r and analyze geospatial data, and its associated attributes. The term geospatial refers specifically to the planet earth(or some other planet) as the basis of its coordinate system Gis tools allow us to generate queries(against a database in most cases) that allow us to analyze spatial information edit data, maps and display or store the results of such operations a Most Gis data includes two components A spatial component- this describes the location or spatial distribution of some kind of geography. Spatial components are typically represented using one of two methods a As a field representation. In a field representation each point in the space has an assigned value this leads to a raster data mode raster models use a matrix, where each cell contains a value (for example an elevation or other properties a As a set of points that are strung together to make lines or polygons. This is known as a vector data model. postGis and geoDjango are both designed to use vector data 9 An attribute -which is used to describe the properties of the spatial component One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 6 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers Vector data a GeoDjango and posgis both store and manage spatial data using a vector model a Unlike raster data, which is made up of " boxes"or pixels" vector data is comprised of lines or arcs Each line or arc is defined by a beginning or end points with each set of points meeting at a node The node location itself, and the topological structure usually stored explicitly. e Features are defined by their boundaries and curved lines are represented as a series of connecting arcs. a Geo spatial data in a vector format is stored as a set of coordinates. the basic units used to represent this information is o Points-a zero-dimensional abstraction of an object represented by a singly X,y coordinate set. Lines-a set of coordinates that represent the shape of a geographic feature too narrow to be displayed as an area(such as a street, runway, sewer line, or stream) Polygon -a feature that is used to represent an area. a polygon is defined by lines that make up its boundaries. Additionally a polygon will have a point defined inside its boundary to be used for identification One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 7 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers Spatial Reference Systems a The spatial reference system(Srs)is a combination of the projection and the datum being used Basically, it defines an ellipsoid It then defines a datum using that ellipsoid Lastly it defines a geocentric, geographic, or projection e The projection being used always has a geographic coordinate system associated with it s The european Petroleum Survey Group(epsg has a set of pre-defined spatial references each of which has been assigned a unique id(an EPSg number) PostGiS uses a spatial reference identifier(srid) to indicate the spatial reference used by a geometry. a So whenever we talk about Geospatial data, we are referring to the following as a point of reference 1. An Ellipsoid 2. A Datum using that ellipsoid(the datum provides the center and orientation for the ellipsoid by mapping it on to the surface of the planet at a particular point in time) 3. Some projection(actually, we could have it defined as geocentric or geographic as well e Usually we use a standardized EPSg spatial reference system for the geographic coordinate system One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 opentechnologygroupco Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 8 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers About postGis e PostGis is a set of extensions to the postgresQL object-Relational Database system(the world' s most advanced Open Source database g PostGis adds spatial datatypes operators, and functions to PostgreSQL. An indexing strategy to quickly and easily locate features relative to other features s a set of functions to perform re-projection of data from one spatial reference system to another. -i Thus allowing table "a"to use one EPSg value and b"to use another, and joins"to be performed between geometries in the two y a set of functions to construct a new geometry from existing ones Merge two geometries together. Expand a geometry out to make it bigger. A set of functions to perform geometric tests(what is the distance between these two geometries, does this geometry overlap this other geometry etc) a Closest analogous tools would be ESRI Spatial Database Engine (SDE)($$s) ◆ Oracle spatial($$) s MySQL Spatial (immature/feature poor) o Used by lots of bug guys Natural Resources Canada, US Navy US Army NaSa, noaa-just to name a few e Can do path routing using tools like pgRouting One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 9 of 73 OPEN TECHNOLOGY Spatializing your Data with PostGIs. GROUP GeoDjango, and open Layers About GeoDjango e GeoDjango is an extension of the Django Model-Template-View(MTv) web development framework s GeoDjango provides a number of modules classes and tools that may be used to quickly develop and deploy web applications that use geospatial technologies g Like Django GeoDjango is designed to be fast and easy and lets you build high-performing elegant Web applications quickly g GeoDjango focuses on a philosophy known as "Dont repeat yourself"(DRY, which states that every piece of knowledge must represented in a single, unambiguous and authoritative way in the system To this end, geoDjango eschews the duplication of code a geoDjango expands upon Django's framework by adding a number of models associated with geospatial technologies along with some related tools to import, export, and manage data e geoDjango's admin interface provides an Openlayers interface that may be used to modify and manage spatial data stored in the database a GeoDjango allows developers to build powerful application using postGis without knowing SQL, PostGIS specifics etc One Copley Parkway, Suite 210 Morrisville, Nc 27560 Phone: 919.463.0999 Fax: 866-229-3386 www.opentechnologygroup.com Copyright @2004-2009 Open Technology Group, Inc. All rights reserved Reproduction and redistribution of this document in its unmodified form is allowed Page 10 of 73 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论