[Manifold-l] Distance calculations
Lorne
lketch at hfx.eastlink.ca
Wed Sep 20 07:01:24 CDT 2006
Hi Simon
When I first ran Adam's script under the Debugger, the value for Dstudio
being calculated; however, the column was not updating. I discovered that I
had set the function type to Int32. Resetting it to a floating point number
solved the problem. Right click on the Dstudio column name and select Edit.
Check the return type.
Lorne
-----Original Message-----
From: manifold-l-bounces at lists.directionsmag.com
[mailto:manifold-l-bounces at lists.directionsmag.com] On Behalf Of Simon
Linder
Sent: September 19, 2006 8:37 PM
To: adamw at manifold.net; manifold-l at lists.directionsmag.com
Subject: RE: [Manifold-l] Distance calculations
Adam,
Thanks for your help. I tried your suggestion and all I got was 0. I
changed the ",.001)" to Geom (I) so the second point would be taken from the
record but I still just get 0.
I then tried to do this with a select query:
SELECT
Distance(Geom ([ID]),NewPointLatLon(-77.0770,38.9657)) FROM [Usps 2 Table]
This works. I get distance in degrees however when I modify the query to
what is below to get the distance in miles:
SELECT
Distance(Geom ([ID]),NewPointLatLon(-77.0770,38.9657),"mi") FROM [Usps 2
Table]
I then get nothing in the resulting column. I know this is probably my
fault but any guidance would be helpful
Simon Linder
Wider Networks
slinder at widernetworks.com
(w) 301.951.2767
(m) 301.768.9170
-----Original Message-----
From: manifold-l-bounces at lists.directionsmag.com
[mailto:manifold-l-bounces at lists.directionsmag.com] On Behalf Of
adamw at manifold.net
Sent: Tuesday, September 19, 2006 8:52 AM
To: manifold-l at lists.directionsmag.com
Subject: RE: [Manifold-l] Distance calculations
> I am getting a type Mismatch error on NewPointLatLon when I set up the
> following function in an ActiveColumn:
>
> Function DStudio
> DStudio = distance([Geom
> (I)],NewPointLatLon(-77.0770,38.9657),"mi")
> End Function
You are using query functions in a script.
Try this:
Function DStudio
Set p = Application.NewGeomFromTextWKT("POINT(-77.0770 38.9657)")
DStudio = Record.Object.Geom.Distance(p, 0.001) / 1609 ' in miles End
Function
--
Adam Wachowski
Manifold Development Team
_______________________________________________
Manifold-l mailing list
Manifold-l at lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/manifold-l
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/451 - Release Date: 9/19/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/451 - Release Date: 9/19/2006
_______________________________________________
Manifold-l mailing list
Manifold-l at lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/manifold-l
More information about the Manifold-l
mailing list