I am trying to create a find request which is composed of two
calculated fields based on a location latitude/longitude. The aim is
create a filtered request composed of near-by airports based on a
selected airports code.
Firstly I am adding or subtracting 3degrees to the latitude and
longitude so I end up with 4 calculated fields described as
minLat,maxLat,MinLong,maxLong.
This creates a rectangular space around an airport.
Next I create a calculated field to create a range RangeLat
(minLat...maxLat)and RangeLong (minLong...MaxLong).
So now I have two ranges which I need to get into a Find calculation.
Thus when I search I want the range fields to replace the actual Long
and Lat fields of the airport. Have tried cut and paste but I can only
get one of the values in
My ultimate goal will be to then calculate the distance between the
resulatant found set and sort them by distance. That's another days
work
Any ideas
|
|
0
|
|
|
|
Reply
|
d
|
12/13/2003 3:51:37 PM |
|
These Range Fields you create consit of ALL the values between minLat and
MaxLat, say with an increment of 0.25 degrees. I think you need to delimit
all these values with a hardreturn (�). You can then search on each item.
If you then go into search you can enter
one LAT and one LONG separated by a space, three dots and a space
perform the find and this should give you the result you want.
Be carefull though, there is no error checking. You can easily enter two
LONGS without entering a LAT
Hope this is what you needed
--
Keep Well
Ursus
"Des Keany" <d.keany@attbi.com> schreef in bericht
news:bb980f43.0312130751.2df566d7@posting.google.com...
> I am trying to create a find request which is composed of two
> calculated fields based on a location latitude/longitude. The aim is
> create a filtered request composed of near-by airports based on a
> selected airports code.
|
|
0
|
|
|
|
Reply
|
Ursus
|
12/13/2003 7:02:32 PM
|
|
What you are attempting is possible, but not at all easy-- the comparison of
two two-dimensional ranges, each describable by numerical arguments. My own
tendancy is to use realtionships where others might use Finds, but the right
side (what you are searching for) is the same in either case.
That is a multiline key comprised of every lat/long par within the airport
box. How long is that list depends partially on what you use as your
smallest component (in date/time problems, which are one dimensional, not
two, the job is always easier when your smallest increment is a month or
year rather than a second, Filemaker's smallest time value). I am not
familiar with lat/long nomenclature, but I assume each axis is comprised of
a series of values, ranging from very large ('latitude') to small. If there
is a common multiple assigned to each decreasing element, in the way that
there are always 60 seconds in a minute and 60 minutes in an hour, than each
axis' value can be calculated into one numerical value, allowing for
delimited (I'm using a space) value pairs, such as:
1200 3456
1200 3457
1200 3458
1200 3459
1200 3460
1200 3461
1201 3456
1201 3457
1201 3458
1201 3459
1201 3460
1201 3461
1202 3456
1202 3457...
1205 3461
....where the number to the left of the space is one axis (lat?), and the
number to the right is the other, each time incrementing the number on the
right by 6 (3 in either direction), before starting over by incrementing the
number on the left. A change of 1 should represent a change of 1 degree. In
other words, you are essentially creating a grid of 6 degrees by 6 degrees,
or a list of 36 items. Not too hard.
Because your range (on the right-- the box around the airport) is limited
and small, you can simply hard code the list as a calculation returning
text, derived entirely from the two co-ordinates for the airport. If you are
unsure how to build that calc, write back.
Now, if you are starting from a known location, with a usable lat/long pair,
you should be able to search that calc for that value, once you have pushed
that value into a similar calculation that reduces each axis to one number.
So, you might be searching, in the full list above, for '1204 3459'.
A more sophisticated version, using relationships instead of Find, is to
build a SmartRanges key on the left side. That will show you matching
airports in a portal, but two dimensional SmartRanges can get pretty long,
and pretty complicated. For more on SmartRanges:
http://www.onegasoft.com/tools/smartranges/
Once you get the basic search to work, the distances should follow.
--
John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Associate Member, Filemaker Solutions Alliance
"Des Keany" <d.keany@attbi.com> wrote in message
news:bb980f43.0312130751.2df566d7@posting.google.com...
> I am trying to create a find request which is composed of two
> calculated fields based on a location latitude/longitude. The aim is
> create a filtered request composed of near-by airports based on a
> selected airports code.
>
> Firstly I am adding or subtracting 3degrees to the latitude and
> longitude so I end up with 4 calculated fields described as
> minLat,maxLat,MinLong,maxLong.
>
> This creates a rectangular space around an airport.
>
> Next I create a calculated field to create a range RangeLat
> (minLat...maxLat)and RangeLong (minLong...MaxLong).
>
> So now I have two ranges which I need to get into a Find calculation.
>
> Thus when I search I want the range fields to replace the actual Long
> and Lat fields of the airport. Have tried cut and paste but I can only
> get one of the values in
>
> My ultimate goal will be to then calculate the distance between the
> resulatant found set and sort them by distance. That's another days
> work
>
> Any ideas
|
|
0
|
|
|
|
Reply
|
John
|
12/13/2003 7:03:23 PM
|
|
One of the solutions I have built does something similar, but by zip
code and within a user-specified mileage distance from that zip code. I
set it up slightly differently:
I have a calc in my zip code file, which determines the distance between
each record's long/lat and a long & lat that I store in a global field
for the desired zip code, and including the maximum desired distance
which is also stored in a global field. I use this calc for display and
sorting purposes only.
My Find is based on a longitude range and a latitude range that is
calculated on the fly based on the starting zipcode and mileage. This
range could take the three degree differences so that you could perform
the find on the two 'actual' long/lat fields.
This mostly soundslike what you are doing, as well. So the question
might be why you can only get 'one of the values' in. And by 'one of
the values' do you mean one value (not a range) for lat, and one value
for long? Or only a range for lat, but nothing for long?
If it's that you can't get a range to work, what version of FileMaker
are you using and is your script using Insert Calculated result or Set
Field? You answer on this will help us narrow down the problem.
If its the case that it only works for lat and not long (or vice versa),
then maybe you are using the Insert step but one of the fields isn't on
the layout?
The approach of using 'find' may be easier to set up then the
SmartRanges approach that John is suggesting. I'm not against
SmartRanges, and I use it quite a bit for other purposes, but the 'find'
method should work and may be easier to set up.
Let us know...
Des Keany wrote:
> I am trying to create a find request which is composed of two
> calculated fields based on a location latitude/longitude. The aim is
> create a filtered request composed of near-by airports based on a
> selected airports code.
>
> Firstly I am adding or subtracting 3degrees to the latitude and
> longitude so I end up with 4 calculated fields described as
> minLat,maxLat,MinLong,maxLong.
>
> This creates a rectangular space around an airport.
>
> Next I create a calculated field to create a range RangeLat
> (minLat...maxLat)and RangeLong (minLong...MaxLong).
>
> So now I have two ranges which I need to get into a Find calculation.
>
> Thus when I search I want the range fields to replace the actual Long
> and Lat fields of the airport. Have tried cut and paste but I can only
> get one of the values in
>
> My ultimate goal will be to then calculate the distance between the
> resulatant found set and sort them by distance. That's another days
> work
>
> Any ideas
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
12/13/2003 7:53:51 PM
|
|
Howard
What you are doing with the zip code file sounds very similar to what
I am attempting. Being that I am a novice when it comes to calculated
finds, I can insert one of the ranges but not both (with FM6)using an
insert calculated results step. Using your solution do you calculate
the the distance between all zips codes (one from the other) ?
Thanks
Howard Schlossberg <howard@antispahm.fmprosolutions.com> wrote in message news:<vtmrin3gqeku40@corp.supernews.com>...
> One of the solutions I have built does something similar, but by zip
> code and within a user-specified mileage distance from that zip code. I
> set it up slightly differently:
>
> I have a calc in my zip code file, which determines the distance between
> each record's long/lat and a long & lat that I store in a global field
> for the desired zip code, and including the maximum desired distance
> which is also stored in a global field. I use this calc for display and
> sorting purposes only.
>
> My Find is based on a longitude range and a latitude range that is
> calculated on the fly based on the starting zipcode and mileage. This
> range could take the three degree differences so that you could perform
> the find on the two 'actual' long/lat fields.
>
> This mostly soundslike what you are doing, as well. So the question
> might be why you can only get 'one of the values' in. And by 'one of
> the values' do you mean one value (not a range) for lat, and one value
> for long? Or only a range for lat, but nothing for long?
>
> If it's that you can't get a range to work, what version of FileMaker
> are you using and is your script using Insert Calculated result or Set
> Field? You answer on this will help us narrow down the problem.
>
> If its the case that it only works for lat and not long (or vice versa),
> then maybe you are using the Insert step but one of the fields isn't on
> the layout?
>
> The approach of using 'find' may be easier to set up then the
> SmartRanges approach that John is suggesting. I'm not against
> SmartRanges, and I use it quite a bit for other purposes, but the 'find'
> method should work and may be easier to set up.
>
> Let us know...
>
>
> Des Keany wrote:
> > I am trying to create a find request which is composed of two
> > calculated fields based on a location latitude/longitude. The aim is
> > create a filtered request composed of near-by airports based on a
> > selected airports code.
> >
> > Firstly I am adding or subtracting 3degrees to the latitude and
> > longitude so I end up with 4 calculated fields described as
> > minLat,maxLat,MinLong,maxLong.
> >
> > This creates a rectangular space around an airport.
> >
> > Next I create a calculated field to create a range RangeLat
> > (minLat...maxLat)and RangeLong (minLong...MaxLong).
> >
> > So now I have two ranges which I need to get into a Find calculation.
> >
> > Thus when I search I want the range fields to replace the actual Long
> > and Lat fields of the airport. Have tried cut and paste but I can only
> > get one of the values in
> >
> > My ultimate goal will be to then calculate the distance between the
> > resulatant found set and sort them by distance. That's another days
> > work
> >
> > Any ideas
|
|
0
|
|
|
|
Reply
|
d
|
12/15/2003 4:25:44 AM
|
|
I have a similar zipcode database, as well; which uses a find method. My
experience is that no matter what find method is used, ultimately the
search is performed on an un-indexed field and can be slow on an older
computer. A zip database of the US contains 46,000+ records.
As this database is only for personal use and is run on a reasonably
fast machine. There aren�t any problems, but I would be leery about
distributing to other users.
Therefore, I think Johns idea of using SmartRanges, may prove to be more
efficient in the long run. Even though, initially more difficult to set up.
Is my thought process correct on this?
Michael Myett
Howard Schlossberg wrote:
> One of the solutions I have built does something similar, but by zip
> code and within a user-specified mileage distance from that zip code. I
> set it up slightly differently:
>
> I have a calc in my zip code file, which determines the distance between
> each record's long/lat and a long & lat that I store in a global field
> for the desired zip code, and including the maximum desired distance
> which is also stored in a global field. I use this calc for display and
> sorting purposes only.
>
> My Find is based on a longitude range and a latitude range that is
> calculated on the fly based on the starting zipcode and mileage. This
> range could take the three degree differences so that you could perform
> the find on the two 'actual' long/lat fields.
>
> This mostly soundslike what you are doing, as well. So the question
> might be why you can only get 'one of the values' in. And by 'one of
> the values' do you mean one value (not a range) for lat, and one value
> for long? Or only a range for lat, but nothing for long?
>
> If it's that you can't get a range to work, what version of FileMaker
> are you using and is your script using Insert Calculated result or Set
> Field? You answer on this will help us narrow down the problem.
>
> If its the case that it only works for lat and not long (or vice versa),
> then maybe you are using the Insert step but one of the fields isn't on
> the layout?
>
> The approach of using 'find' may be easier to set up then the
> SmartRanges approach that John is suggesting. I'm not against
> SmartRanges, and I use it quite a bit for other purposes, but the 'find'
> method should work and may be easier to set up.
>
> Let us know...
>
>
> Des Keany wrote:
>
>> I am trying to create a find request which is composed of two
>> calculated fields based on a location latitude/longitude. The aim is
>> create a filtered request composed of near-by airports based on a
>> selected airports code.
>>
>> Firstly I am adding or subtracting 3degrees to the latitude and
>> longitude so I end up with 4 calculated fields described as
>> minLat,maxLat,MinLong,maxLong.
>>
>> This creates a rectangular space around an airport.
>>
>> Next I create a calculated field to create a range RangeLat
>> (minLat...maxLat)and RangeLong (minLong...MaxLong).
>>
>> So now I have two ranges which I need to get into a Find calculation.
>>
>> Thus when I search I want the range fields to replace the actual Long
>> and Lat fields of the airport. Have tried cut and paste but I can only
>> get one of the values in
>>
>> My ultimate goal will be to then calculate the distance between the
>> resulatant found set and sort them by distance. That's another days
>> work
>>
>> Any ideas
>
>
|
|
0
|
|
|
|
Reply
|
Michael
|
12/15/2003 5:20:24 AM
|
|
Since my find is conducted on the longitude and latitude stored for each
zipcode, they are all indexed and it is extremely fast. The "unstored"
part are the number ranges that make up my find request. These are
calculated to accommodate whatever mileage range the user is looking for.
Michael Myett wrote:
> I have a similar zipcode database, as well; which uses a find method. My
> experience is that no matter what find method is used, ultimately the
> search is performed on an un-indexed field and can be slow on an older
> computer. A zip database of the US contains 46,000+ records.
>
> As this database is only for personal use and is run on a reasonably
> fast machine. There aren�t any problems, but I would be leery about
> distributing to other users.
>
> Therefore, I think Johns idea of using SmartRanges, may prove to be more
> efficient in the long run. Even though, initially more difficult to set up.
>
> Is my thought process correct on this?
>
> Michael Myett
>
>
> Howard Schlossberg wrote:
>
>> One of the solutions I have built does something similar, but by zip
>> code and within a user-specified mileage distance from that zip code.
>> I set it up slightly differently:
>>
>> I have a calc in my zip code file, which determines the distance
>> between each record's long/lat and a long & lat that I store in a
>> global field for the desired zip code, and including the maximum
>> desired distance which is also stored in a global field. I use this
>> calc for display and sorting purposes only.
>>
>> My Find is based on a longitude range and a latitude range that is
>> calculated on the fly based on the starting zipcode and mileage. This
>> range could take the three degree differences so that you could
>> perform the find on the two 'actual' long/lat fields.
>>
>> This mostly soundslike what you are doing, as well. So the question
>> might be why you can only get 'one of the values' in. And by 'one of
>> the values' do you mean one value (not a range) for lat, and one value
>> for long? Or only a range for lat, but nothing for long?
>>
>> If it's that you can't get a range to work, what version of FileMaker
>> are you using and is your script using Insert Calculated result or Set
>> Field? You answer on this will help us narrow down the problem.
>>
>> If its the case that it only works for lat and not long (or vice
>> versa), then maybe you are using the Insert step but one of the fields
>> isn't on the layout?
>>
>> The approach of using 'find' may be easier to set up then the
>> SmartRanges approach that John is suggesting. I'm not against
>> SmartRanges, and I use it quite a bit for other purposes, but the
>> 'find' method should work and may be easier to set up.
>>
>> Let us know...
>>
>>
>> Des Keany wrote:
>>
>>> I am trying to create a find request which is composed of two
>>> calculated fields based on a location latitude/longitude. The aim is
>>> create a filtered request composed of near-by airports based on a
>>> selected airports code.
>>>
>>> Firstly I am adding or subtracting 3degrees to the latitude and
>>> longitude so I end up with 4 calculated fields described as
>>> minLat,maxLat,MinLong,maxLong.
>>>
>>> This creates a rectangular space around an airport.
>>>
>>> Next I create a calculated field to create a range RangeLat
>>> (minLat...maxLat)and RangeLong (minLong...MaxLong).
>>>
>>> So now I have two ranges which I need to get into a Find calculation.
>>>
>>> Thus when I search I want the range fields to replace the actual Long
>>> and Lat fields of the airport. Have tried cut and paste but I can only
>>> get one of the values in
>>>
>>> My ultimate goal will be to then calculate the distance between the
>>> resulatant found set and sort them by distance. That's another days
>>> work
>>>
>>> Any ideas
>>
>>
>>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
12/15/2003 5:24:15 PM
|
|
John
Thank you for your posting. I have tried to understand better both how
and why the dynamic ranges would work - particularily in this
solution. Would I end up with predefined areas and would then locate
coordinates that fall within these ranges ? It would be quite simple
to round these values but given that there are 360 in both the
vertical (latitude) and 360 in the longitude (longitude) defined as
1-180 east or 1-180 west of the Greenwich Meridian there would be a
lot of ranges to define.
"John Weinshel" <john@datagrace.biz> wrote in message news:<vtmoinpv51hd49@news.supernews.com>...
> What you are attempting is possible, but not at all easy-- the comparison of
> two two-dimensional ranges, each describable by numerical arguments. My own
> tendancy is to use realtionships where others might use Finds, but the right
> side (what you are searching for) is the same in either case.
>
> That is a multiline key comprised of every lat/long par within the airport
> box. How long is that list depends partially on what you use as your
> smallest component (in date/time problems, which are one dimensional, not
> two, the job is always easier when your smallest increment is a month or
> year rather than a second, Filemaker's smallest time value). I am not
> familiar with lat/long nomenclature, but I assume each axis is comprised of
> a series of values, ranging from very large ('latitude') to small. If there
> is a common multiple assigned to each decreasing element, in the way that
> there are always 60 seconds in a minute and 60 minutes in an hour, than each
> axis' value can be calculated into one numerical value, allowing for
> delimited (I'm using a space) value pairs, such as:
>
> 1200 3456
> 1200 3457
> 1200 3458
> 1200 3459
> 1200 3460
> 1200 3461
> 1201 3456
> 1201 3457
> 1201 3458
> 1201 3459
> 1201 3460
> 1201 3461
> 1202 3456
> 1202 3457...
>
> 1205 3461
>
> ...where the number to the left of the space is one axis (lat?), and the
> number to the right is the other, each time incrementing the number on the
> right by 6 (3 in either direction), before starting over by incrementing the
> number on the left. A change of 1 should represent a change of 1 degree. In
> other words, you are essentially creating a grid of 6 degrees by 6 degrees,
> or a list of 36 items. Not too hard.
>
> Because your range (on the right-- the box around the airport) is limited
> and small, you can simply hard code the list as a calculation returning
> text, derived entirely from the two co-ordinates for the airport. If you are
> unsure how to build that calc, write back.
>
> Now, if you are starting from a known location, with a usable lat/long pair,
> you should be able to search that calc for that value, once you have pushed
> that value into a similar calculation that reduces each axis to one number.
> So, you might be searching, in the full list above, for '1204 3459'.
>
> A more sophisticated version, using relationships instead of Find, is to
> build a SmartRanges key on the left side. That will show you matching
> airports in a portal, but two dimensional SmartRanges can get pretty long,
> and pretty complicated. For more on SmartRanges:
>
> http://www.onegasoft.com/tools/smartranges/
>
> Once you get the basic search to work, the distances should follow.
>
> --
> John Weinshel
> Datagrace
> Vashon Island, WA
> (206) 463-1634
> Associate Member, Filemaker Solutions Alliance
>
>
> "Des Keany" <d.keany@attbi.com> wrote in message
> news:bb980f43.0312130751.2df566d7@posting.google.com...
> > I am trying to create a find request which is composed of two
> > calculated fields based on a location latitude/longitude. The aim is
> > create a filtered request composed of near-by airports based on a
> > selected airports code.
> >
> > Firstly I am adding or subtracting 3degrees to the latitude and
> > longitude so I end up with 4 calculated fields described as
> > minLat,maxLat,MinLong,maxLong.
> >
> > This creates a rectangular space around an airport.
> >
> > Next I create a calculated field to create a range RangeLat
> > (minLat...maxLat)and RangeLong (minLong...MaxLong).
> >
> > So now I have two ranges which I need to get into a Find calculation.
> >
> > Thus when I search I want the range fields to replace the actual Long
> > and Lat fields of the airport. Have tried cut and paste but I can only
> > get one of the values in
> >
> > My ultimate goal will be to then calculate the distance between the
> > resulatant found set and sort them by distance. That's another days
> > work
> >
> > Any ideas
|
|
0
|
|
|
|
Reply
|
d
|
12/17/2003 5:09:30 AM
|
|
|
7 Replies
390 Views
(page loaded in 0.153 seconds)
|