Datatype To Store Longitude/Latitude in Mysql: Únete A La Comunidad de Stack Overflow
Datatype To Store Longitude/Latitude in Mysql: Únete A La Comunidad de Stack Overflow
Datatype To Store Longitude/Latitude in Mysql: Únete A La Comunidad de Stack Overflow
xDismiss
netealacomunidaddeStackOverflow
Registrarse
DatatypetoStoreLongitude/LatitudeinMysql
'43.005895','71.013202'
Tryingtouse:
INSERTINTOtable(fanDetLocZip,fanDetLocCity,fanDetLocState,fanDetLocLat,
fanDetLocLong,fanDetLocTZ,fanDetLocDST)
VALUES(00210,'Portsmouth','NH','43.005895','71.013202',5,1);
Itsgivingmeerrorslike:
CannotgetgeometryobjectfromdatayousendtotheGEOMETRYfield
Allthevalueshave2digits,and6decimalplacesafterdecimal.HowdoIstorethisinmysql?
ErrorIgetwhenIuse:
INSERTINTOTable(fanDetLocZip,fanDetLocCity,fanDetLocState,fanDetLocLatLong,fanDetLocTZ,
fanDetLocDST)
VALUES(00210,'Portsmouth','NH',point(43.005895,71.013202),5,1)
ErrorImage:
editedFeb10'14at6:04 askedMar5'12at0:11
S1LENTWARRIOR CodeTalk
3,613 3 24 41 1,534 6 27 61
Pleasepostthecreateordescribetable?Itdoesn'tmakesensetogiveadvicewithoutit. MichaelDurrant
Mar5'12at0:33
2Answers
http://stackoverflow.com/questions/9560147/datatypetostorelongitudelatitudeinmysql 1/2
20/3/2017 floatingpointDatatypetoStoreLongitude/LatitudeinMysqlStackOverflow
Noencuentraslarespuesta?PreguntaenStackOverflowenespaol.
POINT(43.005895,71.013202)
INSERTINTOtable
(...,geom,...)
VALUES
(...,POINT(43.005895,71.013202),...)
SELECTX(geom)ASx,Y(geom)ASy
FROMtable
editedDec13'12at12:05 answeredMar5'12at0:24
AhmedelGendy ypercube
188 4 13 81.2k 9 100 170
Thisishelpful,IamguessingIjustdidntaddpoint().Neverhaveusedgeometryvaluesbefore.Thanks
ypercube! CodeTalk Mar5'12at0:34
WhenIuse:INSERTINTOTable(fanDetLocZip,
fanDetLocCity,fanDetLocState,fanDetLocLatLong,fanDetLocTZ,fanDetLocDST)
VALUES(00210,'Portsmouth','NH',point(43.005895,71.013202),5,1)itinputsthevalueweird.See
screenshotabove. CodeTalk Mar5'12at0:38
Weird,well,thatatleastworks.Maybeitsabrowserbugorsomething.ThanksYPerCube! CodeTalk
Mar5'12at0:57
3 Shouldn'tbethePOINTbePOINT(43.00589571.013202)asdescribedhere?
dev.mysql.com/doc/refman/5.0/en/giswktformat.htmlnolazybits Oct12'12at10:06
WhydontyouuseinsteadaFloattypeforyourlat/long?
Float(10,6)
answeredMar5'12at0:30
KevinFauver
186 1 5 14
3 floatisnotgoodtostorelattitudeandlongtitude.Doubleisthebestdatatypetostorelattitude/longtitude.
ReadCompleteDiscussionArunRajFeb27'14at9:28
http://stackoverflow.com/questions/9560147/datatypetostorelongitudelatitudeinmysql 2/2