# How to define geographic boundaries and restrict the app usage like in Uber

I’m building a mobile app which is a ride-sharing app like Uber.

• Now when uber comes to a country, it’s not available to the whole country at once. It opens its doors only to a specific region.
• Even when operating in multiple regions, they can set different rates per region.

Now I want to implement this feature in my app. Basically, what I need is,

• To identify the driver is in a specific geographic region set by the system and customize his experience.

Our backend is written in NodeJS and the app is in native Android (Java)and iOS (Swift). So, how can I implement this feature?

You’ll need access to the device’s Location information, for starters, and then you’d use an algorithm to determine if point X,Y is within the shape constructed by coordinates (A,B)(C,D)(E,F)… This is most easily done with a Ray To Null Island.

(And because “What is a Ray to Null Island” is the inevitable response to that post…)

Consider a polygon, existing on a two dimensional plane, such that the polygon does not contain the point (0,0) inside it.

For any point, (X,Y), on that plane, you can draw a straight line (a ray) between (X,Y), and (0,0), such that:
If the line crosses the boundaries of the polygon an even number of times, the point must be outside of the polygon.
Conversely, if the line crosses the boundaries of the polygon an odd number of times, the point must be inside of the polygon.

Also: Null Island is the informal name given to the earth-coordinates 0,0 (the point at which the Prime Meridian and the Equator meet), which is a patch of ocean off the coast of Africa. There’s not actually an island there, but there is a weather buoy. Because someone thought it would be a good reference point. They were right.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.