-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
have Bug lat , lng in save #107
Comments
State your expected behaviour and actually behaviour. Ranting ain't going to make it easier for others to help or understand you |
when store flip in database all query about GIS not work
after store with eloquent in database
i need work point(1,2) traditional
i must flip point (very bad) also fliped area
i create pull request about this |
https://stackoverflow.com/questions/18636564/lat-long-or-long-lat
x usually refer to longitude, and y refer to latitude. |
To be honest, only this package uses https://geojson.org/ format also focus on |
when we work with google map it show this type usaual (x,y) also in mysql function such as point(1,2) 1 = x , 2 = y and other like MBRContains search point with this format in polygon [(1,2),(2,3),(1,2)] first item [0] is x i tested your store type in database and getLat() after save in databse in show geom point type === >> point(2 1) why in your document you say ?? |
no Y = longitude= length & |
https://blog.batchgeo.com/latitude-longitude-map/ But whatever, you seem to be an expert at this and the internet is wrong. |
see another problem |
Have you read about GeoJSON spec? https://macwright.org/2015/03/23/geojson-second-bite.html#position But again, you are the expect. |
When Google Map use GeoJSON, they also comply with the spec |
Mr . we must To obey MY SQL Function format . when this package flip x,y in database ST_Contains noooooooot work coreclty |
I'm using MySQL is storing the point as
https://itnext.io/playing-with-geometry-spatial-data-type-in-mysql-645b83880331 MySQL function comply with |
From #30 (comment):
Same order as Google Maps's Point @vahidalvandi Since, you've found your bug, it should be a simple matter of reordering the coordinates somewhere in your code. |
we use this package for map like leaflet or google map this maps work with (x,y) =>> (lat,lng) |
@grimzy I think the main confusion here (for me at least). Is that when I have a Apart from that I do find it confusing on the // line 95
public function jsonSerialize()
{
return new GeoJsonPoint([$this->getLng(), $this->getLat()]); <-- typo or flipped?
} but the constructor has them: public function __construct($lat, $lng, $srid = 0)
{
parent::__construct($srid);
$this->lat = (float) $lat;
$this->lng = (float) $lng;
} I understand the different formats in the DB etc.. but the json serialize looks off? EDIT: I fixed it by public function getLocationAttribute()
{
return [
'lat' => $this->location_position->getLat(),
'long' => $this->location_position->getLng()
];
} I am worried now tho that the further i use this all the mysql functions will be wrong going forward |
why lan , lng flip in database ? after 3 house research about why geom function not work in sql i found lat , lng is fliped !!!!!!!!!!!!!!!!!!!!1
this create more probleam in use dunction
like
#28
The text was updated successfully, but these errors were encountered: