Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding source

  • Loading branch information...
commit 8edb79d3c618a30a2dc39eb80147788abf17e7d9 0 parents
Jared Williams authored
Showing with 14,461 additions and 0 deletions.
  1. +14 −0 .classpath
  2. +42 −0 .project
  3. +11 −0 .settings/.jsdtscope
  4. +7 −0 .settings/org.eclipse.jdt.core.prefs
  5. +9 −0 .settings/org.eclipse.wst.common.component
  6. +9 −0 .settings/org.eclipse.wst.common.project.facet.core.xml
  7. +1 −0  .settings/org.eclipse.wst.jsdt.ui.superType.container
  8. +1 −0  .settings/org.eclipse.wst.jsdt.ui.superType.name
  9. +1 −0  README
  10. +3 −0  WebContent/META-INF/MANIFEST.MF
  11. +27 −0 WebContent/WEB-INF/app.properties
  12. BIN  WebContent/WEB-INF/lib/commons-codec-1.4.jar
  13. BIN  WebContent/WEB-INF/lib/commons-lang-2.5.jar
  14. BIN  WebContent/WEB-INF/lib/endorsed/jaxb-api-2.1.jar
  15. BIN  WebContent/WEB-INF/lib/endorsed/jaxb-impl-2.1.jar
  16. BIN  WebContent/WEB-INF/lib/gson-1.3.jar
  17. BIN  WebContent/WEB-INF/lib/jasypt-1.6.jar
  18. BIN  WebContent/WEB-INF/lib/mysql-connector-java-3.1.7-bin.jar
  19. BIN  WebContent/WEB-INF/lib/saaj-api.jar
  20. BIN  WebContent/WEB-INF/lib/saaj-impl.jar
  21. BIN  WebContent/WEB-INF/lib/xstream-1.3.1.jar
  22. +35 −0 WebContent/WEB-INF/web.xml
  23. BIN  WebContent/down.gif
  24. +144 −0 WebContent/index.jsp
  25. +123 −0 WebContent/jquery.color.js
  26. +233 −0 WebContent/js.js
  27. BIN  WebContent/r.gif
  28. +113 −0 WebContent/style.css
  29. BIN  build/classes/connectors/BingConnect.class
  30. BIN  build/classes/connectors/DMVConnect$1.class
  31. BIN  build/classes/connectors/DMVConnect.class
  32. BIN  build/classes/connectors/FCCConnect.class
  33. BIN  build/classes/connectors/GoogleConnect.class
  34. BIN  build/classes/connectors/USPSConnect.class
  35. BIN  build/classes/connectors/YahooConnect.class
  36. BIN  build/classes/control/ApiController.class
  37. BIN  build/classes/control/Connect.class
  38. BIN  build/classes/control/DistrictServices$WFS_.class
  39. BIN  build/classes/control/DistrictServices$WFS_Assembly.class
  40. BIN  build/classes/control/DistrictServices$WFS_Congressional.class
  41. BIN  build/classes/control/DistrictServices$WFS_County.class
  42. BIN  build/classes/control/DistrictServices$WFS_Election.class
  43. BIN  build/classes/control/DistrictServices$WFS_POLY.class
  44. BIN  build/classes/control/DistrictServices$WFS_Senate.class
  45. BIN  build/classes/control/DistrictServices$WFS_Senate_POLY.class
  46. BIN  build/classes/control/DistrictServices.class
  47. BIN  build/classes/control/GeoCode.class
  48. BIN  build/classes/control/Resource.class
  49. +56 −0 build/classes/database
  50. BIN  build/classes/generated/bing/Address.class
  51. BIN  build/classes/generated/bing/BoundingBox.class
  52. BIN  build/classes/generated/bing/Location.class
  53. BIN  build/classes/generated/bing/ObjectFactory.class
  54. BIN  build/classes/generated/bing/Point.class
  55. BIN  build/classes/generated/bing/ResourceSet.class
  56. BIN  build/classes/generated/bing/ResourceSets.class
  57. BIN  build/classes/generated/bing/Resources.class
  58. BIN  build/classes/generated/bing/Response.class
  59. BIN  build/classes/generated/bing/package-info.class
  60. BIN  build/classes/generated/dmv/ADDRESSRECORD.class
  61. BIN  build/classes/generated/dmv/ADDRESSRECORDS.class
  62. BIN  build/classes/generated/dmv/ADMINTRANSACTION.class
  63. BIN  build/classes/generated/dmv/ADMINUSER.class
  64. BIN  build/classes/generated/dmv/AmsValidateResponse.class
  65. BIN  build/classes/generated/dmv/AmsValidateResult.class
  66. BIN  build/classes/generated/dmv/BASEALTCODE.class
  67. BIN  build/classes/generated/dmv/Body.class
  68. BIN  build/classes/generated/dmv/Envelope.class
  69. BIN  build/classes/generated/dmv/INPUT.class
  70. BIN  build/classes/generated/dmv/MUNICIPALITY.class
  71. BIN  build/classes/generated/dmv/OUTPUT.class
  72. BIN  build/classes/generated/dmv/ObjectFactory.class
  73. BIN  build/classes/generated/dmv/POSTDIR.class
  74. BIN  build/classes/generated/dmv/PREDIR.class
  75. BIN  build/classes/generated/dmv/SECCODE.class
  76. BIN  build/classes/generated/dmv/SECHIGH.class
  77. BIN  build/classes/generated/dmv/SECLOW.class
  78. BIN  build/classes/generated/dmv/SECNAME.class
  79. BIN  build/classes/generated/dmv/SECONDARYNUMBER.class
  80. BIN  build/classes/generated/dmv/SECONDSTDDELIVADDR.class
  81. BIN  build/classes/generated/dmv/STATEABBREV.class
  82. BIN  build/classes/generated/dmv/STDCITYABBRV.class
  83. BIN  build/classes/generated/dmv/STDFIRMNAME.class
  84. BIN  build/classes/generated/dmv/SYSTEMMESSAGES.class
  85. BIN  build/classes/generated/dmv/UNIT.class
  86. BIN  build/classes/generated/dmv/UPDATEKEY.class
  87. BIN  build/classes/generated/dmv/URBANIZATION.class
  88. BIN  build/classes/generated/dmv/package-info.class
  89. BIN  build/classes/generated/fcc/Block.class
  90. BIN  build/classes/generated/fcc/County.class
  91. BIN  build/classes/generated/fcc/Err.class
  92. BIN  build/classes/generated/fcc/ObjectFactory.class
  93. BIN  build/classes/generated/fcc/Response.class
  94. BIN  build/classes/generated/fcc/State.class
  95. BIN  build/classes/generated/fcc/package-info.class
  96. BIN  build/classes/generated/geoserver/json/GeoFeatures.class
  97. BIN  build/classes/generated/geoserver/json/GeoGeometry.class
  98. BIN  build/classes/generated/geoserver/json/GeoProperty.class
  99. BIN  build/classes/generated/geoserver/json/GeoResult.class
  100. BIN  build/classes/generated/google/AddressComponent.class
  101. BIN  build/classes/generated/google/Bounds.class
  102. BIN  build/classes/generated/google/GeocodeResponse.class
  103. BIN  build/classes/generated/google/Geometry.class
  104. BIN  build/classes/generated/google/Location.class
  105. BIN  build/classes/generated/google/Northeast.class
  106. BIN  build/classes/generated/google/ObjectFactory.class
  107. BIN  build/classes/generated/google/Result.class
  108. BIN  build/classes/generated/google/Southwest.class
  109. BIN  build/classes/generated/google/Viewport.class
  110. BIN  build/classes/generated/usps/Address.class
  111. BIN  build/classes/generated/usps/AddressValidateResponse.class
  112. BIN  build/classes/generated/usps/CityStateLookupResponse.class
  113. BIN  build/classes/generated/usps/Error.class
  114. BIN  build/classes/generated/usps/HelpContext.class
  115. BIN  build/classes/generated/usps/HelpFile.class
  116. BIN  build/classes/generated/usps/ObjectFactory.class
  117. BIN  build/classes/generated/usps/ZipCode.class
  118. BIN  build/classes/generated/usps/ZipCodeLookupResponse.class
  119. BIN  build/classes/generated/yahoo/Line3.class
  120. BIN  build/classes/generated/yahoo/Name.class
  121. BIN  build/classes/generated/yahoo/Neighborhood.class
  122. BIN  build/classes/generated/yahoo/ObjectFactory.class
  123. BIN  build/classes/generated/yahoo/Result.class
  124. BIN  build/classes/generated/yahoo/ResultSet.class
  125. BIN  build/classes/generated/yahoo/Unit.class
  126. BIN  build/classes/generated/yahoo/Unittype.class
  127. BIN  build/classes/generated/yahoo/Xstreet.class
  128. BIN  build/classes/model/ApiUser.class
  129. BIN  build/classes/model/ErrorResponse.class
  130. BIN  build/classes/model/Ignore.class
  131. BIN  build/classes/model/Metric.class
  132. BIN  build/classes/model/ParseStream.class
  133. BIN  build/classes/model/PersistentObject.class
  134. BIN  build/classes/model/Point.class
  135. BIN  build/classes/model/ValidateResponse.class
  136. BIN  build/classes/model/abstracts/AbstractGeocoder.class
  137. BIN  build/classes/model/abstracts/AbstractReverseGeocoder.class
  138. BIN  build/classes/model/districts/Assembly.class
  139. BIN  build/classes/model/districts/Census.class
  140. BIN  build/classes/model/districts/Congressional.class
  141. BIN  build/classes/model/districts/County.class
  142. BIN  build/classes/model/districts/DistrictResponse.class
  143. BIN  build/classes/model/districts/Election.class
  144. BIN  build/classes/model/districts/Member.class
  145. BIN  build/classes/model/districts/Senate.class
  146. BIN  build/classes/model/districts/Senator.class
  147. BIN  build/classes/scrapers/AssemblyScraper.class
  148. BIN  build/classes/scrapers/CongressScraper.class
  149. BIN  build/classes/scrapers/NYSenateScraper.class
  150. BIN  build/classes/servlets/ApiServlet$ApiInputException.class
  151. BIN  build/classes/servlets/ApiServlet.class
  152. BIN  build/classes/servlets/SenateFilter.class
  153. +28 −0 build/classes/update
  154. +199 −0 schema/ams.xsd
  155. +100 −0 schema/bing.xsd
  156. +56 −0 schema/database
  157. +88 −0 schema/googlemaps.xsd
  158. +44 −0 schema/usps.xsd
  159. +123 −0 src/connectors/BingConnect.java
  160. +164 −0 src/connectors/DMVConnect.java
  161. +50 −0 src/connectors/FCCConnect.java
  162. +80 −0 src/connectors/GoogleConnect.java
  163. +210 −0 src/connectors/USPSConnect.java
  164. +94 −0 src/connectors/YahooConnect.java
  165. +121 −0 src/control/ApiController.java
  166. +288 −0 src/control/Connect.java
  167. +449 −0 src/control/DistrictServices.java
  168. +123 −0 src/control/GeoCode.java
  169. +62 −0 src/control/Resource.java
  170. +56 −0 src/database
  171. +190 −0 src/generated/bing/Address.java
  172. +155 −0 src/generated/bing/BoundingBox.java
  173. +218 −0 src/generated/bing/Location.java
  174. +326 −0 src/generated/bing/ObjectFactory.java
  175. +99 −0 src/generated/bing/Point.java
  176. +99 −0 src/generated/bing/ResourceSet.java
  177. +71 −0 src/generated/bing/ResourceSets.java
  178. +78 −0 src/generated/bing/Resources.java
  179. +247 −0 src/generated/bing/Response.java
  180. +9 −0 src/generated/bing/package-info.java
  181. +824 −0 src/generated/dmv/ADDRESSRECORD.java
  182. +71 −0 src/generated/dmv/ADDRESSRECORDS.java
  183. +76 −0 src/generated/dmv/ADMINTRANSACTION.java
  184. +39 −0 src/generated/dmv/ADMINUSER.java
  185. +71 −0 src/generated/dmv/AmsValidateResponse.java
  186. +211 −0 src/generated/dmv/AmsValidateResult.java
  187. +39 −0 src/generated/dmv/BASEALTCODE.java
  188. +71 −0 src/generated/dmv/Body.java
  189. +70 −0 src/generated/dmv/Envelope.java
  190. +155 −0 src/generated/dmv/INPUT.java
  191. +39 −0 src/generated/dmv/MUNICIPALITY.java
  192. +562 −0 src/generated/dmv/OUTPUT.java
  193. +598 −0 src/generated/dmv/ObjectFactory.java
  194. +39 −0 src/generated/dmv/POSTDIR.java
  195. +39 −0 src/generated/dmv/PREDIR.java
  196. +39 −0 src/generated/dmv/SECCODE.java
  197. +39 −0 src/generated/dmv/SECHIGH.java
  198. +39 −0 src/generated/dmv/SECLOW.java
  199. +39 −0 src/generated/dmv/SECNAME.java
  200. +39 −0 src/generated/dmv/SECONDARYNUMBER.java
  201. +39 −0 src/generated/dmv/SECONDSTDDELIVADDR.java
  202. +39 −0 src/generated/dmv/STATEABBREV.java
  203. +39 −0 src/generated/dmv/STDCITYABBRV.java
  204. +39 −0 src/generated/dmv/STDFIRMNAME.java
  205. +71 −0 src/generated/dmv/SYSTEMMESSAGES.java
  206. +39 −0 src/generated/dmv/UNIT.java
  207. +39 −0 src/generated/dmv/UPDATEKEY.java
  208. +39 −0 src/generated/dmv/URBANIZATION.java
  209. +8 −0 src/generated/dmv/package-info.java
  210. +68 −0 src/generated/fcc/Block.java
  211. +100 −0 src/generated/fcc/County.java
  212. +97 −0 src/generated/fcc/Err.java
  213. +79 −0 src/generated/fcc/ObjectFactory.java
  214. +218 −0 src/generated/fcc/Response.java
  215. +129 −0 src/generated/fcc/State.java
  216. +9 −0 src/generated/fcc/package-info.java
  217. +34 −0 src/generated/geoserver/json/GeoFeatures.java
  218. +27 −0 src/generated/geoserver/json/GeoGeometry.java
  219. +141 −0 src/generated/geoserver/json/GeoProperty.java
  220. +22 −0 src/generated/geoserver/json/GeoResult.java
  221. +139 −0 src/generated/google/AddressComponent.java
  222. +99 −0 src/generated/google/Bounds.java
  223. +111 −0 src/generated/google/GeocodeResponse.java
  224. +160 −0 src/generated/google/Geometry.java
  225. +99 −0 src/generated/google/Location.java
  226. +99 −0 src/generated/google/Northeast.java
  227. +200 −0 src/generated/google/ObjectFactory.java
  228. +172 −0 src/generated/google/Result.java
  229. +99 −0 src/generated/google/Southwest.java
  230. +99 −0 src/generated/google/Viewport.java
  231. +273 −0 src/generated/usps/Address.java
  232. +71 −0 src/generated/usps/AddressValidateResponse.java
  233. +71 −0 src/generated/usps/CityStateLookupResponse.java
  234. +183 −0 src/generated/usps/Error.java
  235. +39 −0 src/generated/usps/HelpContext.java
  236. +39 −0 src/generated/usps/HelpFile.java
  237. +210 −0 src/generated/usps/ObjectFactory.java
  238. +190 −0 src/generated/usps/ZipCode.java
  239. +72 −0 src/generated/usps/ZipCodeLookupResponse.java
  240. +39 −0 src/generated/yahoo/Line3.java
  241. +39 −0 src/generated/yahoo/Name.java
  242. +39 −0 src/generated/yahoo/Neighborhood.java
  243. +396 −0 src/generated/yahoo/ObjectFactory.java
  244. +868 −0 src/generated/yahoo/Result.java
  245. +244 −0 src/generated/yahoo/ResultSet.java
  246. +39 −0 src/generated/yahoo/Unit.java
  247. +39 −0 src/generated/yahoo/Unittype.java
  248. +39 −0 src/generated/yahoo/Xstreet.java
  249. +52 −0 src/model/ApiUser.java
  250. +12 −0 src/model/ErrorResponse.java
  251. +12 −0 src/model/Ignore.java
  252. +51 −0 src/model/Metric.java
  253. +22 −0 src/model/ParseStream.java
  254. +12 −0 src/model/PersistentObject.java
  255. +17 −0 src/model/Point.java
  256. +98 −0 src/model/ValidateResponse.java
  257. +8 −0 src/model/abstracts/AbstractGeocoder.java
  258. +9 −0 src/model/abstracts/AbstractReverseGeocoder.java
  259. +37 −0 src/model/districts/Assembly.java
  260. +21 −0 src/model/districts/Census.java
  261. +37 −0 src/model/districts/Congressional.java
  262. +28 −0 src/model/districts/County.java
  263. +96 −0 src/model/districts/DistrictResponse.java
  264. +27 −0 src/model/districts/Election.java
  265. +34 −0 src/model/districts/Member.java
  266. +47 −0 src/model/districts/Senate.java
  267. +46 −0 src/model/districts/Senator.java
  268. +40 −0 src/scrapers/AssemblyScraper.java
  269. +49 −0 src/scrapers/CongressScraper.java
  270. +79 −0 src/scrapers/NYSenateScraper.java
  271. +346 −0 src/servlets/ApiServlet.java
  272. +55 −0 src/servlets/SenateFilter.java
  273. +28 −0 src/update
