# geoWithinRadius not working as expected

**URL:** <https://discuss.aerospike.com/t/geowithinradius-not-working-as-expected/3817>\
**Category:** Geospatial\
**Tags:** query, secondary, geoindex\
**Created:** [January 31, 2017, 12:12pm UTC](https://discuss.aerospike.com/t/geowithinradius-not-working-as-expected/3817 "2017-01-31T12:12:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rv11](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rv11](https://discuss.aerospike.com/u/rv11)\
**Post date:** [January 31, 2017, 12:12pm UTC](https://discuss.aerospike.com/t/geowithinradius-not-working-as-expected/3817/1 "2017-01-31T12:12:59Z")

</div>

So here is how my SET looks like

GeoJSON(‘{“type”:“Point”,“coordinates”:[46,130.5]}’) | “0.7” | “27” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[46.6,131.1]}’) | “0.7” | “20” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47.4,131.9]}’) | “0.7” | “24” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[45.4,129.9]}’) | “0.7” | “29” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47,131.5]}’) | “0.7” | “25” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47.2,131.7]}’) | “0.7” | “21” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[45.2,129.7]}’) | “0.7” | “22” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[44.6,129.1]}’) | “0.7” | “23” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[46.7,131.2]}’) | “0.7” | “28” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[44.9,129.4]}’) | “0.7” | “26” |

now even if I do

SELECT \* from mynamespace.location WHERE geo WITHIN CAST(‘{“type”: “AeroCircle”, “coordinates”: [[47.2, 131.7] , 500] }’ AS GEOJSON)

i get

GeoJSON(‘{“type”:“Point”,“coordinates”:[46,130.5]}’) | “0.7” | “27” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[46.6,131.1]}’) | “0.7” | “20” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47.4,131.9]}’) | “0.7” | “24” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[45.4,129.9]}’) | “0.7” | “29” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47,131.5]}’) | “0.7” | “25” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[47.2,131.7]}’) | “0.7” | “21” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[45.2,129.7]}’) | “0.7” | “22” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[44.6,129.1]}’) | “0.7” | “23” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[46.7,131.2]}’) | “0.7” | “28” | | GeoJSON(‘{“type”:“Point”,“coordinates”:[44.9,129.4]}’) | “0.7” | “26”

as result!! . can some one help me getting correct results. ( it doesnt look like [47.2, 131.7] and [44.9,129.4] would be 500meters apart!!)
