Yes, you just need write the code for it. You know all the coords from the tab, so you
need a algorithme for checking if a coord is within a rectangle. This is easy if your
object are points, but if its line and regions you need to think :)
What if your object is only partly within and so on...
Here are some basic code showing if a point is with a polygon:
Public Function pipo(ByRef pnt As clsGeoPoint, ByVal snapOk As Boolean) As Boolean
Dim pkt As clsGeoPoint
Dim nextPkt As clsGeoPoint
Dim index As Integer
Dim xhelp As Double, yhelp As Double, yl As Double
Dim diff1 As Double, diff2 As Double, x1 As Double, x2 As Double, y1 As Double
Dim y2 As Double, xmin As Double, xmax As Double, ymin As Double, ymax As Double
Dim a As Integer '* number of cuts
Dim ii As Integer
Const EPSI = 0.005
Const SAMMENFALD = 0.001
pipo = False
If Me.range.IsInside(pnt) = False Then GoTo ended
'* start xhelp, yhelp og antal krydsninger
xhelp = pnt.geoX
yhelp = pnt.geoY
a = 0
'* tjek for punktsammenfald.
For Each pkt In g_pointChain
If pkt.isTheSame(pnt, SAMMENFALD) And snapOk = True Then
pipo = True '* Punkt sammenfald betragtes som indefor
GoTo ended
End If
Next
For index = 1 To GetCount() - 1
Set pkt = Point(index)
Set nextPkt = Point(index + 1)
xhelp = pnt.geoX
x1 = pkt.geoX
x2 = nextPkt.geoX
xmin = getMin(x1, x2)
xmax = getMax(x1, x2)
If Abs(xhelp - x1) < EPSI Or _
Abs(xhelp - x2) < EPSI Then
xhelp = xhelp + 0.01
End If
If xhelp > xmin And xhelp < xmax Then '* indenfor x-range
y1 = pkt.geoY
y2 = nextPkt.geoY
ymin = getMin(y1, y2)
ymax = getMax(y1, y2)
If (yhelp < ymin) Then '* m� sk�re
a = a + 1
Else
If yhelp < ymax Then
yl = y1 + (xhelp - x1) * (y2 - y1) / (x2 - x1)
If yhelp < yl Then a = a + 1
End If
End If
End If
Next
If (a Mod 2) <> 0 Then pipo = True
ended:
End Function
Mvh. | Regards
Jakob Lanstorp
Senior Consultant
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S
Tel +45 63 11 49 00
Direct +45 63 11 48 62
Fax +45 63 11 49 49
Email [EMAIL PROTECTED]
http://www.cowi.dk
-----Original Message-----
From: digeteca [mailto:[EMAIL PROTECTED]
Sent: Friday, October 08, 2004 10:46 AM
To: [EMAIL PROTECTED]
Subject: RE: MI-L: Extracting Mapinfo Tab File Data with Delphi
In fact i want to extract data on mapinfo table with mitab lib using a
spatial filter like a rectangle ?
Is it possible ?
Thanks,
At 10:19 08/10/2004, you wrote:
> >can we perform select operation on mapinfo tab file
> >using mitab library with delphi ?
>
>Depending on what you mean by selecting. When you read the tab record
>by record you can add it to a ADO dataset or what ever and do your
>selecting, if your selecting is SQL. If your selecting is on the GIS
>object you will have to write your own GIS algorithms.
>
>Generally what MITAB does is (1) writing a complete MI table, no update
>possible and (2) read a MI table. You can catch every information from
>the tab file(alphanumeric data and GIS objects coords).
>
>Mvh. | Regards
>
>Jakob Lanstorp
>Senior Consultant
>Geographical Information & IT
>
>COWI A/S
>Odensevej 95
>DK-5260 Odense S
>
>Tel +45 63 11 49 00
>Direct +45 63 11 48 62
>Fax +45 63 11 49 49
>Email [EMAIL PROTECTED]
>http://www.cowi.dk
>
>
>-----Original Message-----
>From: digeteca [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 08, 2004 10:08 AM
>To: [EMAIL PROTECTED]
>Subject: RE: MI-L: Extracting Mapinfo Tab File Data with Delphi
>
>
>Well, thanks a lot,
>
>Just another question : can we perform select operation on mapinfo tab
>file using mitab library with delphi ?
>
>
>At 09:05 08/10/2004, you wrote:
> > >>Someone can give me a sample code to extract data from mapinfo tab
> >file >>using delphi and mitab library
> >Sure, take a look at these three files pasted here:
> >(1) A Pascal class (MITabReadClass) encapsulating the mitab api
> >(2) A Pascal api for the mitab.dll (not written by me)
> >(3) A Pascal testing methode (ProcessTAB) showing the use of the
> >MITabReadClass.
> >
> ><[EMAIL PROTECTED]>:
> >ezmlm-reject: fatal: Sorry, I don't accept messages larger than 30000
> >bytes (#5.2.3)
> >
> >If any of you want the three files you can mail me directly. This
> >mailing list dies at 30000 bytes.
> >
> >Mvh. | Regards
> >
> >Jakob Lanstorp
> >Senior Consultant
> >Geographical Information & IT
> >
> >COWI A/S
> >Odensevej 95
> >DK-5260 Odense S
> >
> >Tel +45 63 11 49 00
> >Direct +45 63 11 48 62
> >Fax +45 63 11 49 49
> >Email [EMAIL PROTECTED]
> >http://www.cowi.dk
>
>Stephane
>
>
>
>---------------------------------------------------------------------
>List hosting provided by Directions Magazine | www.directionsmag.com |
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>Message number: 13651
>
>
>
>---------------------------------------------------------------------
>List hosting provided by Directions Magazine | www.directionsmag.com |
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>Message number: 13652
Stephane SAINT-MARC
Digeteca
Parc Heliopolis
Batiment B3
33700 Merignac
[EMAIL PROTECTED]
Tel : 0556344550
Fax: 0556344575
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13654
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13655