I need to store coordinates in Azure and had intended on using table storage. My idea was to be able to query for a subset of coordinates based on two coordinates e.g:
So my query (I think) would be, give me all the points where
- The latitude is less than 53.360238 and greater than 53.344204
- The Longitude is greater than -6.276734 and less than -6.250122
I had originally thought about saving them as:
ParititonKey, RowKey
"16.775833,-3.009444", "Timbuktu"
...
But realised I would end up with thousands of partitions. I assumed that this would be really bad for doing a query as I would have to touch many partitions possibly on different networks.
Also I'm not sure how it would work given a partition / row query is a string comparison..
I was wondering if there was a better way to store the points, for example I was thinking something like:
ParititonKey, RowKey, Title
16.775833,-3.009444, "Timbuktu"
...
This makes the query easier but doesn't solve the unique partition problem e.g
Get all entites where partition key is less than X and greater than Y AND where RowKey is greater than A and smaller than B
Is there a more efficient way to do this, perhaps by saving the whole number of the latitude as the partition key and the remainder in the RowKey?
ParititonKey, RowKey, Title
16, 775833^-3.009444, "Timbuktu"
...
Any advice is appreciated!