14 .classpath
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.6.0_03">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="lib" path="C:/Documents and Settings/Wililiams/workspace/GeoApi/WebContent/WEB-INF/lib/gson-1.3.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
42 .project
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>GeoApi</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.metrics.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ <nature>net.sourceforge.metrics.nature</nature>
+ </natures>
+</projectDescription>
11 .settings/.jsdtscope
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
7 .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Wed Jul 28 17:36:16 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
9 .settings/org.eclipse.wst.common.component
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="GeoApi">
+ <wb-resource deploy-path="/" source-path="/WebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+ <property name="context-root" value="GeoApi"/>
+ <property name="java-output-path" value="/GeoApi/build/classes"/>
+ </wb-module>
+</project-modules>
9 .settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="Apache Tomcat v6.0 (2)"/>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.java"/>
+ <installed facet="jst.java" version="6.0"/>
+ <installed facet="jst.web" version="2.5"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
1  .settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
1  .settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Window
1  README
@@ -0,0 +1 @@
+GeoApi relies on a number of services (GeoServer, Google, Yahoo, Bing, NySenate, Ny Assembly, etc.) to serve district related information.
3  WebContent/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
27 WebContent/WEB-INF/app.properties
@@ -0,0 +1,27 @@
+bing.key =
+
+dmv.url =
+dmv.user =
+dmv.pass =
+dmv.token =
+
+google.sensor =
+google.address =
+google.reverse =
+
+usps.url =
+usps.id =
+usps.format =
+usps.verify =
+usps.citystate =
+usps.zipcode =
+
+yahoo.consumerkey =
+
+geoserver.url =
+
+database.url =
+database.user =
+database.pass =
+
+user.default =
BIN  WebContent/WEB-INF/lib/commons-codec-1.4.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/commons-lang-2.5.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/endorsed/jaxb-api-2.1.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/endorsed/jaxb-impl-2.1.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/gson-1.3.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/jasypt-1.6.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/mysql-connector-java-3.1.7-bin.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/saaj-api.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/saaj-impl.jar
Binary file not shown
BIN  WebContent/WEB-INF/lib/xstream-1.3.1.jar
Binary file not shown
35 WebContent/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+ <display-name>GeoApi</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <description></description>
+ <display-name>ApiServlet</display-name>
+ <servlet-name>ApiServlet</servlet-name>
+ <servlet-class>servlets.ApiServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ApiServlet</servlet-name>
+ <url-pattern>/ApiServlet</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ApiServlet</servlet-name>
+ <url-pattern>/api/*</url-pattern>
+ </servlet-mapping>
+ <filter>
+ <display-name>SenateFilter</display-name>
+ <filter-name>SenateFilter</filter-name>
+ <filter-class>servlets.SenateFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>SenateFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
BIN  WebContent/down.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 WebContent/index.jsp
@@ -0,0 +1,144 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript" src="jquery.color.js"></script>
+<script type="text/javascript" src="js.js"></script>
+
+<link href="style.css" rel="stylesheet" type="text/css">
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>SAGE (Senate Address GeoCoding Engine)</title>
+</head>
+<body onload="initialize();">
+ <div class="response_body">
+ </div>
+
+ <div id="map_canvas">
+ </div>
+
+<div class="message_list">
+ <div class="message_head"><cite>Address Validation</cite></div>
+ <div class="message_body">
+ <form id="validateForm" method="post">
+ <ol>
+ <li>
+ <label>Address</label>
+ <input type="text" placeholder="street address..." name="addr2">
+ </li>
+ <li>
+ <label>City</label>
+ <input type="text" placeholder="" name="city">
+ </li>
+ <li>
+ <label>State</label>
+ <input type="text" placeholder="e.g. NY" name="state" maxlength="2">
+ </li>
+ <li>
+ <label>Zip5</label>
+ <input type="text" placeholder="" name="zip5" maxlength="5">
+ </li>
+ <li>
+ <label>Zip4</label>
+ <input type="text" placeholder="" name="zip4" maxlength="4">
+ </li>
+ <li>
+ <label>Service</label>
+ <select name="service">
+ <option>(Optional)</option>
+ <option>USPS</option>
+ <option>DMV</option>
+ </select>
+ </li>
+ <li id="send">
+ <input type="submit" id="validate" name="submit">
+ </li>
+ </ol>
+ </form>
+ </div>
+ <p class="message_head"><cite>District Information</cite></p>
+ <div class="message_body">
+ <form id="districtsForm" action="" method="post">
+ <ol>
+ <li>
+ <label>Address</label>
+ <input type="text" placeholder="street address..." name="addr2">
+ </li>
+ <li>
+ <label>City</label>
+ <input type="text" placeholder="" name="city">
+ </li>
+ <li>
+ <label>State</label>
+ <input type="text" placeholder="e.g. NY" name="state" maxlength="2">
+ </li>
+ <li>
+ <label>Zip5</label>
+ <input type="text" placeholder="" name="zip5" maxlength="5">
+ </li>
+ <li>
+ <label>Zip4</label>
+ <input type="text" placeholder="" name="zip4" maxlength="4">
+ </li>
+ <li>
+ <label>Service</label>
+ <select name="service">
+ <option>(Optional)</option>
+ <option>Google</option>
+ <option>Yahoo</option>
+ <option>Bing</option>
+ </select>
+ </li>
+ <li id="send">
+ <input type="submit" id="districts" name="submit">
+ </li>
+ </ol>
+ </form>
+ </div>
+ <p class="message_head"><cite>Lookup By Zip</cite></p>
+ <div class="message_body">
+ <form id="zipForm" action="" method="post">
+ <ol>
+ <li>
+ <label>Zip5</label>
+ <input type="text" placeholder="" name="zip5">
+ </li>
+ <li id="send">
+ <input type="submit" id="zip" name="submit">
+ </li>
+ </ol>
+ </form>
+ </div>
+ <p class="message_head"><cite>Reverse GeoCode</cite></p>
+ <div class="message_body">
+ <form id="revgeoForm" action="" method="post">
+ <ol>
+ <li>
+ <label>Latitude</label>
+ <input type="text" placeholder="" name="lat">
+ </li>
+ <li>
+ <label>Longitude</label>
+ <input type="text" placeholder="" name="lon">
+ </li>
+ <li>
+ <label>Service</label>
+ <select name="service">
+ <option>(Optional)</option>
+ <option>Google</option>
+ <option>Yahoo</option>
+ <option>Bing</option>
+ </select>
+ </li>
+ <li id="send">
+ <input type="submit" id="revgeo" name="submit">
+ </li>
+ </ol>
+ </form>
+ </div>
+</div>
+
+</body>
+</html>
123 WebContent/jquery.color.js
@@ -0,0 +1,123 @@
+/*
+ * jQuery Color Animations
+ * Copyright 2007 John Resig
+ * Released under the MIT and GPL licenses.
+ */
+
+(function(jQuery){
+
+ // We override the animation for all of these color styles
+ jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
+ jQuery.fx.step[attr] = function(fx){
+ if ( fx.state == 0 ) {
+ fx.start = getColor( fx.elem, attr );
+ fx.end = getRGB( fx.end );
+ }
+
+ fx.elem.style[attr] = "rgb(" + [
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
+ ].join(",") + ")";
+ }
+ });
+
+ // Color Conversion functions from highlightFade
+ // By Blair Mitchelmore
+ // http://jquery.offput.ca/highlightFade/
+
+ // Parse strings looking for color tuples [255,255,255]
+ function getRGB(color) {
+ var result;
+
+ // Check if we're already dealing with an array of colors
+ if ( color && color.constructor == Array && color.length == 3 )
+ return color;
+
+ // Look for rgb(num,num,num)
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
+ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
+
+ // Look for rgb(num%,num%,num%)
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
+
+ // Look for #a0b1c2
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
+
+ // Look for #fff
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
+
+ // Otherwise, we're most likely dealing with a named color
+ return colors[jQuery.trim(color).toLowerCase()];
+ }
+
+ function getColor(elem, attr) {
+ var color;
+
+ do {
+ color = jQuery.curCSS(elem, attr);
+
+ // Keep going until we find an element that has color, or we hit the body
+ if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
+ break;
+
+ attr = "backgroundColor";
+ } while ( elem = elem.parentNode );
+
+ return getRGB(color);
+ };
+
+ // Some named colors to work with
+ // From Interface by Stefan Petre
+ // http://interface.eyecon.ro/
+
+ var colors = {
+ aqua:[0,255,255],
+ azure:[240,255,255],
+ beige:[245,245,220],
+ black:[0,0,0],
+ blue:[0,0,255],
+ brown:[165,42,42],
+ cyan:[0,255,255],
+ darkblue:[0,0,139],
+ darkcyan:[0,139,139],
+ darkgrey:[169,169,169],
+ darkgreen:[0,100,0],
+ darkkhaki:[189,183,107],
+ darkmagenta:[139,0,139],
+ darkolivegreen:[85,107,47],
+ darkorange:[255,140,0],
+ darkorchid:[153,50,204],
+ darkred:[139,0,0],
+ darksalmon:[233,150,122],
+ darkviolet:[148,0,211],
+ fuchsia:[255,0,255],
+ gold:[255,215,0],
+ green:[0,128,0],
+ indigo:[75,0,130],
+ khaki:[240,230,140],
+ lightblue:[173,216,230],
+ lightcyan:[224,255,255],
+ lightgreen:[144,238,144],
+ lightgrey:[211,211,211],
+ lightpink:[255,182,193],
+ lightyellow:[255,255,224],
+ lime:[0,255,0],
+ magenta:[255,0,255],
+ maroon:[128,0,0],
+ navy:[0,0,128],
+ olive:[128,128,0],
+ orange:[255,165,0],
+ pink:[255,192,203],
+ purple:[128,0,128],
+ violet:[128,0,128],
+ red:[255,0,0],
+ silver:[192,192,192],
+ white:[255,255,255],
+ yellow:[255,255,0]
+ };
+
+})(jQuery);
233 WebContent/js.js
@@ -0,0 +1,233 @@
+var api = "/GeoApi/api/json/";
+var districts = "districts/extended?";
+var geocode = "geocode/extended?";
+var revgeo = "revgeo/";
+var validate = "validate/extended?";
+var cityState = "/citystatelookup/extended?";
+
+var geocoder;
+var map;
+
+function initialize() {
+ geocoder = new google.maps.Geocoder();
+ var latlng = new google.maps.LatLng(42.651445, -73.755254);
+ var myOptions = {
+ zoom: 12,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+}
+
+function addAddressToMap(address) {
+ initialize();
+ geocoder.geocode( { 'address': address}, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ map.setCenter(results[0].geometry.location);
+ updateMap(results[0].geometry.location, address);
+ }});
+}
+
+function addLatLonToMap(latlon, address) {
+ initialize();
+ map.setCenter(latlon);
+ updateMap(latlon,address);
+}
+
+function updateMap(latlon, address) {
+ var marker = new google.maps.Marker({
+ map: map,
+ position: latlon,
+ title: address});
+ var infowindow = new google.maps.InfoWindow({
+ content: address,
+ size: new google.maps.Size(50,50)});
+ google.maps.event.addListener(marker, 'click', function() {
+ infowindow.open(map,marker);});
+}
+
+function buildUrl(name, val) {
+ var ret = null;
+ if(name == "service") {
+ if(val != "(Optional)") {
+ ret = name + '=' + val + '&';
+ }
+ }
+ else {
+ if(name != "submit") {
+ ret = name + '=' + val + '&';
+ }
+ }
+ if(ret == null) {
+ return "";
+ }
+ return ret;
+}
+
+$(document).ready(function(){
+
+ var menu_pos = 0;
+
+ //initialize page
+ $(".message_list .message_body:gt(0)").hide(500);
+ $(".message_list .message_head:lt(1)").css("backgroundColor","#9D9D9D");
+ $(".message_list .message_head:gt(0)").animate({opacity: 0.6},500);
+ $(".message_list .message_head").append("&nbsp;&nbsp;<img src='down.gif'></img>");
+
+ //toggle message_body
+ $(".message_head").click(function(){
+ $(".message_list .message_body").hide(500);
+ $(".message_list .message_head").css("backgroundColor","#eee");
+ $(".message_list .message_head").css("opacity",0.6);
+
+ $(this).next(".message_body").slideToggle(500);
+ $(this).css("background","#9D9D9D");
+ $(this).css("opacity",1.0);
+
+ menu_pos = $(this).index();
+ return false;
+ });
+
+ $(".message_head").hover(
+ function(){
+ if($(this).index() != menu_pos) {
+ $(this).stop().animate({
+ opacity: 1.0,
+ backgroundColor: "#9D9D9D"
+ },100);
+ }
+ },
+ function() {
+ if($(this).index() != menu_pos) {
+ $(this).stop().animate({
+ opacity: 0.6,
+ backgroundColor: "#eee"
+ },100);
+ }
+ });
+
+ $("#validate").click(function() {
+ $(".response_body").html("<img src='r.gif'>");
+ var url = api + validate;
+ var $inputs = $("#validateForm :input");
+ $inputs.each(function() {
+ url = url + buildUrl(this.name, $(this).val());
+ });
+ $.getJSON(url, function(data) {
+ if(data.message != null) {
+ $(".response_body").html("There was an issue processing your request because necessary " +
+ "information is missing or the address you entered is invalid.");
+ }
+ else {
+ if(data.address1 != null) {
+ $(".response_body").html("<label>Address1:</label> " + data.address1 + "<br />");
+ $(".response_body").append("<label>Address2:</label> " + data.address2 + "<br />");
+ }
+ else {
+ $(".response_body").html("<label>Address:</label> " + data.address2 + "<br />");
+ }
+ $(".response_body").append("<label>City:</label> " + data.city + "<br />");
+ $(".response_body").append("<label>State:</label> " + data.state + "<br />");
+ $(".response_body").append("<label>Zip5:</label> " + data.zip5 + "<br />");
+ $(".response_body").append("<label>Zip4:</label> " + data.zip4 + "<br />");
+ var address = data.address2 + ", " + data.city + ", " + data.state + " " + data.zip5;
+ addAddressToMap(address);
+ }
+ });
+ return false;
+ });
+
+ $("#districts").click(function() {
+ $(".response_body").html("<img src='r.gif'>");
+ var url = api + districts;
+
+ var $inputs = $("#districtsForm :input");
+ $inputs.each(function() {
+ url = url + buildUrl(this.name, $(this).val());
+ });
+
+ $.getJSON(url, function(data) {
+ if(data.message != null) {
+ $(".response_body").html("There was an issue processing your request because necessary " +
+ "information is missing or the address you entered is invalid.");
+ }
+ else {
+ $(".response_body").html("<label>Latitude:</label> " + data.lat + "<br />");
+ $(".response_body").append("<label>Longitude:</label> " + data.lon + "<br />");
+ $(".response_body").append("<label>Address:</label> " + data.address + "<br />");
+ $(".response_body").append(data.assembly.district + "<br />");
+ $(".response_body").append(data.congressional.district + "<br />");
+ $(".response_body").append(data.county.countyName + "<br />");
+ $(".response_body").append(data.election.district + "<br />");
+ $(".response_body").append(data.senate.district + "<br />");
+ $(".response_body").append("FIPS Code: "+data.census.fips + "<br />");
+
+ var latlon = new google.maps.LatLng(data.lat, data.lon);
+
+ addLatLonToMap(latlon, data.address);
+ }
+ });
+
+ return false;
+ });
+
+ $("#revgeo").click(function() {
+ $(".response_body").html("<img src='r.gif'>");
+ var url = api + revgeo;
+
+ var $inputs = $("#revgeoForm :input");
+ $inputs.each(function() {
+ if(this.name == "lat") {
+ url = url + $(this).val() + ",";
+ }
+ if(this.name == "lon") {
+ url = url + $(this).val();
+ }
+ });
+
+ $.getJSON(url, function(data) {
+ if(data.message != null) {
+ $(".response_body").html("There was an issue processing your request because necessary " +
+ "information is missing or the address you entered is invalid.");
+ }
+ else {
+ $(".response_body").html("<label>Latitude:</label> " + data[0].lat + "<br />");
+ $(".response_body").append("<label>Longitude:</label> " + data[0].lon + "<br />");
+ $(".response_body").append("<label>Address:</label> " + data[0].address + "<br />");
+
+ var latlon = new google.maps.LatLng(data[0].lat, data[0].lon);
+
+ addLatLonToMap(latlon, data[0].address);
+ }
+ });
+
+ return false;
+ });
+
+ $("#zip").click(function() {
+ $(".response_body").html("<img src='r.gif'>");
+ var url = api + cityState;
+
+ var $inputs = $("#zipForm :input");
+ $inputs.each(function() {
+ url = url + buildUrl(this.name, $(this).val());
+ });
+
+ $.getJSON(url, function(data) {
+ if(data.message != null) {
+ $(".response_body").html("There was an issue processing your request because necessary " +
+ "information is missing or the address you entered is invalid.");
+ }
+ else {
+ $(".response_body").html("<label>City:</label> " + data.city + "<br />");
+ $(".response_body").append("<label>State:</label> " + data.state + "<br />");
+ $(".response_body").append("<label>Zip5:</label> " + data.zip5 + "<br />");
+
+ var address = data.city + " " + data.state + " " + data.zip5;
+ addAddressToMap(address);
+ }
+ });
+
+ return false;
+ });
+});
BIN  WebContent/r.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 WebContent/style.css
@@ -0,0 +1,113 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+body {
+ font-family: helvetica, arial;
+ font-size: 89.5%; /* 10px */
+ line-height: 1.4em; /* 15px */
+ color: #333;
+ background-color: #fff;
+ margin:16px;
+ margin-top:1px;
+}
+p {
+ padding: 0 0 1em;
+}
+
+/* message display page */
+.response_body {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ width: 383px;
+ position:absolute;
+ left:405px;
+ top:280px;
+}
+
+#map_canvas {
+ width: 383px;
+ height: 250px;
+ position:absolute;
+ left:405px;
+ top:5px;
+}
+
+.message_list {
+ position:absolute;
+ background:#eee;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ width: 383px;
+ top:5px;
+}
+
+.message_head {
+ backgroundColor:#eee;
+ padding: 5px 10px;
+ cursor: pointer;
+ position: relative;
+}
+
+.message_head cite {
+ font-size: 100%;
+ font-weight: bold;
+ font-style: normal;
+}
+.message_body {
+ padding: 5px 10px 15px;
+ position: relative;
+ border-width:1px;
+ border-left-style:dotted;
+}
+
+#distancetitle {
+ font-size: 95%;
+ font-weight: bold;
+ font-style: normal;
+ right:5px;
+}
+
+form ol {
+ list-style:none;
+ margin:0;
+ padding:0;
+}
+
+form {
+ font:13px Georgia, "Times New Roman", Times, serif;
+ margin:20px;
+ padding:10px 20px;
+ width:330px;
+ }
+
+form ol {
+ list-style:none;
+ margin:0;
+ padding:0;
+}
+
+form li {
+ padding:6px;
+ background:#e1e1e1;
+ margin-bottom:1px;
+}
+
+form li#send {
+ background:none;
+ margin-top:6px;
+}
+
+form label {
+ float:left;
+ width:70px;
+ text-align:right;
+ margin-right:7px;
+ line-height:23px;
+}
+
+input[type=text] {
+ width:200px;
+}
BIN  build/classes/connectors/BingConnect.class
Binary file not shown
BIN  build/classes/connectors/DMVConnect$1.class
Binary file not shown
BIN  build/classes/connectors/DMVConnect.class
Binary file not shown
BIN  build/classes/connectors/FCCConnect.class
Binary file not shown
BIN  build/classes/connectors/GoogleConnect.class
Binary file not shown
BIN  build/classes/connectors/USPSConnect.class
Binary file not shown
BIN  build/classes/connectors/YahooConnect.class
Binary file not shown
BIN  build/classes/control/ApiController.class
Binary file not shown
BIN  build/classes/control/Connect.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_Assembly.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_Congressional.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_County.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_Election.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_POLY.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_Senate.class
Binary file not shown
BIN  build/classes/control/DistrictServices$WFS_Senate_POLY.class
Binary file not shown
BIN  build/classes/control/DistrictServices.class
Binary file not shown
BIN  build/classes/control/GeoCode.class
Binary file not shown
BIN  build/classes/control/Resource.class
Binary file not shown
56 build/classes/database
@@ -0,0 +1,56 @@
+CREATE USER 'geoapi'@'localhost' IDENTIFIED BY 'ga2010';
+
+DROP DATABASE geoapi;
+
+CREATE DATABASE geoapi;
+
+GRANT ALL PRIVILEGES
+ON geoapi.*
+TO 'geoapi'@'localhost'
+WITH GRANT OPTION;
+
+GRANT ALL PRIVILEGES
+ON geoapi.*
+TO 'geoapi'@'%'
+WITH GRANT OPTION;
+
+USE geoapi;
+
+CREATE TABLE apiuser (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ apikey VARCHAR(256),
+ name VARCHAR(256),
+ description VARCHAR(1024),
+ UNIQUE (apikey)
+) ENGINE=INNODB;
+
+CREATE TABLE metric (
+ command VARCHAR(2056),
+ date VARCHAR(256),
+ host VARCHAR(256),
+ userid INT,
+ FOREIGN KEY (userid) references apiuser(id) ON DELETE CASCADE
+) ENGINE=INNODB;
+
+CREATE TABLE senate (
+ district VARCHAR(50),
+ districturl VARCHAR(256),
+ name VARCHAR(256),
+ contact VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE assembly (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE congressional (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
BIN  build/classes/generated/bing/Address.class
Binary file not shown
BIN  build/classes/generated/bing/BoundingBox.class
Binary file not shown
BIN  build/classes/generated/bing/Location.class
Binary file not shown
BIN  build/classes/generated/bing/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/bing/Point.class
Binary file not shown
BIN  build/classes/generated/bing/ResourceSet.class
Binary file not shown
BIN  build/classes/generated/bing/ResourceSets.class
Binary file not shown
BIN  build/classes/generated/bing/Resources.class
Binary file not shown
BIN  build/classes/generated/bing/Response.class
Binary file not shown
BIN  build/classes/generated/bing/package-info.class
Binary file not shown
BIN  build/classes/generated/dmv/ADDRESSRECORD.class
Binary file not shown
BIN  build/classes/generated/dmv/ADDRESSRECORDS.class
Binary file not shown
BIN  build/classes/generated/dmv/ADMINTRANSACTION.class
Binary file not shown
BIN  build/classes/generated/dmv/ADMINUSER.class
Binary file not shown
BIN  build/classes/generated/dmv/AmsValidateResponse.class
Binary file not shown
BIN  build/classes/generated/dmv/AmsValidateResult.class
Binary file not shown
BIN  build/classes/generated/dmv/BASEALTCODE.class
Binary file not shown
BIN  build/classes/generated/dmv/Body.class
Binary file not shown
BIN  build/classes/generated/dmv/Envelope.class
Binary file not shown
BIN  build/classes/generated/dmv/INPUT.class
Binary file not shown
BIN  build/classes/generated/dmv/MUNICIPALITY.class
Binary file not shown
BIN  build/classes/generated/dmv/OUTPUT.class
Binary file not shown
BIN  build/classes/generated/dmv/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/dmv/POSTDIR.class
Binary file not shown
BIN  build/classes/generated/dmv/PREDIR.class
Binary file not shown
BIN  build/classes/generated/dmv/SECCODE.class
Binary file not shown
BIN  build/classes/generated/dmv/SECHIGH.class
Binary file not shown
BIN  build/classes/generated/dmv/SECLOW.class
Binary file not shown
BIN  build/classes/generated/dmv/SECNAME.class
Binary file not shown
BIN  build/classes/generated/dmv/SECONDARYNUMBER.class
Binary file not shown
BIN  build/classes/generated/dmv/SECONDSTDDELIVADDR.class
Binary file not shown
BIN  build/classes/generated/dmv/STATEABBREV.class
Binary file not shown
BIN  build/classes/generated/dmv/STDCITYABBRV.class
Binary file not shown
BIN  build/classes/generated/dmv/STDFIRMNAME.class
Binary file not shown
BIN  build/classes/generated/dmv/SYSTEMMESSAGES.class
Binary file not shown
BIN  build/classes/generated/dmv/UNIT.class
Binary file not shown
BIN  build/classes/generated/dmv/UPDATEKEY.class
Binary file not shown
BIN  build/classes/generated/dmv/URBANIZATION.class
Binary file not shown
BIN  build/classes/generated/dmv/package-info.class
Binary file not shown
BIN  build/classes/generated/fcc/Block.class
Binary file not shown
BIN  build/classes/generated/fcc/County.class
Binary file not shown
BIN  build/classes/generated/fcc/Err.class
Binary file not shown
BIN  build/classes/generated/fcc/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/fcc/Response.class
Binary file not shown
BIN  build/classes/generated/fcc/State.class
Binary file not shown
BIN  build/classes/generated/fcc/package-info.class
Binary file not shown
BIN  build/classes/generated/geoserver/json/GeoFeatures.class
Binary file not shown
BIN  build/classes/generated/geoserver/json/GeoGeometry.class
Binary file not shown
BIN  build/classes/generated/geoserver/json/GeoProperty.class
Binary file not shown
BIN  build/classes/generated/geoserver/json/GeoResult.class
Binary file not shown
BIN  build/classes/generated/google/AddressComponent.class
Binary file not shown
BIN  build/classes/generated/google/Bounds.class
Binary file not shown
BIN  build/classes/generated/google/GeocodeResponse.class
Binary file not shown
BIN  build/classes/generated/google/Geometry.class
Binary file not shown
BIN  build/classes/generated/google/Location.class
Binary file not shown
BIN  build/classes/generated/google/Northeast.class
Binary file not shown
BIN  build/classes/generated/google/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/google/Result.class
Binary file not shown
BIN  build/classes/generated/google/Southwest.class
Binary file not shown
BIN  build/classes/generated/google/Viewport.class
Binary file not shown
BIN  build/classes/generated/usps/Address.class
Binary file not shown
BIN  build/classes/generated/usps/AddressValidateResponse.class
Binary file not shown
BIN  build/classes/generated/usps/CityStateLookupResponse.class
Binary file not shown
BIN  build/classes/generated/usps/Error.class
Binary file not shown
BIN  build/classes/generated/usps/HelpContext.class
Binary file not shown
BIN  build/classes/generated/usps/HelpFile.class
Binary file not shown
BIN  build/classes/generated/usps/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/usps/ZipCode.class
Binary file not shown
BIN  build/classes/generated/usps/ZipCodeLookupResponse.class
Binary file not shown
BIN  build/classes/generated/yahoo/Line3.class
Binary file not shown
BIN  build/classes/generated/yahoo/Name.class
Binary file not shown
BIN  build/classes/generated/yahoo/Neighborhood.class
Binary file not shown
BIN  build/classes/generated/yahoo/ObjectFactory.class
Binary file not shown
BIN  build/classes/generated/yahoo/Result.class
Binary file not shown
BIN  build/classes/generated/yahoo/ResultSet.class
Binary file not shown
BIN  build/classes/generated/yahoo/Unit.class
Binary file not shown
BIN  build/classes/generated/yahoo/Unittype.class
Binary file not shown
BIN  build/classes/generated/yahoo/Xstreet.class
Binary file not shown
BIN  build/classes/model/ApiUser.class
Binary file not shown
BIN  build/classes/model/ErrorResponse.class
Binary file not shown
BIN  build/classes/model/Ignore.class
Binary file not shown
BIN  build/classes/model/Metric.class
Binary file not shown
BIN  build/classes/model/ParseStream.class
Binary file not shown
BIN  build/classes/model/PersistentObject.class
Binary file not shown
BIN  build/classes/model/Point.class
Binary file not shown
BIN  build/classes/model/ValidateResponse.class
Binary file not shown
BIN  build/classes/model/abstracts/AbstractGeocoder.class
Binary file not shown
BIN  build/classes/model/abstracts/AbstractReverseGeocoder.class
Binary file not shown
BIN  build/classes/model/districts/Assembly.class
Binary file not shown
BIN  build/classes/model/districts/Census.class
Binary file not shown
BIN  build/classes/model/districts/Congressional.class
Binary file not shown
BIN  build/classes/model/districts/County.class
Binary file not shown
BIN  build/classes/model/districts/DistrictResponse.class
Binary file not shown
BIN  build/classes/model/districts/Election.class
Binary file not shown
BIN  build/classes/model/districts/Member.class
Binary file not shown
BIN  build/classes/model/districts/Senate.class
Binary file not shown
BIN  build/classes/model/districts/Senator.class
Binary file not shown
BIN  build/classes/scrapers/AssemblyScraper.class
Binary file not shown
BIN  build/classes/scrapers/CongressScraper.class
Binary file not shown
BIN  build/classes/scrapers/NYSenateScraper.class
Binary file not shown
BIN  build/classes/servlets/ApiServlet$ApiInputException.class
Binary file not shown
BIN  build/classes/servlets/ApiServlet.class
Binary file not shown
BIN  build/classes/servlets/SenateFilter.class
Binary file not shown
28 build/classes/update
@@ -0,0 +1,28 @@
+USE geoapi;
+
+drop table senate;
+drop table assembly;
+drop table congressional;
+
+CREATE TABLE senate (
+ district VARCHAR(50),
+ districturl VARCHAR(256),
+ name VARCHAR(256),
+ contact VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE assembly (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE congressional (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
199 schema/ams.xsd
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.nysdmv.com/DMVAMSWS/" xmlns:dmvamsws="http://www.nysdmv.com/DMVAMSWS/">
+ <xs:element name="AmsValidateResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:AmsValidateResult"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AmsValidateResult">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:ADMIN_USER"/>
+ <xs:element ref="dmvamsws:ADMIN_TRANSACTION"/>
+ <xs:element ref="dmvamsws:RETURN_CDE"/>
+ <xs:element ref="dmvamsws:SYSTEM_MESSAGES"/>
+ <xs:element ref="dmvamsws:INPUT"/>
+ <xs:element ref="dmvamsws:OUTPUT"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ADMIN_USER">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="ADMIN_TRANSACTION">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:DISPOSITION"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="DISPOSITION" type="xs:NCName"/>
+ <xs:element name="RETURN_CDE" type="xs:integer"/>
+ <xs:element name="SYSTEM_MESSAGES">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="dmvamsws:MESSAGE_TEXT1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="MESSAGE_TEXT1" type="xs:string"/>
+ <xs:element name="INPUT">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:ADDRESS"/>
+ <xs:element ref="dmvamsws:CITY"/>
+ <xs:element ref="dmvamsws:STATE"/>
+ <xs:element ref="dmvamsws:ZIP"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ADDRESS" type="xs:string"/>
+ <xs:element name="CITY" type="xs:string"/>
+ <xs:element name="STATE" type="xs:string"/>
+ <xs:element name="OUTPUT">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:sequence minOccurs="0">
+ <xs:element ref="dmvamsws:STD_DELIV_ADDR"/>
+ <xs:element ref="dmvamsws:SECOND_STD_DELIV_ADDR"/>
+ <xs:element ref="dmvamsws:STD_FIRM_NAME"/>
+ <xs:element ref="dmvamsws:STD_CSZ"/>
+ <xs:element ref="dmvamsws:MAIN_PO_CITY"/>
+ <xs:element ref="dmvamsws:MAIN_PO_STATE"/>
+ <xs:element ref="dmvamsws:STD_CITY"/>
+ <xs:element ref="dmvamsws:STD_CITY_ABBRV"/>
+ <xs:element ref="dmvamsws:STD_STATE"/>
+ <xs:element ref="dmvamsws:ZIP"/>
+ <xs:element ref="dmvamsws:ZIP_ADDON"/>
+ <xs:element ref="dmvamsws:DEL_POINT_CODE"/>
+ <xs:element ref="dmvamsws:CAR_ROUTE"/>
+ <xs:element ref="dmvamsws:FIPS_CODE"/>
+ </xs:sequence>
+ <xs:element ref="dmvamsws:NUMBER_RESPONSES"/>
+ <xs:sequence minOccurs="0">
+ <xs:element ref="dmvamsws:PRIMARY_NUMBER"/>
+ <xs:element ref="dmvamsws:SECONDARY_NUMBER"/>
+ <xs:element ref="dmvamsws:ADDRESS_RECORDS"/>
+ </xs:sequence>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="STD_DELIV_ADDR" type="xs:string"/>
+ <xs:element name="SECOND_STD_DELIV_ADDR">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="STD_FIRM_NAME">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="STD_CSZ" type="xs:string"/>
+ <xs:element name="MAIN_PO_CITY" type="xs:NCName"/>
+ <xs:element name="MAIN_PO_STATE" type="xs:NCName"/>
+ <xs:element name="STD_CITY" type="xs:NCName"/>
+ <xs:element name="STD_CITY_ABBRV">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="STD_STATE" type="xs:NCName"/>
+ <xs:element name="ZIP_ADDON" type="xs:integer"/>
+ <xs:element name="DEL_POINT_CODE" type="xs:integer"/>
+ <xs:element name="CAR_ROUTE" type="xs:NCName"/>
+ <xs:element name="FIPS_CODE" type="xs:integer"/>
+ <xs:element name="NUMBER_RESPONSES" type="xs:integer"/>
+ <xs:element name="PRIMARY_NUMBER" type="xs:integer"/>
+ <xs:element name="SECONDARY_NUMBER">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="ADDRESS_RECORDS">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:ADDRESS_RECORD"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ADDRESS_RECORD">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="dmvamsws:ZIP_CODE"/>
+ <xs:element ref="dmvamsws:UPDATE_KEY"/>
+ <xs:element ref="dmvamsws:ACTION_CODE"/>
+ <xs:element ref="dmvamsws:REC_TYPE"/>
+ <xs:element ref="dmvamsws:CARR_RT"/>
+ <xs:element ref="dmvamsws:PRE_DIR"/>
+ <xs:element ref="dmvamsws:STR_NAME"/>
+ <xs:element ref="dmvamsws:SUFFIX"/>
+ <xs:element ref="dmvamsws:POST_DIR"/>
+ <xs:element ref="dmvamsws:PRIM_LOW"/>
+ <xs:element ref="dmvamsws:PRIM_HIGH"/>
+ <xs:element ref="dmvamsws:PRIM_CODE"/>
+ <xs:element ref="dmvamsws:SEC_NAME"/>
+ <xs:element ref="dmvamsws:UNIT"/>
+ <xs:element ref="dmvamsws:SEC_LOW"/>
+ <xs:element ref="dmvamsws:SEC_HIGH"/>
+ <xs:element ref="dmvamsws:SEC_CODE"/>
+ <xs:element ref="dmvamsws:ADDON_LOW"/>
+ <xs:element ref="dmvamsws:ADDON_HIGH"/>
+ <xs:element ref="dmvamsws:BASE_ALT_CODE"/>
+ <xs:element ref="dmvamsws:FINANCE"/>
+ <xs:element ref="dmvamsws:STATE_ABBREV"/>
+ <xs:element ref="dmvamsws:COUNTY_NO"/>
+ <xs:element ref="dmvamsws:CONGRESS_DIST"/>
+ <xs:element ref="dmvamsws:MUNICIPALITY"/>
+ <xs:element ref="dmvamsws:URBANIZATION"/>
+ <xs:element ref="dmvamsws:LAST_LINE"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ZIP_CODE" type="xs:integer"/>
+ <xs:element name="UPDATE_KEY">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="ACTION_CODE" type="xs:NCName"/>
+ <xs:element name="REC_TYPE" type="xs:NCName"/>
+ <xs:element name="CARR_RT" type="xs:NCName"/>
+ <xs:element name="PRE_DIR">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="STR_NAME" type="xs:NCName"/>
+ <xs:element name="SUFFIX" type="xs:NCName"/>
+ <xs:element name="POST_DIR">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="PRIM_LOW" type="xs:integer"/>
+ <xs:element name="PRIM_HIGH" type="xs:integer"/>
+ <xs:element name="PRIM_CODE" type="xs:NCName"/>
+ <xs:element name="SEC_NAME">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="UNIT">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="SEC_LOW">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="SEC_HIGH">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="SEC_CODE">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="ADDON_LOW" type="xs:integer"/>
+ <xs:element name="ADDON_HIGH" type="xs:integer"/>
+ <xs:element name="BASE_ALT_CODE">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="FINANCE" type="xs:integer"/>
+ <xs:element name="STATE_ABBREV">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="COUNTY_NO" type="xs:integer"/>
+ <xs:element name="CONGRESS_DIST" type="xs:integer"/>
+ <xs:element name="MUNICIPALITY">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="URBANIZATION">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="LAST_LINE" type="xs:NCName"/>
+ <xs:element name="ZIP" type="xs:string"/>
+</xs:schema>
100 schema/bing.xsd
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/search/local/ws/rest/v1" xmlns:v1="http://schemas.microsoft.com/search/local/ws/rest/v1">
+ <xs:element name="Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:Copyright"/>
+ <xs:element ref="v1:BrandLogoUri"/>
+ <xs:element ref="v1:StatusCode"/>
+ <xs:element ref="v1:StatusDescription"/>
+ <xs:element ref="v1:AuthenticationResultCode"/>
+ <xs:element ref="v1:TraceId"/>
+ <xs:element ref="v1:ResourceSets"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Copyright" type="xs:string"/>
+ <xs:element name="BrandLogoUri" type="xs:anyURI"/>
+ <xs:element name="StatusCode" type="xs:integer"/>
+ <xs:element name="StatusDescription" type="xs:NCName"/>
+ <xs:element name="AuthenticationResultCode" type="xs:NCName"/>
+ <xs:element name="TraceId" type="xs:string"/>
+ <xs:element name="ResourceSets">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:ResourceSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ResourceSet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:EstimatedTotal"/>
+ <xs:element ref="v1:Resources"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="EstimatedTotal" type="xs:integer"/>
+ <xs:element name="Resources">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="v1:Location"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Location">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:Name"/>
+ <xs:element ref="v1:Point"/>
+ <xs:element ref="v1:BoundingBox"/>
+ <xs:element ref="v1:EntityType"/>
+ <xs:element ref="v1:Address"/>
+ <xs:element ref="v1:Confidence"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Name" type="xs:string"/>
+ <xs:element name="Point">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:Latitude"/>
+ <xs:element ref="v1:Longitude"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Latitude" type="xs:decimal"/>
+ <xs:element name="Longitude" type="xs:decimal"/>
+ <xs:element name="BoundingBox">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:SouthLatitude"/>
+ <xs:element ref="v1:WestLongitude"/>
+ <xs:element ref="v1:NorthLatitude"/>
+ <xs:element ref="v1:EastLongitude"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="SouthLatitude" type="xs:decimal"/>
+ <xs:element name="WestLongitude" type="xs:decimal"/>
+ <xs:element name="NorthLatitude" type="xs:decimal"/>
+ <xs:element name="EastLongitude" type="xs:decimal"/>
+ <xs:element name="EntityType" type="xs:NCName"/>
+ <xs:element name="Address">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="v1:AdminDistrict"/>
+ <xs:element ref="v1:AdminDistrict2"/>
+ <xs:element ref="v1:CountryRegion"/>
+ <xs:element ref="v1:FormattedAddress"/>
+ <xs:element ref="v1:Locality"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="AdminDistrict" type="xs:NCName"/>
+ <xs:element name="AdminDistrict2" type="xs:string"/>
+ <xs:element name="CountryRegion" type="xs:string"/>
+ <xs:element name="FormattedAddress" type="xs:string"/>
+ <xs:element name="Locality" type="xs:NCName"/>
+ <xs:element name="Confidence" type="xs:NCName"/>
+</xs:schema>
56 schema/database
@@ -0,0 +1,56 @@
+CREATE USER 'geoapi'@'localhost' IDENTIFIED BY 'ga2010';
+
+DROP DATABASE geoapi;
+
+CREATE DATABASE geoapi;
+
+GRANT ALL PRIVILEGES
+ON geoapi.*
+TO 'geoapi'@'localhost'
+WITH GRANT OPTION;
+
+GRANT ALL PRIVILEGES
+ON geoapi.*
+TO 'geoapi'@'%'
+WITH GRANT OPTION;
+
+USE geoapi;
+
+CREATE TABLE apiuser (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ apikey VARCHAR(256),
+ name VARCHAR(256),
+ description VARCHAR(1024),
+ UNIQUE (apikey)
+) ENGINE=INNODB;
+
+CREATE TABLE metric (
+ command VARCHAR(2056),
+ date VARCHAR(256),
+ host VARCHAR(256),
+ userid INT,
+ FOREIGN KEY (userid) references apiuser(id) ON DELETE CASCADE
+) ENGINE=INNODB;
+
+CREATE TABLE senate (
+ district VARCHAR(50),
+ districturl VARCHAR(256),
+ name VARCHAR(256),
+ contact VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE assembly (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
+
+CREATE TABLE congressional (
+ district VARCHAR(50),
+ name VARCHAR(256),
+ url VARCHAR(256),
+ PRIMARY KEY(district)
+) ENGINE=INNODB;
88 schema/googlemaps.xsd
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="GeocodeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="status"/>
+ <xs:element maxOccurs="unbounded" ref="result"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="status" type="xs:NCName"/>
+ <xs:element name="result">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="type"/>
+ <xs:element ref="formatted_address"/>
+ <xs:element maxOccurs="unbounded" ref="address_component"/>
+ <xs:element ref="geometry"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="formatted_address" type="xs:string"/>
+ <xs:element name="address_component">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="long_name"/>
+ <xs:element ref="short_name"/>
+ <xs:element maxOccurs="unbounded" ref="type"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="long_name" type="xs:string"/>
+ <xs:element name="short_name" type="xs:string"/>
+ <xs:element name="geometry">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="location"/>
+ <xs:element ref="location_type"/>
+ <xs:element ref="viewport"/>
+ <xs:element ref="bounds"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="location">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="lat"/>
+ <xs:element ref="lng"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="location_type" type="xs:NCName"/>
+ <xs:element name="viewport">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="southwest"/>
+ <xs:element ref="northeast"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="bounds">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="southwest"/>
+ <xs:element ref="northeast"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="type" type="xs:NCName"/>
+ <xs:element name="lat" type="xs:decimal"/>
+ <xs:element name="lng" type="xs:decimal"/>
+ <xs:element name="southwest">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="lat"/>
+ <xs:element ref="lng"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="northeast">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="lat"/>
+ <xs:element ref="lng"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
44 schema/usps.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="AddressValidateResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Address"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Address">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Address2"/>
+ <xs:element ref="City"/>
+ <xs:element ref="State"/>
+ <xs:element ref="Zip5"/>
+ <xs:element ref="Zip4"/>
+ </xs:sequence>
+ <xs:attribute name="ID" use="required" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Address2" type="xs:string"/>
+ <xs:element name="Zip4" type="xs:integer"/>
+ <xs:element name="CityStateLookupResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="ZipCode"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="ZipCode">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Zip5"/>
+ <xs:element ref="City"/>
+ <xs:element ref="State"/>
+ </xs:sequence>
+ <xs:attribute name="ID" use="required" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Zip5" type="xs:integer"/>
+ <xs:element name="City" type="xs:string"/>
+ <xs:element name="State" type="xs:NCName"/>
+</xs:schema>
123 src/connectors/BingConnect.java
@@ -0,0 +1,123 @@
+package connectors;
+
+import generated.bing.Location;
+import generated.bing.Response;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import control.Resource;
+import model.ParseStream;
+import model.Point;
+import model.abstracts.AbstractGeocoder;
+import model.abstracts.AbstractReverseGeocoder;
+
+/**
+ * @author Jared Williams
+ *
+ * used to connect to Bing maps API to geocode and reverse geocode, models for
+ * response are located in package "generated.bing"
+ */
+public class BingConnect extends ParseStream implements AbstractGeocoder,AbstractReverseGeocoder {
+ private final String BING_API = "http://dev.virtualearth.net/REST/v1/Locations/";
+ private final String BING_KEY = "?o=xml&key=";
+ private final String BING_API_END = "bing.key";
+ private final String BING_CS = "US/NY/";
+ static String PACKAGE = "generated.bing";
+
+ public BingConnect() {
+ super(PACKAGE);
+ }
+
+ /**
+ * Used for geocoding, handles generated JAXB content and returns point
+ * with necessary data
+ *
+ * @param address is the address being searched
+ * @return point with lat, lon and address
+ */
+ public Point doParsing(String address) {
+ Response r = null;
+
+ try {
+ r = (Response)parseStream(new URL(constructUrl(address)));
+
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+ Location l = r.getResourceSets().getResourceSet().getResources().getLocation().iterator().next();
+
+ return new Point(l.getPoint().getLatitude(),
+ l.getPoint().getLongitude(),
+ l.getAddress().getFormattedAddress());
+ }
+
+ /**
+ * Used for reverse geocoding, handles generated JAXB content and returns point
+ * with necessary data
+ *
+ * @param address is the address being searched
+ * @return point with lat, lon and address
+ */
+ public List<Point> doReverseParsing(String latlng) {
+ List<Point> points = new ArrayList<Point>();
+
+ Response r = null;
+
+ try {
+ r = (Response)parseStream(new URL(constructReverseUrl(latlng)));
+
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+
+ for(Location l:r.getResourceSets().getResourceSet().getResources().getLocation()) {
+ points.add(new Point(l.getPoint().getLatitude(),
+ l.getPoint().getLongitude(),
+ l.getAddress().getFormattedAddress()));
+
+ }
+ return points;
+ }
+
+ /**
+ * constructs the restful url that will make the api call
+ *
+ * @param address is the address being searched
+ * @returns a string containing the formatted url
+ */
+ public String constructUrl(String address) {
+ String[] strings = address.split(",");
+
+ if(strings.length != 3) {
+ return null;
+ }
+ return (BING_API
+ + BING_CS
+ + strings[2].replaceAll("[a-zA-Z]","").trim()
+ + "/" + strings[1].trim()
+ + "/" + strings[0].trim()
+ + BING_KEY
+ + Resource.get(BING_API_END)).replaceAll(" ","%20");
+ }
+
+ /**