Proceed to GeoCommunity Home Page


SpatialNewsGIS Data DepotGeoImaging ChannelGIS and MappingSoftwareGIS JobsGeoBids-RFPsGeoCommunity MarketplaceGIS Event Listings
HomeLoginAccountsAboutContactAdvertiseSearchFAQsForumsCartFree Newsletter

Sponsored by:


TOPICS
Today's News

Submit News

Feature Articles

Product Reviews

Education

News Affiliates

Discussions

Newsletters

Email Lists

Polls

Editor's Corner


SpatialNews Daily Newswire!
Subscribe now!

Latest Industry Headlines
SiteVision GIS Partnership With City of Roanoke VA Goes Live
Garmin® Introduces Delta™ Upland Remote Trainer with Beeper
Caliper Offers Updated Chile Data for Use with Maptitude 2013
Southampton’s Go! Rhinos Trail Mapped by Ordnance Survey
New Approach to Measuring Coral Growth Offers Valuable Tool for Reef Managers
Topo ly - Tailor-Fit for Companies' Online Mapping Needs

Latest GeoBids-RFPs
Nautical Charts*Poland
Software & Telemetry GPS
Spatial Data Management-DC
Geospatial and Mapping-DC
Next-Gen 911-MO

Recent Job Opportunities
Planner/GIS Specialist
Team Leader- Grape Supply Systems
Geospatial Developer

Recent Discussions
Raster images
cartographic symbology
Telephone Exchange areas in Europe
Problem showcasing Vector map on Windows CE device
Base map

GeoCommunity Mailing List
 
Mailing List Archives

Subject: GISList: AVE - Creating x-y co-ordinates from UK six figure grid ref
Date:  11/12/2002 07:45:55 AM
From:  Ewan Purser



I am trying to get the script below to create x y coordinates from a field
with UK national six figure grid refrence's e.g. NH935163 to 293500 816300
so I can use the add event theme to plot the points, but it isn't putting
them in the right place- any idea where I'm going wrong? Or does anyone just
have a script that works?

'Script to split national grid references into their x and y coordinates
'***********************************************************************

thetable = av.FindDoc("kinveachy estate crow kills march-june 02.dbf")

theVtab = thetable.GetVtab
xcoord = theVtab.FindField("xcoord")
ycoord = theVtab.FindField("ycoord")
gridref = theVtab.FindField("Gridref")

rec = 1

for each rec in theVtab
gridref1 = theVtab.ReturnValue (gridref, rec)

csqr = gridref1.Left(2)
sqlist =
{"na","nb","nc","nd","nf","ng","nh","nj","nk","nl","nm","nn","no","nr","ns",
"nt","nu","nw","nx","ny","nz"}
xlist = {0,1,2,3,0,1,2,3,4,0,1,2,3,1,2,3,4,1,2,3,4}
ylist = {9,9,9,9,8,8,8,8,8,7,7,7,7,6,6,6,6,5,5,5,5}
sqri = sqlist.FindByValue(csqr)
x = (xlist.Get(sqri)*100000)
y = (ylist.Get(sqri)*100000)

valuex = gridref1.Left(6)



valuex = valuex.Right(3)
valuex = valuex.AsNumber

valuey = gridref1.Right(3)
valuey = valuey.AsNumber

valx = (valuex*100)+x
valy = (valuey*100)+y

theVtab.SetValue (ycoord, rec, valy)
theVtab.SetValue (xcoord, rec, valx)

rec = rec + 1

end



To unsubscribe, write to gislist-unsubscribe@geocomm.com
________________________________________________________________________
GeoCommunity GeoBids - less than $1 per day!
Get Access to the latest GIS & Geospatial Industry RFPs and bids
http://www.geobids.com

Setup a GeoCommunity Account and have access to
the GISDataDepot DRG & DOQQ Catalog
http://www.geocomm.com/login.php


Sponsored by:

For information
regarding
advertising rates
Click Here!

Copyright© 1995-2012 MindSites Group / Privacy Policy

GeoCommunity™, Wireless Developer Network™, GIS Data Depot®, and Spatial News™
including all logos and other service marks
are registered trademarks and trade communities of
MindSites Group