I think it is something complicate, but I hope someone could bring up any idea about.
I'm using ArcGIS10, and I have a "One-way roads" shapefile with a One-way field with Y/N. But I need to create a new Field for this layer containing F or T if:
- F : The final point of the line is Northern and Western than the origin of the line.
- T : The final point of the line is Southern and Eastern than the origin of the line.
An example,
Another Example:
Thanks for your time,
Answer
I apologize that I can't answer how to do it with arcgis but I made a successful test with Spatialite-gui. I created first a new Spatialite database and imported some road data from a shapefile. Then I executed these three SQL commands:
alter table roads add column from_or_to;
update roads set from_or_to='F'
where MbrMaxY(EndPoint(geometry)) > MbrMaxY(StartPoint(geometry));
update roads set from_or_to='T'
where MbrMaxY(EndPoint(geometry)) < MbrMaxY(StartPoint(geometry));
Finally I exported the table with a new and populated "from_or_to column" into a new shapefile.
No comments:
Post a Comment