SlideServe
Menu
Préférences
© SlideServe · v2026

Geometric data of PostgreSQL

mika avatar
29 diapositives · 525 Views · Sep 10, 2014

Geometric data of PostgreSQL. นำเสนอโดย. นางสาวกุลชลี รัตนคร. 44031116 ชั้นปีที่ 4. ภาควิชาวิทยาการคอมพิวเตอร์ มหาวิทยาลัยบูรพา. หัวข้อในการนำเสนอ. 1. PostgreSQL คืออะไร 2. ทำไมถึงเลือกใช้ PostgreSQL 3. Geometric Data คืออะไร 4. Data type of PostgreSQL

Geometric data of PostgreSQL - slide 1
01 / 29Geometric data of PostgreSQL
1 / 17

Télécharger la présentation

Geometric data of PostgreSQL
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Geometric data of PostgreSQL นำเสนอโดย นางสาวกุลชลี รัตนคร 44031116 ชั้นปีที่ 4 ภาควิชาวิทยาการคอมพิวเตอร์ มหาวิทยาลัยบูรพา

  2. หัวข้อในการนำเสนอ 1. PostgreSQL คืออะไร 2. ทำไมถึงเลือกใช้ PostgreSQL 3. Geometric Data คืออะไร 4. Data type of PostgreSQL 5. Geometric Data type of PostgreSQL 6. Function and Operator of PostgreSQL 7. Geometric Function and Operator of PostgreSQL 8. Example

  3. PostgreSQL PostgreSQLคือ ระบบจัดการฐานข้อมูลเชิงวัตถุ-สัมพันธ์ (Object-Relational Database Management System หรือ ORDBMS) ซึ่ง ปรับปรุงจากต้นแบบระบบฐานข้อมูล POSTGRES 4.2 ของมหาวิทยาลัย แคลิฟอร์เนีย วิทยาเขตเบอร์กเลย์

  4. Why use PostgreSQL? • เป็น open source • เป็นฐานข้อมูลที่มี data type , function และ opetators แบบ Geometric • สามารถสนับสนุน SQL

  5. Geometric data รูปแบบที่ใช้ในการออกแบบซึ่งจะอยู่ในรูปแบบ ของเรขาคณิตสำหรับการประมวลผลทางคอมพิวเตอร์

  6. Data Types of PostgreSQL • Numeric Types • Monetary Types • Character Types • Binary Types • Date/Time Types

  7. Data Types of PostgreSQL (ต่อ) • Boolean Types • Geometric Types • Network Address Types • Bit Strings Types • Arrays

  8. Geometric data type of PostgreSQL Geometric type แสดงพื้นที่วัตถุในแบบ 2 มิติ โดยที่ point เป็น type พื้นฐานของ type อื่นๆ

  9. Geometric data type of PostgreSQL (ต่อ) • Point • Line Segment • Box • Path • Polygon • Circle

  10. Point Point คือ รูปแบบพื้นฐานแบบ 2 มิติ ของ Geometric types Point สามารถถูกระบุโดย syntax ต่อไปนี้ (x , y) X คือ ค่าตำแหน่งของจุดตามแนวแกน x Y คือ ค่าตำแหน่งของจุดตามแนวแกน y

  11. Line Segment Line segments(lseg) สามารถแสดงได้โดยคู่ลำดับของ Points lseg สามารถถูกระบุโดย syntax ต่อไปนี้ ( (x1 , y1) , (x2 , y2) ) (x1 , y1) , (x2 , y2) x1 , y1 , x2 , y2 (x1 , y1) และ (x2 , y2) คือ ค่าตำแหน่งของจุดปลายทั้งสองข้างของเส้นตรง

  12. Box Boxs สามารถแสดงได้โดยคู่ลำดับของ Points บนมุมที่อยู่ตรงข้ามกันของ box box สามารถถูกระบุโดย syntax ต่อไปนี้ ( (x1 , y1) , (x2 , y2) ) (x1 , y1) , (x2 , y2) x1 , y1 , x2 , y2 (x1 , y1) และ (x2 , y2) คือ ค่าตำแหน่งบนมุมที่อยู่ตรงข้ามกันของ box

  13. Path Path สามารถแสดงได้โดยเซตของ Points ซึ่งเชื่อมต่อกัน path สามารถถูกระบุโดย syntax ต่อไปนี้ ( (x1 , y1) ,…, (xn , yn) ) [ (x1 , y1) ,…, (xn , yn) ] (x1 , y1) ,…, (xn , yn) (x1 , y1 ,…, xn , yn) x1 , y1 ,…, xn , yn

  14. Path (ต่อ) (x1 , y1) ,…, (xn , yn) คือ จุดที่ 1ถึง จุดที่ n “[ ]“ แสดงถึง การเปิด path “( )” แสดงถึง การปิด path

  15. Polygon Polygon สามารถแสดงได้โดยเซตของ Points ซึ่งสามารถเทียบเท่ากับ closed path polygon สามารถถูกระบุโดย syntax ต่อไปนี้ ( (x1 , y1) ,…, (xn , yn) ) (x1 , y1) ,…, (xn , yn) (x1 , y1 ,…, xn , yn) x1 , y1 ,…, xn , yn

  16. Polygon (ต่อ) (x1 , y1) ,…, (xn , yn) คือ จุดที่ 1ถึง จุดที่ n

  17. Circle Circle สามารถแสดงได้โดยจุดศูนย์กลางและรัศมี circle สามารถถูกระบุโดย syntax ต่อไปนี้ < (x , y) , r > ( (x , y) , r (x , y) , r (x , y) คือ จุดศูนย์กลางของวงกลม r คือ รัศมีของวงกลม

  18. Geometric Function of PostgreSQL เซ็ตของฟังก์ชันและ operator สามารถแสดง เป็น operation ทางเรขาคณิตได้มากมายหลากหลาย เช่น Scale , Translation , Rotate และ การหาจุดตัด

  19. Geometric Function of PostgreSQL(ต่อ) Geometric types point, box, lseg, line, path, polygon และ circle มีพื้นฐานที่ใช้สนับสนุนฟังก์ชัน ตัวอย่างเช่น

  20. Geometric Operator of PostgreSQL ตัวอย่างเช่น

  21. Example

  22. Example (ต่อ) CREATE TABLE political_unit ( unitname VARCHAR(30) NOT NULL, unitcode CHAR(2), unitpop DECIMAL(6,2), PRIMARY KEY(unitcode)); CREATE TABLE boundary ( boundid INTEGER, boundpath PATH NOT NULL, unitcode CHAR(2), PRIMARY KEY(boundid), CONSTRAINT fk_boundary_polunit FOREIGN KEY(unitcode) REFERENCES political_unit); CREATE TABLE city ( cityname VARCHAR(30), cityloc POINT NOT NULL, unitcode CHAR(2), PRIMARY KEY(unitcode,cityname), CONSTRAINT fk_city_polunit FOREIGN KEY(unitcode) REFERENCES political_unit);

  23. Example (ต่อ) Data model for political units

  24. Example (ต่อ) INSERT INTO political_unit VALUES ('Republic of Ireland','ie', 4.1); INSERT INTO political_unit VALUES ('Northern Ireland','ni', 50.1); INSERT INTO boundary VALUES (1,'[(9,8),(9,3),(4,1),(2,2),(1,3),(3,5),(3,6),(2,6), (2,9),(5,9),(5,10),(6,11),(7,11),(7,10),(6,9),(7,8), (7,9),(8,9),(8,8),(9,8)]','ie'); INSERT INTO boundary VALUES (2,'[(7,11),(9,11),(10,9),(10,8),(8,8),(8,9),(7,9), (7,8),(6,9),(7,10),(7,11)]','ni'); INSERT INTO city VALUES ('Dublin','(9,6)','ie'); INSERT INTO city VALUES ('Cork','(5,2)','ie'); INSERT INTO city VALUES ('Limerick','(4,4)','ie'); INSERT INTO city VALUES ('Galway','(4,6)','ie'); INSERT INTO city VALUES ('Sligo','(5,8)','ie'); INSERT INTO city VALUES ('Tipperary','(5,3)','ie'); INSERT INTO city VALUES ('Belfast','(9,9)','ni'); INSERT INTO city VALUES ('Londonderry','(7,10)','ni');

  25. Example (ต่อ) • What is the length of the Republic of Ireland’s border? • SELECT SUM(LENGTH((boundpath)))*37.5 • AS "Border (kms)" from political_unit, boundary • WHERE unitname = 'Republic of Ireland' • AND political_unit.unitcode = boundary.unitcode;

  26. Example (ต่อ) • How far, as the crow flies, is it from Sligo to Dublin? • SELECT (orig.cityloc<->dest.cityloc)*37.5 AS "Distance (kms)" • FROM city orig, city dest • WHERE orig.cityname = 'Sligo' • AND dest.cityname = 'Dublin';

  27. สรุป 1. Geometric type สามารถแสดงวัตถุในแบบ 2 มิติได้ 2. PostgreSQL เป็นฐานข้อมูลหนึ่งที่มี Data type , Operator , Function ที่เป็น Geometric Data 3. PostgreSQL เป็นฐานข้อมูลที่เป็น open source

  28. เอกสารอ้างอิง • Open Source DBMS: PostgreSQL ดร.วิสุทธิ์ แซ่ตั้ง,สำนักพิมพ์ ส.ส.ท. พิมพ์ครั้งที่ 1 ธันวาคม 2546 • http://www.postgresql.org • http://www.phpfreaks.com/postgresqlmanual/ page/functions-geometry.html • http://www.phpfreaks.com/postgresqlmanual/page/datatype-geometric.html • http://www3.interscience.wiley.com:8100/legacy/college/watson/0471347116/ppt/ch14.ppt

  29. จบการนำเสนอ