Lap trinh va ung dung Chaper I

download Lap trinh va ung dung Chaper I

of 26

Transcript of Lap trinh va ung dung Chaper I

  • 8/8/2019 Lap trinh va ung dung Chaper I

    1/26

    Chapper I: Graph & Interpolar

    Programming & Application

  • 8/8/2019 Lap trinh va ung dung Chaper I

    2/26

    Part I: Graph

    Wind & Flow Rose

    Field vector

    Historgram Other plot

  • 8/8/2019 Lap trinh va ung dung Chaper I

    3/26

    Wind & Flow Rose

    O

    Vector

    North (y)

    East (x)

    ( , )

    Math angle:

    arctan 2[ , ]Flow angle:

    arctan 2[ , ]

    Wind angle:

    arctan 2[ , ]

    v v u v

    u v

    v u

    v u

  • 8/8/2019 Lap trinh va ung dung Chaper I

    4/26

    Wind & Flow Rose

    YR-MO-DA HH-MM-SSEas Nor Mag Dir

    mm/s deg mm/s deg

    20/04/2010 18:30:00 -144 214

    20/04/2010 18:45:00 -35 123

    20/04/2010 19:00:00 -5 10

  • 8/8/2019 Lap trinh va ung dung Chaper I

    5/26

    Field Vector

    Name X Y Deg Speed

    Centennial -104.8 39.6 157.5 28

    Cortez -108.7 37.3 202.5 20

    Durango -107.8 37.3 202.5 26

    Springfield -102.6 37.4 202.5 35

  • 8/8/2019 Lap trinh va ung dung Chaper I

    6/26

    How to ???

  • 8/8/2019 Lap trinh va ung dung Chaper I

    7/26

    Histogram

  • 8/8/2019 Lap trinh va ung dung Chaper I

    8/26

    Part II: Spatial Analysis

    World file

    Digitizing

    Interpolar: IDW

    Kriging

    Natural Neibour

  • 8/8/2019 Lap trinh va ung dung Chaper I

    9/26

    World file

    A world file is a plain text

    computer data file used by

    GIS to georeference rastermap images.

    The file specification was

    introduced by ESRI.

    http://en.wikipedia.org/wiki/Plain_texthttp://en.wikipedia.org/wiki/Data_filehttp://en.wikipedia.org/wiki/Georeferencehttp://en.wikipedia.org/wiki/Raster_graphicshttp://en.wikipedia.org/wiki/ESRIhttp://en.wikipedia.org/wiki/ESRIhttp://en.wikipedia.org/wiki/Raster_graphicshttp://en.wikipedia.org/wiki/Georeferencehttp://en.wikipedia.org/wiki/Data_filehttp://en.wikipedia.org/wiki/Data_filehttp://en.wikipedia.org/wiki/Data_filehttp://en.wikipedia.org/wiki/Plain_texthttp://en.wikipedia.org/wiki/Plain_texthttp://en.wikipedia.org/wiki/Plain_text
  • 8/8/2019 Lap trinh va ung dung Chaper I

    10/26

    World file

    Line 1: A: pixel size in the x-direction in map units/pixel

    Line 2: D: rotation about y-axis

    Line 3: B: rotation about x-axis

    Line 4: E: pixel size in the y-direction in map units, almost

    always negative.

    Line 5: C: x-coordinate of the center of the upper left pixel

    Line 6: F: y-coordinate of the center of the upper left pixel

  • 8/8/2019 Lap trinh va ung dung Chaper I

    11/26

  • 8/8/2019 Lap trinh va ung dung Chaper I

    12/26

    Example

    0.00068664550781250889 (size of pixel in x direction)

    1.9907765865908334e-011 (rotation term for row)

    -1.7190550058712099e-018 (rotation term for column)

    -0.00067648625587322258 (size of pixel in y direction)

    104.67807769775386 (x coordinate of centre of upper leftpixel in map units)

    11.178063629472314(y coordinate of centre of upper left

    pixel in map units)

  • 8/8/2019 Lap trinh va ung dung Chaper I

    13/26

    Invert Distance Weighting (IDW)

    1

    1

    1 1

    n

    i i

    i

    n

    i j

    i j

    Z w Z

    w

    c d c d

    IDW assumes thateach measuredpoint has a localinfluence that

    diminishes withdistance.

    It weights thepoints closer to

    the predictionlocation greaterthan those fartheraway.

    http://_geostatistical_wizard_colon_searching_neighborhood_dialog_box1407990.click%28%29/http://_geostatistical_wizard_colon_searching_neighborhood_dialog_box1407990.click%28%29/
  • 8/8/2019 Lap trinh va ung dung Chaper I

    14/26

    Invert Distance Weighting (IDW)

    Power of interpolation => RMSPE

    min

    Searching strategy

    Limit of IDW ???

  • 8/8/2019 Lap trinh va ung dung Chaper I

    15/26

    Kriging method

    This method produces

    visually appealing

    maps from irregularly

    spaced data.

    Kriging attempts to

    express trends

    suggested in data.

    EX: High points might beconnected along a

    ridge rather than

    isolated by bull's-eye

    type contours.

    Semivariogram(distance h) = 0.5 * average[

    (value at location i value at location j)2 ]

  • 8/8/2019 Lap trinh va ung dung Chaper I

    16/26

    Variogram

    Orgin

    Lag Distance

    Va

    riogram

    No correlation

    2

    ( )

    12 ( ) [ ( ) ( )]

    ( ) N hh z u z u h

    N h

  • 8/8/2019 Lap trinh va ung dung Chaper I

    17/26

    Trend

    Lag Distance

    Variogram

    No correlation

  • 8/8/2019 Lap trinh va ung dung Chaper I

    18/26

    Some Definition

    2

    ,

    ,

    , ,

    Semivariogram:

    Covariance:

    Link:

    1[ ]

    2

    [ ]

    i j i j

    i j i j

    i j i j

    E Z Z

    C E Z Z

    C Sill

  • 8/8/2019 Lap trinh va ung dung Chaper I

    19/26

    Kriging method

    1

    2

    [ ] min

    n

    i i

    i

    Z w Z

    E Z Z

    2 2 2

    2

    1 1 1

    , 0 , 0

    1 1 1

    , 0 ,

    1 1

    , 0,

    1 1

    [ ] [ ] 2 [ ] [ ] [ ]

    [ ] 2 [ ] [ ]

    2

    [ ]2

    n n n

    i j i j i i

    i j i

    n n n

    i j i j i i

    i j i

    n n

    j i j i

    j ii

    n n

    j i j i

    j i

    E Z Z E Z E Z E Z E Z

    w w E Z Z w E ZZ E Z

    w w C w C C

    E Z Z w C C

    w

    w C C

  • 8/8/2019 Lap trinh va ung dung Chaper I

    20/26

  • 8/8/2019 Lap trinh va ung dung Chaper I

    21/26

    Thiessen polygons (Voronoi diagram)

  • 8/8/2019 Lap trinh va ung dung Chaper I

    22/26

    Natural Neighbor

    1

    n

    ii i i

    i

    A Z w Z w

    A

  • 8/8/2019 Lap trinh va ung dung Chaper I

    23/26

    Nearest Neighbor

    Selects the valueof the nearestpoint, and doesnot consider the

    values of otherneighboringpoints at all.

    The algorithm isvery simple to

    implement, and iscommonly usedin 3D rendering.

    http://en.wikipedia.org/wiki/3D_renderinghttp://en.wikipedia.org/wiki/3D_renderinghttp://en.wikipedia.org/wiki/3D_renderinghttp://en.wikipedia.org/wiki/3D_renderinghttp://en.wikipedia.org/wiki/3D_renderinghttp://en.wikipedia.org/wiki/3D_rendering
  • 8/8/2019 Lap trinh va ung dung Chaper I

    24/26

    Which Methods ?

    Few

    Kriging, Polynomial Regression, RadialBasis Function

    Small Kriging, Radial Basis Function

    Medi

    um

    Triangulation with Linear Interpolation

    Large

    Minimum Curvature, Triangulation withLinear Interpolation

  • 8/8/2019 Lap trinh va ung dung Chaper I

    25/26

  • 8/8/2019 Lap trinh va ung dung Chaper I

    26/26

    Reference

    http://www.statios.com/Resources/04-variogram.pdf

    http://www.statios.com/Resources/05-kriging.pdf

    http://www.cee.vt.edu/ewr/environmental/teach/smprimer/kriging/kriging.html

    http://dilbert.engr.ucdavis.edu/~suku/nem/nem_intro/node3.html

    http://gis.enr.state.nc.us/sid/bin/zhelpworld_nofrm.htm

    http://www.statios.com/Resources/04-variogram.pdfhttp://www.statios.com/Resources/04-variogram.pdfhttp://www.statios.com/Resources/05-kriging.pdfhttp://www.statios.com/Resources/05-kriging.pdfhttp://www.cee.vt.edu/ewr/environmental/teach/smprimer/kriging/kriging.htmlhttp://www.cee.vt.edu/ewr/environmental/teach/smprimer/kriging/kriging.htmlhttp://dilbert.engr.ucdavis.edu/~suku/nem/nem_intro/node3.htmlhttp://dilbert.engr.ucdavis.edu/~suku/nem/nem_intro/node3.htmlhttp://gis.enr.state.nc.us/sid/bin/zhelpworld_nofrm.htmhttp://gis.enr.state.nc.us/sid/bin/zhelpworld_nofrm.htmhttp://gis.enr.state.nc.us/sid/bin/zhelpworld_nofrm.htmhttp://gis.enr.state.nc.us/sid/bin/zhelpworld_nofrm.htmhttp://dilbert.engr.ucdavis.edu/~suku/nem/nem_intro/node3.htmlhttp://dilbert.engr.ucdavis.edu/~suku/nem/nem_intro/node3.htmlhttp://www.cee.vt.edu/ewr/environmental/teach/smprimer/kriging/kriging.htmlhttp://www.cee.vt.edu/ewr/environmental/teach/smprimer/kriging/kriging.htmlhttp://www.statios.com/Resources/05-kriging.pdfhttp://www.statios.com/Resources/05-kriging.pdfhttp://www.statios.com/Resources/05-kriging.pdfhttp://www.statios.com/Resources/04-variogram.pdfhttp://www.statios.com/Resources/04-variogram.pdfhttp://www.statios.com/Resources/04-variogram.pdf