i make app read file based on location (latitude and longitude )
but when i used if condition to compare location only first file appear
this the code of compassion the latitude and longitude of Egypt cities.
But when I used it in another city, the first file only appear to me
The latitude and longitude are correct, but the first file is read
From what I understood, the solution is to replace all the or
blocks with and
blocks.
Let me know if that works...
it didn't work
Here are two ways to determine if a location is within your boundaries:
-
use a ring fence. An example is described here in figure 18-2 Programming Your App to Make Decisions
-
use the Map component and a Polygon defining the boundaries. This example uses your Upper Egypt area and uses these coordinates for the Polygon
[[23.08554,31.7651],[26.501348,31.76513], [26.501348,32.8084],[23.08554, 32.80845]]
The example checks whether coordinates of 24.1,31.9 are a location within the Upper Egypt Polygon and decides that yes, the location is within.
A complete discussion of the technique is Determining if a user's location is within the boundaries of a FeatureCollection Polygon
What you do using your Blocks depends on what you have in you UpperEgypt.csv file. Your code, will probably will work if you fix it. I suggest you create a simple example using static data. Get the example to work like you want, then create your more complicated code. @Kaustubh_Rakhade 's suggestion is a good one and it might not work in your app because of issues with regard to your how you request your csv file and how you how a list of cities in that file. Look at what your File.Got text is returning.
You might be interested in these discussions involving locating pharmacies in Morocco A propos google sheet and Retrieve location specific Phone Numbers (or other data) from an appropriate Google Spreadsheet . They discuss similar medical topics .
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.