Newer
Older
osmCoverage / src / t_FUEL.sql
@hayashi hayashi on 25 Sep 2017 1 KB Caverage_fuel 完成
---<< postgis: postgres >>---
db_driver=org.postgresql.Driver
db_url=jdbc:postgresql://surveyor.mydns.jp:5432/gisdb
db_user=gisuser
db_passwd=gisuser
-------------------------
DROP TABLE t_FUEL;
CREATE TABLE t_FUEL (
    gid SERIAL PRIMARY KEY,
    idref text,
    fixed integer,
    area integer,
    geom GEOMETRY(POINT, 4612)
);
CREATE INDEX ix_t_FUEL_geom ON t_fuel USING GiST (geom);

insert into t_FUEL (idref,fixed,area,geom) VALUES('n000001',0,0, ST_GeomFromText('POINT(136.9695284611471 35.10300377075564)', 4612));
insert into t_FUEL (idref,fixed,area,geom) VALUES('n000002',0,0, ST_GeomFromText('POINT(136.969047121627 35.102834616747685)', 4612));
insert into t_FUEL (idref,fixed,area,geom) VALUES('n000003',0,0, ST_GeomFromText('POINT(136.9743151095072 35.10462957171922)', 4612));


---<< database: hsqldb >>---
-------------------------

CREATE TABLE FUEL_EXIST (
    idref VARCHAR(12) NOT NULL,
    lat DOUBLE,
    lon DOUBLE,
    score INT,
    PRIMARY KEY(idref)
);
CREATE INDEX FUEL_EXIST_index ON FUEL_EXIST (lat, lon);

----
CREATE TABLE FUEL (
    gid INT,
    idref VARCHAR(12) NOT NULL,
    lat DOUBLE,
    lon DOUBLE,
    fixed INT,
    area INT,
    up INT,
    fixed1 INT
)

// new data
INSERT INTO FUEL (gid,lat,lon,fixed,idref,area,up,fixed1) VALUES(0,?,?,0,?,?,2,0)

// read PostGIS
INSERT INTO FUEL (gid,lat,lon,fixed,idref,area,up,fixed1) VALUES(?,?,?,?,?,?,0,0)

----
CREATE TABLE AREA_NODE (
    idref VARCHAR(12) NOT NULL,
    pid VARCHAR(12),
    lat DOUBLE,
    lon DOUBLE
)

----