-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
175 lines (175 loc) · 10.9 KB
/
index.html
File metadata and controls
175 lines (175 loc) · 10.9 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ArcGIS REST Scraper</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" rel="stylesheet" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.2.0/papaparse.min.js"></script>
</head>
<body>
<div class="container">
<h1>ArcGIS REST Service Scraper</h1>
<hr>
<div class="toast-container top-0 end-0 position-absolute" id="toastContainer"></div>
<div class="row">
<div class="alert alert-light border" role="alert" style="font-size: small;">
<p>Scape entire feature collections from ArcGIS REST Services using various querying methods.</p>
<p>NOTE</p>
<ul>
<li>This application is very much in a beta state and I cannot guarentee that every service will cooperate or produce valid results.</li>
<li>Currently the output has a distinct on all fields (including geometry) so the number of records might not match the feature count returned from the service.</li>
</ul>
<p>If you find any bugs please submit an issue using the <a href="https://github.com/ClasicRando/web_rest_scraper/issues">github page</a></p>
</div>
</div>
<div class="row">
<form id="inputForm">
<div class="row">
<div class="input-group mb-3">
<span class="input-group-text">Service Base Url</span>
<input type="text" class="form-control" id="baseUrl" name="baseUrl" placeholder="https://domain.com/arcgis/rest/services/Service/Layer/FeatureServer/0" aria-label="baseUrl">
<button class="btn btn-outline-secondary" type="button" id="btnMetadata">
<i class="fa-solid fa-server"></i>
</button>
</div>
</div>
</form>
</div>
<div class="row">
<form id="dataForm" hidden>
<div class="row">
<div class="col">
<div class="table-responsive" style="max-height: 500px;">
<table class="table table-stripped caption-top" style="overflow-y: hidden;" id="fields">
<caption>Service Fields</caption>
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Type</th>
<th>Is Coded?</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col">
<div class="row mb-3">
<label for="name" class="form-label">Service Name</label>
<input type="text" class="form-control" name="name" id="name" readonly>
</div>
<div class="row mb-3">
<label for="geoType" class="form-label">Geometry Type</label>
<input type="text" class="form-control" name="geoType" id="geoType" readonly>
</div>
<div class="row mb-3">
<label for="sourceSpatialReference" class="form-label">Source Spatial Reference</label>
<input type="text" class="form-control" name="sourceSpatialReference" id="sourceSpatialReference" readonly>
</div>
<div class="row mb-3">
<label for="maxQueryCount" class="form-label">Max Query Count</label>
<input type="text" class="form-control" name="maxQueryCount" id="maxQueryCount" readonly>
</div>
<div class="row mb-3">
<label for="scrapingMethod" class="form-label">Scraping Method</label>
<input type="text" class="form-control" name="scrapingMethod" id="scrapingMethod" readonly>
</div>
<div class="row mb-3">
<label for="sourceCount" class="form-label">Feature Count</label>
<input type="text" class="form-control" name="sourceCount" id="sourceCount" readonly>
</div>
</div>
</div>
</form>
</div>
<div class="row">
<form id="exportForm" hidden>
<div class="row">
<div class="col">
<div class="input-group mb-3">
<div class="input-group-text">
<input class="form-check-input mt-0" type="checkbox" value="" id="chkOutSr">
</div>
<span class="input-group-text">Output Spatial Reference</span>
<input type="text" class="form-control" name="outSr" placeholder="EPSG Code" aria-label="outSr" disabled>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="input-group mb-3">
<div class="input-group-text">
<input class="form-check-input mt-0" type="checkbox" value="" id="chkDate">
</div>
<span class="input-group-text">Format/Transform Date Fields</span>
<select class="form-select" name="dateFormat" aria-label="dateFormat" id="dateFormat" disabled></select>
<select class="form-select" name="timeZone" aria-label="timeZone" id="timeZone" disabled></select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="input-group mb-3">
<div class="input-group-text">
<input class="form-check-input mt-0" type="checkbox" value="" id="chkWhere">
</div>
<span class="input-group-text">Where Query</span>
<input type="text" class="form-control" name="where" placeholder="field > 0 and field2 = 'Status'" aria-label="where" disabled>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text">Retries</span>
<input type="text" class="form-control" name="retry" placeholder="(Default 5)" aria-label="retry">
</div>
</div>
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text">Batch Size</span>
<input type="text" class="form-control" name="batch" placeholder="(Default 20)" aria-label="batch">
</div>
</div>
<div id="includeGeometry" class="col" hidden>
<div class="input-group mb-3">
<span class="input-group-text">Geometry?</span>
<select class="form-select" name="includeGeometry" aria-label="includeGeometry">
<option value="y" selected>Yes</option>
<option value="n">No</option>
</select>
</div>
</div>
<div id="pointXY" class="col" hidden>
<div class="input-group mb-3">
<span class="input-group-text">Point as X/Y?</span>
<select class="form-select" name="pointXY" aria-label="pointXY">
<option value="y" selected>Yes</option>
<option value="n">No</option>
</select>
</div>
</div>
</div>
<div class="row" id="scrapeButtonRow" hidden>
<div class="col d-flex justify-content-md-end">
<button id="btnScrape" class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Scrape</button>
<ul class="dropdown-menu" id="scrapeOptions">
<li><a class="dropdown-item" href="#">CSV</a></li>
<li><a class="dropdown-item" href="#">GeoJSON</a></li>
</ul>
</div>
</div>
</form>
</div>
<div class="row mb-3" id="scrapeProgressRow">
<div class="progress" hidden>
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-label="Animated striped example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>