Slide 8
Slide 8 text
PODEJŚCIE KLASYCZNE
CREATE TABLE `geospatial`.`example` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`lat` DECIMAL(10,8) NOT NULL,
`lng` DECIMAL(11,8) NOT NULL,
PRIMARY KEY (`id`));
“good old days”
CREATE TABLE `geospatial`.`example` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`point` POINT() NOT NULL,
PRIMARY KEY (`id`),
SPATIAL INDEX `geoindex` (`point` ASC));
OpenGIS
PUT example
{
"mappings": {
"my_type": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
Geo-point datatype