-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMapShapeHandler.cs
More file actions
42 lines (34 loc) · 1.46 KB
/
MapShapeHandler.cs
File metadata and controls
42 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MapAround.Geometry;
using MapAround.IO.Handlers;
using MapAround.Mapping;
using MapAround.DataProviders;
namespace MapAround.IO.Handlers
{
class MapPointShapeHandler : ShapeHandler
{
/// <summary>
/// Читает запись представляющую точку.
/// </summary>
/// <param name="blk">Входной поток</param>
/// <param name="record">Запись Shape-файла в которую будет помещена прочитанная информация</param>
/// <param name="bounds">Ограничивающий прямоугольник, с которым должен пересекаться ограничивающий прямоугольник записи</param>
public override bool Read(/*BigEndianBinaryReader*/TABRawBlock blk, BoundingRectangle bounds, ShapeFileRecord record, double scale)
{
ICoordinate p = PlanimetryEnvironment.NewCoordinate();
p.X = blk.ReadInt32() * scale;
p.Y = blk.ReadInt32() * scale;
if (bounds != null && !bounds.IsEmpty() && !bounds.ContainsPoint(p))
return false;
record.Points.Add(p);
record.MinX = p.X;
record.MinY = p.Y;
record.MaxX = record.MinX;
record.MaxY = record.MinY;
return true;
}
}
}