Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1774 (in 2.7.0) support of area() function

fixed
Marc Delisle
1
2013-06-11
2005-09-06
Rick
No

Description:
SELECT Area(
boundpath
) *526 AS 'Area (km^2)'
FROM political_unit, boundary
WHERE unitname = 'Northern Ireland'
AND political_unit.unitcode = boundary.unitcode
LIMIT 0 , 30

MySQL said:

#1305 - FUNCTION textbook.Area does not exist

This works with the command line interface and MySQL Query browser.

textbook is the name of the database containing the tables.

How to repeat:
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 POLYGON NOT NULL,
unitcode CHAR(2),
PRIMARY KEY(boundid),
CONSTRAINT fk_boundary_polunit FOREIGN KEY(unitcode)
REFERENCES political_unit(unitname)) TYPE MYISAM;

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(unitname)) TYPE MYISAM;

INSERT INTO political_unit VALUES ('Republic of Ireland','ie', 3.9);
INSERT INTO political_unit VALUES ('Northern Ireland','ni', 1.7);
INSERT INTO boundary VALUES
(1,GeomFromText('polygon((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,GeomFromText('polygon((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',GeomFromText('POINT(9 6)'),'ie');
INSERT INTO city VALUES ('Cork',GeomFromText('POINT(5 2)'),'ie');
INSERT INTO city VALUES ('Limerick',GeomFromText('POINT(4 4)'),'ie');
INSERT INTO city VALUES ('Galway',GeomFromText('POINT(4 6)'),'ie');
INSERT INTO city VALUES ('Sligo',GeomFromText('POINT(5 8)'),'ie');
INSERT INTO city VALUES ('Tipperary',GeomFromText('POINT(5
3)'),'ie');
INSERT INTO city VALUES ('Belfast',GeomFromText('POINT(9 9)'),'ni');
INSERT INTO city VALUES ('Londonderry',GeomFromText('POINT(7
10)'),'ni');

Discussion

  • Marc Delisle
    Marc Delisle
    2005-09-18

    • summary: function not working via phpmyadmin --> support of area() function
     
  • Marc Delisle
    Marc Delisle
    2005-09-18

    Logged In: YES
    user_id=210714

    Need to support also the POLYGON data type in Structure.

     
  • Marc Delisle
    Marc Delisle
    2005-09-20

    • assigned_to: nobody --> lem9
    • summary: support of area() function --> (in 2.6.5) support of area() function
    • priority: 5 --> 1
    • status: open --> open-fixed
     
  • Marc Delisle
    Marc Delisle
    2005-09-20

    Logged In: YES
    user_id=210714

    patch merged, thanks.

     
  • Marc Delisle
    Marc Delisle
    2005-10-02

    • summary: (in 2.6.5) support of area() function --> (in 2.7.0) support of area() function
     
  • Marc Delisle
    Marc Delisle
    2005-12-04

    • status: open-fixed --> closed-fixed
     
  • Michal Čihař
    Michal Čihař
    2013-06-11

    • Status: closed-fixed --> fixed