├── .gitignore ├── CoreParse ├── .gitignore ├── CompanionGuides │ └── CoreParse-template.md ├── CoreParse.xcodeproj │ └── project.pbxproj ├── CoreParse │ ├── Built In Parsers │ │ ├── CPJSONParser.h │ │ └── CPJSONParser.m │ ├── CPSenTestKitAssertions.h │ ├── CoreParse-Info.plist │ ├── CoreParse-Prefix.pch │ ├── CoreParse.h │ ├── Grammar │ │ ├── CPGrammar.h │ │ ├── CPGrammar.m │ │ ├── CPGrammarInternal.h │ │ ├── CPGrammarInternal.m │ │ ├── CPGrammarPrivate.h │ │ ├── CPGrammarPrivate.m │ │ ├── CPGrammarSymbol.h │ │ ├── CPGrammarSymbol.m │ │ ├── CPRHSItem+Private.h │ │ ├── CPRHSItem.h │ │ ├── CPRHSItem.m │ │ ├── CPRHSItemResult.h │ │ ├── CPRHSItemResult.m │ │ ├── CPRule+Internal.h │ │ ├── CPRule.h │ │ └── CPRule.m │ ├── NSArray+Functional.h │ ├── NSArray+Functional.m │ ├── NSSetFunctional.h │ ├── NSSetFunctional.m │ ├── Parsers │ │ ├── CPParser.h │ │ ├── CPParser.m │ │ ├── CPShiftReduceParser.h │ │ ├── CPShiftReduceParser.m │ │ ├── CPShiftReduceParsers │ │ │ ├── CPItem.h │ │ │ ├── CPItem.m │ │ │ ├── CPLALR1Parser.h │ │ │ ├── CPLALR1Parser.m │ │ │ ├── CPLR1Item.h │ │ │ ├── CPLR1Item.m │ │ │ ├── CPLR1Parser.h │ │ │ ├── CPLR1Parser.m │ │ │ ├── CPSLRParser.h │ │ │ ├── CPSLRParser.m │ │ │ ├── CPShiftAction.h │ │ │ ├── CPShiftAction.m │ │ │ ├── CPShiftReduceAction.h │ │ │ ├── CPShiftReduceAction.m │ │ │ ├── CPShiftReduceActionTable.h │ │ │ ├── CPShiftReduceActionTable.m │ │ │ ├── CPShiftReduceGotoTable.h │ │ │ ├── CPShiftReduceGotoTable.m │ │ │ ├── CPShiftReduceParserProtectedMethods.h │ │ │ ├── CPShiftReduceState.h │ │ │ └── CPShiftReduceState.m │ │ └── Error Recovery │ │ │ ├── CPRecoveryAction.h │ │ │ └── CPRecoveryAction.m │ ├── Syntax Tree │ │ ├── CPSyntaxTree.h │ │ └── CPSyntaxTree.m │ ├── Tokenisation │ │ ├── CPTokenStream.h │ │ ├── CPTokenStream.m │ │ ├── CPTokeniser.h │ │ ├── CPTokeniser.m │ │ ├── Token Recognisers │ │ │ ├── CPIdentifierRecogniser.h │ │ │ ├── CPIdentifierRecogniser.m │ │ │ ├── CPKeywordRecogniser.h │ │ │ ├── CPKeywordRecogniser.m │ │ │ ├── CPNumberRecogniser.h │ │ │ ├── CPNumberRecogniser.m │ │ │ ├── CPQuotedRecogniser.h │ │ │ ├── CPQuotedRecogniser.m │ │ │ ├── CPRegexpRecogniser.h │ │ │ ├── CPRegexpRecogniser.m │ │ │ ├── CPTokenRecogniser.h │ │ │ ├── CPWhiteSpaceRecogniser.h │ │ │ └── CPWhiteSpaceRecogniser.m │ │ └── Token Types │ │ │ ├── CPEOFToken.h │ │ │ ├── CPEOFToken.m │ │ │ ├── CPErrorToken.h │ │ │ ├── CPErrorToken.m │ │ │ ├── CPIdentifierToken.h │ │ │ ├── CPIdentifierToken.m │ │ │ ├── CPKeywordToken.h │ │ │ ├── CPKeywordToken.m │ │ │ ├── CPNumberToken.h │ │ │ ├── CPNumberToken.m │ │ │ ├── CPQuotedToken.h │ │ │ ├── CPQuotedToken.m │ │ │ ├── CPToken.h │ │ │ ├── CPToken.m │ │ │ ├── CPWhiteSpaceToken.h │ │ │ └── CPWhiteSpaceToken.m │ └── en.lproj │ │ └── InfoPlist.strings ├── CoreParseTests │ ├── CPRegexpRecogniserTest.m │ ├── CPSTAssertionsTests.h │ ├── CPSTAssertionsTests.m │ ├── CPTestErrorEvaluatorDelegate.h │ ├── CPTestErrorEvaluatorDelegate.m │ ├── CPTestErrorHandlingDelegate.h │ ├── CPTestErrorHandlingDelegate.m │ ├── CPTestEvaluatorDelegate.h │ ├── CPTestEvaluatorDelegate.m │ ├── CPTestMapCSSTokenisingDelegate.h │ ├── CPTestMapCSSTokenisingDelegate.m │ ├── CPTestWhiteSpaceIgnoringDelegate.h │ ├── CPTestWhiteSpaceIgnoringDelegate.m │ ├── CPWillFinishDelegateTest.m │ ├── CoreParseTests-Info.plist │ ├── CoreParseTests-Prefix.pch │ ├── CoreParseTests.h │ ├── CoreParseTests.m │ ├── Expression.h │ ├── Expression.m │ ├── Expression2.h │ ├── Expression2.m │ ├── RuleBase.h │ ├── RuleBase.m │ ├── Term.h │ ├── Term.m │ ├── Term2.h │ ├── Term2.m │ └── en.lproj │ │ └── InfoPlist.strings ├── LICENSE └── README.md ├── MapView ├── Canonical.framework.tar ├── DesktopMapView-Info.plist ├── GTM │ ├── GTMCALayer+UnitTesting.h │ ├── GTMCALayer+UnitTesting.m │ ├── GTMDefines.h │ ├── GTMGarbageCollection.h │ ├── GTMIPhoneUnitTestDelegate.h │ ├── GTMIPhoneUnitTestDelegate.m │ ├── GTMIPhoneUnitTestMain.m │ ├── GTMNSNumber+64Bit.h │ ├── GTMNSNumber+64Bit.m │ ├── GTMNSObject+UnitTesting.h │ ├── GTMNSObject+UnitTesting.m │ ├── GTMObjC2Runtime.h │ ├── GTMObjC2Runtime.m │ ├── GTMSenTestCase.h │ ├── GTMSenTestCase.m │ ├── GTMSystemVersion.h │ ├── GTMSystemVersion.m │ ├── GTMUIKit+UnitTesting.h │ ├── GTMUIKit+UnitTesting.m │ └── RunIPhoneUnitTest.sh ├── Info.plist ├── Map │ ├── Cache.xcdatamodel │ │ ├── elements │ │ └── layout │ ├── FMDB │ │ ├── FMDatabase.h │ │ ├── FMDatabase.m │ │ ├── FMDatabaseAdditions.h │ │ ├── FMDatabaseAdditions.m │ │ ├── FMResultSet.h │ │ ├── FMResultSet.m │ │ ├── README.txt │ │ └── fmdb.m │ ├── NSUserDefaults+RouteMe.h │ ├── NSUserDefaults+RouteMe.m │ ├── README.txt │ ├── RMAbstractMercatorWebSource.h │ ├── RMAbstractMercatorWebSource.m │ ├── RMCachedTileSource.h │ ├── RMCachedTileSource.m │ ├── RMCircle.h │ ├── RMCircle.m │ ├── RMCloudMadeMapSource.h │ ├── RMCloudMadeMapSource.m │ ├── RMConfiguration.h │ ├── RMConfiguration.m │ ├── RMCoreAnimationRenderer.h │ ├── RMCoreAnimationRenderer.m │ ├── RMDBMapSource.h │ ├── RMDBMapSource.m │ ├── RMDBTileImage.h │ ├── RMDBTileImage.m │ ├── RMDatabaseCache.h │ ├── RMDatabaseCache.m │ ├── RMDefaultImages.h │ ├── RMDefaultImages.m │ ├── RMFileTileImage.h │ ├── RMFileTileImage.m │ ├── RMFoundation.c │ ├── RMFoundation.h │ ├── RMFractalTileProjection.h │ ├── RMFractalTileProjection.m │ ├── RMGeoHash.h │ ├── RMGeoHash.m │ ├── RMGlobalConstants.h │ ├── RMLatLong.h │ ├── RMLayerCollection.h │ ├── RMLayerCollection.m │ ├── RMMBTilesTileSource.h │ ├── RMMBTilesTileSource.m │ ├── RMMapContents.h │ ├── RMMapContents.m │ ├── RMMapLayer.h │ ├── RMMapLayer.m │ ├── RMMapQuestOSMSource.h │ ├── RMMapQuestOSMSource.m │ ├── RMMapRenderer.h │ ├── RMMapRenderer.m │ ├── RMMapView.h │ ├── RMMapView.m │ ├── RMMapViewDelegate.h │ ├── RMMarker.h │ ├── RMMarker.m │ ├── RMMarkerManager.h │ ├── RMMarkerManager.m │ ├── RMMemoryCache.h │ ├── RMMemoryCache.m │ ├── RMMercatorToScreenProjection.h │ ├── RMMercatorToScreenProjection.m │ ├── RMMercatorToTileProjection.h │ ├── RMNotifications.h │ ├── RMOSPTileSource.h │ ├── RMOSPTileSource.m │ ├── RMOSPTileSourceManager.h │ ├── RMOSPTileSourceManager.m │ ├── RMOpenAerialMapSource.h │ ├── RMOpenAerialMapSource.m │ ├── RMOpenCycleMapSource.h │ ├── RMOpenCycleMapSource.m │ ├── RMOpenStreetMapSource.h │ ├── RMOpenStreetMapSource.m │ ├── RMPath.h │ ├── RMPath.m │ ├── RMPixel.c │ ├── RMPixel.h │ ├── RMProjection.h │ ├── RMProjection.m │ ├── RMSpatialCloudMapSource.h │ ├── RMSpatialCloudMapSource.m │ ├── RMTile.c │ ├── RMTile.h │ ├── RMTileCache.h │ ├── RMTileCache.m │ ├── RMTileCacheDAO.h │ ├── RMTileCacheDAO.m │ ├── RMTileImage.h │ ├── RMTileImage.m │ ├── RMTileImageSet.h │ ├── RMTileImageSet.m │ ├── RMTileLoader.h │ ├── RMTileLoader.m │ ├── RMTileMapServiceSource.h │ ├── RMTileMapServiceSource.m │ ├── RMTileProxy.h │ ├── RMTileProxy.m │ ├── RMTileSource.h │ ├── RMTiledLayerController.h │ ├── RMTiledLayerController.m │ ├── RMTilesUpdateDelegate.h │ ├── RMTransform.h │ ├── RMTransform.m │ ├── RMVirtualEarthSource.h │ ├── RMVirtualEarthSource.m │ ├── RMWMS.h │ ├── RMWMS.m │ ├── RMWMSSource.h │ ├── RMWMSSource.m │ ├── RMWebTileImage.h │ ├── RMWebTileImage.m │ ├── RMYahooMapSource.h │ ├── RMYahooMapSource.m │ ├── Resources │ │ ├── UserLocationMarker.svg │ │ ├── loading.png │ │ ├── marker-blue-withletter.png │ │ ├── marker-blue.png │ │ ├── marker-red-withletter.png │ │ └── marker-red.png │ ├── RouteMe.h │ └── marker-X.png ├── MapView.xcodeproj │ └── project.pbxproj ├── MapViewTests │ ├── MapViewTests-Info.plist │ ├── MapViewTests-Prefix.pch │ └── en.lproj │ │ └── InfoPlist.strings ├── MapView_Prefix.pch ├── README-static-library-build.rtf ├── RM Unit Tests-Info.plist ├── RMFoundationTests.h ├── RMFoundationTests.m ├── UnitTesting │ ├── RouteMeTests.h │ └── RouteMeTests.m └── routeme.doxygen ├── MapsforgeReader ├── MapsforgeReader.xcodeproj │ └── project.pbxproj └── MapsforgeReader │ ├── MapsforgeReader-Prefix.pch │ ├── MapsforgeReader.h │ ├── MapsforgeReader.m │ ├── _java │ ├── core │ │ ├── BoundingBox.java │ │ ├── GeoPoint.java │ │ ├── IOUtils.java │ │ ├── LRUCache.java │ │ ├── MapPosition.java │ │ ├── MercatorProjection.java │ │ ├── Tag.java │ │ └── Tile.java │ └── map │ │ └── reader │ │ ├── Deserializer.java │ │ ├── IndexCache.java │ │ ├── IndexCacheEntryKey.java │ │ ├── MapDatabase.java │ │ ├── MapDatabaseCallback.java │ │ ├── QueryCalculations.java │ │ ├── QueryParameters.java │ │ ├── ReadBuffer.java │ │ └── header │ │ ├── FileOpenResult.java │ │ ├── MapFileHeader.java │ │ ├── MapFileInfo.java │ │ ├── MapFileInfoBuilder.java │ │ ├── OptionalFields.java │ │ ├── RequiredFields.java │ │ ├── SubFileParameter.java │ │ └── SubFileParameterBuilder.java │ ├── core │ ├── BoundingBox.h │ ├── BoundingBox.m │ ├── GeoPoint.h │ ├── GeoPoint.m │ ├── IOUtils.h │ ├── IOUtils.m │ ├── LRUCache.h │ ├── LRUCache.m │ ├── MFTag.h │ ├── MFTag.m │ ├── MapPosition.h │ ├── MapPosition.m │ ├── MercatorProjection.h │ ├── MercatorProjection.m │ ├── Tile.h │ └── Tile.m │ └── map │ └── reader │ ├── Deserializer.h │ ├── Deserializer.m │ ├── IndexCache.h │ ├── IndexCache.m │ ├── IndexCacheEntryKey.h │ ├── IndexCacheEntryKey.m │ ├── MapDatabase.h │ ├── MapDatabase.m │ ├── MapDatabaseCallback.h │ ├── QueryCalculations.h │ ├── QueryCalculations.m │ ├── QueryParameters.h │ ├── QueryParameters.m │ ├── ReadBuffer.h │ ├── ReadBuffer.m │ └── header │ ├── FileOpenResult.h │ ├── FileOpenResult.m │ ├── MapFileHeader.h │ ├── MapFileHeader.m │ ├── MapFileInfo.h │ ├── MapFileInfo.m │ ├── MapFileInfoBuilder.h │ ├── MapFileInfoBuilder.m │ ├── OptionalFields.h │ ├── OptionalFields.m │ ├── RequiredFields.h │ ├── RequiredFields.m │ ├── SubFileParameter.h │ ├── SubFileParameter.m │ ├── SubFileParameterBuilder.h │ └── SubFileParameterBuilder.m ├── OpenStreetPad ├── OSP │ └── OSP-Prefix.pch ├── OSPParserGenerator │ ├── OSPParserGenerator-Prefix.pch │ ├── OSPParserGenerator.1 │ └── main.m ├── OpenStreetPad.xcodeproj │ └── project.pbxproj └── OpenStreetPad │ ├── DataSources │ ├── Fileformat.pb.h │ ├── Fileformat.pb.m │ ├── NSString+XMLEscaping.h │ ├── NSString+XMLEscaping.m │ ├── OSPDataSource.h │ ├── OSPDataSource.m │ ├── OSPDataStore.h │ ├── OSPMapServer.h │ ├── OSPMapServer.m │ ├── OSPOSMFile.h │ ├── OSPOSMFile.m │ ├── OSPOSMParser.h │ ├── OSPOSMParser.m │ ├── OSPOSMWriter.h │ ├── OSPOSMWriter.m │ ├── OSPPBFFile.h │ ├── OSPPBFFile.m │ ├── OSPXMLWriter.h │ ├── OSPXMLWriter.m │ ├── Osmformat.pb.h │ └── Osmformat.pb.m │ ├── Model │ ├── API │ │ ├── OSPAPIObject.h │ │ ├── OSPAPIObject.m │ │ ├── OSPAPIObjectReference.h │ │ ├── OSPAPIObjectReference.m │ │ ├── OSPMember.h │ │ ├── OSPMember.m │ │ ├── OSPNode.h │ │ ├── OSPNode.m │ │ ├── OSPRelation.h │ │ ├── OSPRelation.m │ │ ├── OSPWay.h │ │ └── OSPWay.m │ ├── MapCSS │ │ ├── NSString+OpenStreetPad.h │ │ ├── NSString+OpenStreetPad.m │ │ ├── OSPMapCSSBinaryTest.h │ │ ├── OSPMapCSSBinaryTest.m │ │ ├── OSPMapCSSClass.h │ │ ├── OSPMapCSSClass.m │ │ ├── OSPMapCSSColour.h │ │ ├── OSPMapCSSColour.m │ │ ├── OSPMapCSSColourSpecifier.h │ │ ├── OSPMapCSSColourSpecifier.m │ │ ├── OSPMapCSSCommaSelector.h │ │ ├── OSPMapCSSCommaSelector.m │ │ ├── OSPMapCSSCommaSize.h │ │ ├── OSPMapCSSCommaSize.m │ │ ├── OSPMapCSSCommaSpecifier.h │ │ ├── OSPMapCSSCommaSpecifier.m │ │ ├── OSPMapCSSDeclaration.h │ │ ├── OSPMapCSSDeclaration.m │ │ ├── OSPMapCSSEval.h │ │ ├── OSPMapCSSEval.m │ │ ├── OSPMapCSSEvalSpecifier.h │ │ ├── OSPMapCSSEvalSpecifier.m │ │ ├── OSPMapCSSImport.h │ │ ├── OSPMapCSSImport.m │ │ ├── OSPMapCSSKey.h │ │ ├── OSPMapCSSKey.m │ │ ├── OSPMapCSSNamed.h │ │ ├── OSPMapCSSNamed.m │ │ ├── OSPMapCSSNamedSpecifier.h │ │ ├── OSPMapCSSNamedSpecifier.m │ │ ├── OSPMapCSSObject.h │ │ ├── OSPMapCSSObject.m │ │ ├── OSPMapCSSPlaceholderSpecifier.h │ │ ├── OSPMapCSSPlaceholderSpecifier.m │ │ ├── OSPMapCSSPlaceholderTest.h │ │ ├── OSPMapCSSPlaceholderTest.m │ │ ├── OSPMapCSSRule.h │ │ ├── OSPMapCSSRule.m │ │ ├── OSPMapCSSRuleset.h │ │ ├── OSPMapCSSRuleset.m │ │ ├── OSPMapCSSSelector.h │ │ ├── OSPMapCSSSelector.m │ │ ├── OSPMapCSSSize.h │ │ ├── OSPMapCSSSize.m │ │ ├── OSPMapCSSSizeSpecifier.h │ │ ├── OSPMapCSSSizeSpecifier.m │ │ ├── OSPMapCSSSpecifier.h │ │ ├── OSPMapCSSSpecifier.m │ │ ├── OSPMapCSSSpecifierList.h │ │ ├── OSPMapCSSSpecifierList.m │ │ ├── OSPMapCSSStyle.h │ │ ├── OSPMapCSSStyle.m │ │ ├── OSPMapCSSStyleSheet.h │ │ ├── OSPMapCSSStyleSheet.m │ │ ├── OSPMapCSSStyledObject.h │ │ ├── OSPMapCSSStyledObject.m │ │ ├── OSPMapCSSSubselector.h │ │ ├── OSPMapCSSSubselector.m │ │ ├── OSPMapCSSTag.h │ │ ├── OSPMapCSSTag.m │ │ ├── OSPMapCSSTagSpec.h │ │ ├── OSPMapCSSTagSpec.m │ │ ├── OSPMapCSSTagSpecifier.h │ │ ├── OSPMapCSSTagSpecifier.m │ │ ├── OSPMapCSSTest.h │ │ ├── OSPMapCSSTest.m │ │ ├── OSPMapCSSURLSpecifier.h │ │ ├── OSPMapCSSURLSpecifier.m │ │ ├── OSPMapCSSUnaryTest.h │ │ ├── OSPMapCSSUnaryTest.m │ │ ├── OSPMapCSSUrl.h │ │ ├── OSPMapCSSUrl.m │ │ ├── OSPMapCSSZoom.h │ │ └── OSPMapCSSZoom.m │ ├── OSPCoordinateRect.h │ ├── OSPCoordinateRect.m │ ├── OSPMap.h │ ├── OSPMap.m │ ├── OSPMapArea.h │ ├── OSPMapArea.m │ ├── OSPMaths.h │ ├── OSPMaths.m │ ├── OSPNonRectangularArea.h │ ├── OSPNonRectangularArea.m │ ├── OSPQuadTree.h │ ├── OSPQuadTree.m │ ├── OSPTileArray.h │ ├── OSPTileArray.m │ ├── OSPValue.h │ └── OSPValue.m │ ├── OSPAppDelegate.h │ ├── OSPAppDelegate.m │ ├── OSPMAPFile.h │ ├── OSPMAPFile.m │ ├── OSPMainViewController.h │ ├── OSPMainViewController.m │ ├── OSPMapCSSHashColourRecogniser.h │ ├── OSPMapCSSHashColourRecogniser.m │ ├── OSPMapCSSHashColourToken.h │ ├── OSPMapCSSHashColourToken.m │ ├── OSPMapCSSParser.h │ ├── OSPMapCSSParser.m │ ├── OSPMapLoader.h │ ├── OSPMapLoader.m │ ├── OSPMapView.h │ ├── OSPMapView.m │ ├── OSPMetaTileView.h │ ├── OSPMetaTileView.m │ ├── OSPRenderer.h │ ├── OSPRenderer.m │ ├── OSPRendererGL.h │ ├── OSPRendererGL.m │ ├── OSPTagDictionary.h │ ├── OSPTagDictionary.m │ ├── OpenStreetPad-Info.plist │ ├── OpenStreetPad-Prefix.pch │ ├── TestData.xml │ ├── Texture2D.h │ ├── Texture2D.m │ ├── UIColor+CSS.h │ ├── UIColor+CSS.m │ ├── en.lproj │ ├── InfoPlist.strings │ └── OSPMainViewController.xib │ ├── fills │ ├── forest.png │ ├── graveyard.png │ ├── jam.png │ └── military.png │ ├── highways.mcs │ ├── icons │ ├── atm.png │ └── parking.png │ ├── landuse.mcs │ ├── main.m │ ├── osm.mcs │ └── parser.osp ├── Proj4 ├── Makefile ├── Makefile.am ├── Makefile.in ├── PJ_aea.c ├── PJ_aeqd.c ├── PJ_airy.c ├── PJ_aitoff.c ├── PJ_august.c ├── PJ_bacon.c ├── PJ_bipc.c ├── PJ_boggs.c ├── PJ_bonne.c ├── PJ_cass.c ├── PJ_cc.c ├── PJ_cea.c ├── PJ_chamb.c ├── PJ_collg.c ├── PJ_crast.c ├── PJ_denoy.c ├── PJ_eck1.c ├── PJ_eck2.c ├── PJ_eck3.c ├── PJ_eck4.c ├── PJ_eck5.c ├── PJ_eqc.c ├── PJ_eqdc.c ├── PJ_fahey.c ├── PJ_fouc_s.c ├── PJ_gall.c ├── PJ_geos.c ├── PJ_gins8.c ├── PJ_gn_sinu.c ├── PJ_gnom.c ├── PJ_goode.c ├── PJ_hammer.c ├── PJ_hatano.c ├── PJ_imw_p.c ├── PJ_krovak.c ├── PJ_labrd.c ├── PJ_laea.c ├── PJ_lagrng.c ├── PJ_larr.c ├── PJ_lask.c ├── PJ_lcc.c ├── PJ_lcca.c ├── PJ_loxim.c ├── PJ_lsat.c ├── PJ_mbt_fps.c ├── PJ_mbtfpp.c ├── PJ_mbtfpq.c ├── PJ_merc.c ├── PJ_mill.c ├── PJ_mod_ster.c ├── PJ_moll.c ├── PJ_nell.c ├── PJ_nell_h.c ├── PJ_nocol.c ├── PJ_nsper.c ├── PJ_nzmg.c ├── PJ_ob_tran.c ├── PJ_ocea.c ├── PJ_oea.c ├── PJ_omerc.c ├── PJ_ortho.c ├── PJ_poly.c ├── PJ_putp2.c ├── PJ_putp3.c ├── PJ_putp4p.c ├── PJ_putp5.c ├── PJ_putp6.c ├── PJ_robin.c ├── PJ_rpoly.c ├── PJ_sconics.c ├── PJ_somerc.c ├── PJ_stere.c ├── PJ_sterea.c ├── PJ_sts.c ├── PJ_tcc.c ├── PJ_tcea.c ├── PJ_tmerc.c ├── PJ_tpeqd.c ├── PJ_urm5.c ├── PJ_urmfps.c ├── PJ_vandg.c ├── PJ_vandg2.c ├── PJ_vandg4.c ├── PJ_wag2.c ├── PJ_wag3.c ├── PJ_wag7.c ├── PJ_wink1.c ├── PJ_wink2.c ├── Proj4.xcodeproj │ ├── TemplateIcon.icns │ └── project.pbxproj ├── Proj4_Prefix.pch ├── aasincos.c ├── adjlon.c ├── bch2bps.c ├── bchgen.c ├── biveval.c ├── cs2cs.c ├── dmstor.c ├── emess.c ├── emess.h ├── gen_cheb.c ├── geocent.c ├── geocent.h ├── geod.c ├── geod_for.c ├── geod_inv.c ├── geod_set.c ├── geodesic.h ├── jniproj.c ├── mk_cheby.c ├── nad2bin.c ├── nad2nad.c ├── nad_cvt.c ├── nad_init.c ├── nad_intr.c ├── nad_list.h ├── org_proj4_Projections.h ├── p_series.c ├── pj_apply_gridshift.c ├── pj_auth.c ├── pj_datum_set.c ├── pj_datums.c ├── pj_deriv.c ├── pj_ell_set.c ├── pj_ellps.c ├── pj_errno.c ├── pj_factors.c ├── pj_fwd.c ├── pj_gauss.c ├── pj_geocent.c ├── pj_gridinfo.c ├── pj_gridlist.c ├── pj_init.c ├── pj_inv.c ├── pj_latlong.c ├── pj_list.c ├── pj_list.h ├── pj_malloc.c ├── pj_mlfn.c ├── pj_msfn.c ├── pj_open_lib.c ├── pj_param.c ├── pj_phi2.c ├── pj_pr_list.c ├── pj_qsfn.c ├── pj_release.c ├── pj_strerrno.c ├── pj_transform.c ├── pj_tsfn.c ├── pj_units.c ├── pj_utils.c ├── pj_zpoly1.c ├── proj.c ├── proj.def ├── proj_api.h ├── proj_config.h ├── proj_config.h.in ├── proj_mdist.c ├── proj_rouss.c ├── projects.h ├── rtodms.c └── vector1.c ├── README.md ├── VectorMapTest.xcodeproj └── project.pbxproj ├── VectorMapTest ├── Classes │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── ViewController.h │ ├── ViewController.m │ └── ViewController.xib ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── 675098-1.png │ │ ├── 675098.png │ │ ├── Contents.json │ │ ├── icon1-1.png │ │ ├── icon1.png │ │ ├── icon2-1.png │ │ ├── icon2-2.png │ │ └── icon2.png │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── Default.png │ │ ├── Default1-1.png │ │ ├── Default1-2.png │ │ ├── Default1-3.png │ │ ├── Default1-4.png │ │ ├── Default2-1.png │ │ ├── Default2-2.png │ │ └── Default2.png ├── Resources │ ├── iceland.map │ ├── moscow.map │ └── rules │ │ ├── fills │ │ ├── forest.png │ │ ├── graveyard.png │ │ ├── jam.png │ │ └── military.png │ │ ├── highways.mcs │ │ ├── icons │ │ ├── atm.png │ │ └── parking.png │ │ ├── landuse.mcs │ │ ├── osm.mcs │ │ └── parser.osp └── SupportingFiles │ ├── VectorMapTest-Info.plist │ ├── VectorMapTest-Prefix.pch │ ├── en.lproj │ └── InfoPlist.strings │ └── main.m ├── fmdb ├── FMDatabase.h ├── FMDatabase.m ├── FMDatabaseAdditions.h ├── FMDatabaseAdditions.m ├── FMResultSet.h └── FMResultSet.m └── sqlite-amalgamation-3_7_3 ├── shell.c ├── sqlite3.c ├── sqlite3.h └── sqlite3ext.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | <<<<<<< HEAD 19 | .idea/ 20 | ======= 21 | .idea/ 22 | >>>>>>> 57b031e46fe74e090a16e947aed82a90a05969b3 23 | -------------------------------------------------------------------------------- /CoreParse/.gitignore: -------------------------------------------------------------------------------- 1 | /.DS_Store 2 | 3 | /CoreParse.xcodeproj/xcuserdata/ 4 | 5 | /CoreParse.xcodeproj/project.xcworkspace/xcuserdata/ 6 | -------------------------------------------------------------------------------- /CoreParse/CompanionGuides/CoreParse-template.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/CoreParse/CompanionGuides/CoreParse-template.md -------------------------------------------------------------------------------- /CoreParse/CoreParse/Built In Parsers/CPJSONParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPJSONParser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 29/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * The CPJSONParser class is a demonstration of CoreParse. 13 | * 14 | * The parser deals with all JSON except for unicode encoded characters. The reason for not dealing with this corner case is that this parser is simply to demonstrate how to use CoreParse, and 15 | * the code needed to process unicode characters is non-trivial, and not particularly relevant to the demonstration. 16 | */ 17 | @interface CPJSONParser : NSObject 18 | 19 | /** 20 | * Parses a JSON string and returns a standard objective-c data structure reflecting it: 21 | * 22 | * JSON numbers and booleans are returned as NSNumbers; JSON strings as NSStrings; `null` as an NSNull object; JSON arrays are returned as NSArrays; finally JSON objects are returned as NSDictionarys. 23 | * 24 | * @param json The JSON string to parse. 25 | */ 26 | - (id)parse:(NSString *)json; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/CoreParse-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.inthebeginninggames.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSHumanReadableCopyright 26 | Copyright © 2011 In The Beginning... All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/CoreParse-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CoreParse' target in the 'CoreParse' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/CoreParse.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreParse.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 10/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPTokeniser.h" 10 | 11 | #import "CPTokenStream.h" 12 | 13 | #import "CPTokenRecogniser.h" 14 | #import "CPKeywordRecogniser.h" 15 | #import "CPNumberRecogniser.h" 16 | #import "CPWhitespaceRecogniser.h" 17 | #import "CPIdentifierRecogniser.h" 18 | #import "CPQuotedRecogniser.h" 19 | #import "CPRegexpRecogniser.h" 20 | 21 | #import "CPToken.h" 22 | #import "CPErrorToken.h" 23 | #import "CPEOFToken.h" 24 | #import "CPKeywordToken.h" 25 | #import "CPNumberToken.h" 26 | #import "CPWhiteSpaceToken.h" 27 | #import "CPQuotedToken.h" 28 | #import "CPIdentifierToken.h" 29 | 30 | #import "CPGrammarSymbol.h" 31 | #import "CPGrammarSymbol.h" 32 | #import "CPRule.h" 33 | #import "CPGrammar.h" 34 | 35 | #import "CPRecoveryAction.h" 36 | 37 | #import "CPParser.h" 38 | #import "CPSLRParser.h" 39 | #import "CPLR1Parser.h" 40 | #import "CPLALR1Parser.h" 41 | 42 | #import "CPJSONParser.h" 43 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPGrammarInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPGrammarInternal.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 04/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPGrammar.h" 12 | 13 | @interface CPGrammar (CPGrammarInternal) 14 | 15 | - (CPGrammar *)augmentedGrammar; 16 | 17 | - (NSUInteger)indexOfRule:(CPRule *)rule; 18 | 19 | - (NSSet *)lr0Closure:(NSSet *)i; 20 | - (NSSet *)lr0GotoKernelWithItems:(NSSet *)i symbol:(CPGrammarSymbol *)symbol; 21 | - (NSArray *)lr0Kernels; 22 | 23 | - (NSSet *)lr1Closure:(NSSet *)i; 24 | - (NSSet *)lr1GotoKernelWithItems:(NSSet *)i symbol:(CPGrammarSymbol *)symbol; 25 | 26 | - (NSSet *)follow:(NSString *)name; 27 | - (NSSet *)first:(NSArray *)obj; 28 | 29 | - (NSString *)uniqueSymbolNameBasedOnName:(NSString *)name; 30 | - (NSString *)symbolNameNotInSet:(NSSet *)symbols basedOnName:(NSString *)name; 31 | 32 | - (NSArray *)tidyRightHandSides:(NSArray *)oldRules error:(NSError **)error; 33 | - (NSSet *)collectRHSElementsForNewRules:(NSArray *)rightHandSide; 34 | - (NSDictionary *)nameNewRules:(NSSet *)rhsElements withRules:(NSArray *)oldRules; 35 | - (NSArray *)addRHSRules:(NSDictionary *)rules toRules:(NSArray *)oldRules; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPGrammarPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPGrammarPrivate.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 04/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPGrammar.h" 12 | 13 | @interface CPGrammar (CPGrammarPrivate) 14 | 15 | @property (readwrite,copy ) NSArray *rules; 16 | 17 | @property (readwrite,retain) NSMutableDictionary *rulesByNonTerminal; 18 | @property (readwrite,retain) NSMutableDictionary *followCache; 19 | 20 | - (NSArray *)orderedRules; 21 | 22 | - (NSSet *)allSymbolNames; 23 | - (NSSet *)symbolNamesInRules:(NSArray *)rules; 24 | - (NSSet *)firstSymbol:(CPGrammarSymbol *)obj; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPRHSItem+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPRHSItem+Private.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 19/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPRHSItem.h" 10 | 11 | @interface CPRHSItem (Private) 12 | 13 | - (void)addTag:(NSString *)tagName; 14 | - (NSSet *)tagNamesWithError:(NSError **)err; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPRHSItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPRHSItem.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 26/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CPRHSItem : NSObject 12 | 13 | @property (readwrite,copy ) NSArray *alternatives; 14 | 15 | @property (readwrite,assign) BOOL repeats; 16 | @property (readwrite,assign) BOOL mayNotExist; 17 | 18 | @property (readwrite,copy ) NSSet *tags; 19 | 20 | @property (readwrite,assign) BOOL shouldCollapse; 21 | 22 | - (NSSet *)nonTerminalsUsed; 23 | 24 | @end 25 | 26 | @interface NSObject (CPIsRHSItem) 27 | 28 | - (BOOL)isRHSItem; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPRHSItemResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPRHSItemResult.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 23/10/2011. 6 | // Copyright (c) 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPParser.h" 12 | 13 | @interface CPRHSItemResult : NSObject 14 | 15 | @property (readwrite, retain) NSMutableArray *contents; 16 | @property (readwrite, assign) BOOL shouldCollapse; 17 | @property (readwrite, copy ) NSSet *tagNames; 18 | @property (readwrite, copy ) NSDictionary *tagValues; 19 | 20 | @end 21 | 22 | @interface NSObject (CPIsRHSItemResult) 23 | 24 | - (BOOL)isRHSItemResult; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Grammar/CPRule+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPRule+Internal.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 18/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CoreParse.h" 10 | 11 | @interface CPRule (Internal) 12 | 13 | - (BOOL)shouldCollapse; 14 | - (void)setShouldCollapse:(BOOL)shouldCollapse; 15 | 16 | - (NSSet *)tagNames; 17 | - (void)setTagNames:(NSSet *)tagNames; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/NSArray+Functional.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Functional.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 20/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSArray (Functional) 12 | 13 | - (NSArray *)cp_map:(id(^)(id obj))block; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/NSArray+Functional.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Functional.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 20/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "NSArray+Functional.h" 10 | 11 | @implementation NSArray (Functional) 12 | 13 | - (NSArray *)cp_map:(id(^)(id obj))block 14 | { 15 | NSUInteger c = [self count]; 16 | id *resultingObjects = malloc(c * sizeof(id)); 17 | 18 | NSUInteger nonNilCount = 0; 19 | for (id obj in self) 20 | { 21 | id r = block(obj); 22 | if (nil != r) 23 | { 24 | resultingObjects[nonNilCount] = r; 25 | nonNilCount++; 26 | } 27 | } 28 | 29 | NSArray *a = [NSArray arrayWithObjects:resultingObjects count:nonNilCount]; 30 | free(resultingObjects); 31 | return a; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/NSSetFunctional.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSSetFunctional.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 06/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSSet(Functional) 13 | 14 | - (NSSet *)cp_map:(id(^)(id obj))block; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/NSSetFunctional.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSSetFunctional.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 06/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "NSSetFunctional.h" 10 | 11 | 12 | @implementation NSSet(Functional) 13 | 14 | - (NSSet *)cp_map:(id(^)(id obj))block 15 | { 16 | NSUInteger c = [self count]; 17 | id *resultingObjects = malloc(c * sizeof(id)); 18 | 19 | NSUInteger nonNilCount = 0; 20 | for (id obj in self) 21 | { 22 | id r = block(obj); 23 | if (nil != r) 24 | { 25 | resultingObjects[nonNilCount] = r; 26 | nonNilCount++; 27 | } 28 | } 29 | 30 | NSSet *s = [NSSet setWithObjects:resultingObjects count:nonNilCount]; 31 | free(resultingObjects); 32 | return s; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPLALR1Parser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPParser.h" 12 | 13 | /** 14 | * The CPShiftReduceParser is a further abstract class based on CPParser. This implements the parts of a parser in common between all shift/reduce type parsers. 15 | * 16 | * @warning Note that to create a parser you should use one of CPShiftReduceParser's subclasses. 17 | */ 18 | @interface CPShiftReduceParser : CPParser 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPItem.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 06/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPRule.h" 12 | #import "CPGrammarSymbol.h" 13 | 14 | @interface CPItem : NSObject 15 | {} 16 | 17 | @property (readonly,retain) CPRule *rule; 18 | @property (readonly,assign) NSUInteger position; 19 | 20 | + (id)itemWithRule:(CPRule *)rule position:(NSUInteger)position; 21 | - (id)initWithRule:(CPRule *)rule position:(NSUInteger)position; 22 | 23 | - (CPGrammarSymbol *)nextSymbol; 24 | - (NSArray *)followingSymbols; 25 | 26 | - (id)itemByMovingDotRight; 27 | 28 | - (BOOL)isEqualToItem:(CPItem *)item; 29 | 30 | @end 31 | 32 | @interface NSObject (CPIsItem) 33 | 34 | - (BOOL)isItem; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPLALR1Parser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPLALR1Parser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 03/04/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPLR1Parser.h" 12 | 13 | /** 14 | * The CPLALR1Parser class is a concrete implementation of CPParser based on the lookahead left-to-right parsing method with a one symbol lookahead. 15 | * 16 | * The LALR1 parser is almost as fast as the SLR parser and covers almost as many grammars as the LR1 parser. LALR1 parsers consume only as much memory as SLR parsers. 17 | */ 18 | @interface CPLALR1Parser : CPShiftReduceParser 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPLR1Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPLR1Item.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPItem.h" 12 | #import "CPGrammarSymbol.h" 13 | 14 | @interface CPLR1Item : CPItem 15 | {} 16 | 17 | @property (readonly,retain) CPGrammarSymbol *terminal; 18 | 19 | + (id)lr1ItemWithRule:(CPRule *)rule position:(NSUInteger)position terminal:(CPGrammarSymbol *)terminal; 20 | - (id)initWithRule:(CPRule *)rule position:(NSUInteger)position terminal:(CPGrammarSymbol *)terminal; 21 | 22 | @end 23 | 24 | @interface NSObject (CPIsLR1Item) 25 | 26 | - (BOOL)isLR1Item; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPLR1Parser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPLR1Parser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPShiftReduceParser.h" 12 | 13 | /** 14 | * The CPLR1Parser class is a concrete implementation of CPParser based on the left-to-right parsing method with a one symbol lookahead. 15 | * 16 | * The LR1 parser is the slowest parser type available in CoreParse, but covers the largest set of grammars. LR1 parsers may consume significant amounts of memory. 17 | */ 18 | @interface CPLR1Parser : CPShiftReduceParser 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPSLRParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPSLRParser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 06/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPShiftReduceParser.h" 12 | 13 | /** 14 | * The CPSLRParser class is a concrete implementation of CPParser based on the simple left-to-right parsing method. 15 | * 16 | * The SLR parser is the fastest parser type available in CoreParse, but covers the smallest set of grammars. 17 | */ 18 | @interface CPSLRParser : CPShiftReduceParser 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftAction.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 20/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPShiftReduceAction.h" 10 | 11 | @interface CPShiftAction : CPShiftReduceAction 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftAction.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftAction.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 20/08/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPShiftAction.h" 10 | 11 | @implementation CPShiftAction 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceAction.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPRule.h" 12 | 13 | #import "CPGrammar.h" 14 | 15 | @interface CPShiftReduceAction : NSObject 16 | 17 | + (id)shiftAction:(NSUInteger)shiftLocation; 18 | + (id)reduceAction:(CPRule *)reduction; 19 | + (id)acceptAction; 20 | 21 | - (id)initWithShift:(NSUInteger)shiftLocation; 22 | - (id)initWithReductionRule:(CPRule *)reduction; 23 | 24 | - (BOOL)isShiftAction; 25 | - (BOOL)isReduceAction; 26 | - (BOOL)isAccept; 27 | 28 | - (NSUInteger)newState; 29 | - (CPRule *)reductionRule; 30 | 31 | - (NSString *)descriptionWithGrammar:(CPGrammar *)g; 32 | 33 | - (BOOL)isEqualToShiftReduceAction:(CPShiftReduceAction *)object; 34 | 35 | @end 36 | 37 | @interface NSObject (CPIsShiftReduceAction) 38 | 39 | - (BOOL)isShiftReduceAction; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceActionTable.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceActionTable.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CPShiftReduceAction; 12 | 13 | #import "CPToken.h" 14 | #import "CPGrammar.h" 15 | 16 | @interface CPShiftReduceActionTable : NSObject 17 | {} 18 | 19 | - (id)initWithCapacity:(NSUInteger)capacity; 20 | 21 | - (BOOL)setAction:(CPShiftReduceAction *)action forState:(NSUInteger)state name:(NSString *)token; 22 | 23 | - (CPShiftReduceAction *)actionForState:(NSUInteger)state token:(CPToken *)token; 24 | - (NSSet *)acceptableTokenNamesForState:(NSUInteger)state; 25 | 26 | - (NSString *)descriptionWithGrammar:(CPGrammar *)g; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceGotoTable.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceGotoTable.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CPRule; 12 | 13 | @interface CPShiftReduceGotoTable : NSObject 14 | {} 15 | 16 | - (id)initWithCapacity:(NSUInteger)capacity; 17 | 18 | - (BOOL)setGoto:(NSUInteger)gotoIndex forState:(NSUInteger)state nonTerminalNamed:(NSString *)nonTerminalName; 19 | 20 | - (NSUInteger)gotoForState:(NSUInteger)state rule:(CPRule *)rule; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceParserProtectedMethods.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceParserProtectedMethods.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 06/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPShiftReduceParser.h" 12 | 13 | #import "CPShiftReduceActionTable.h" 14 | #import "CPShiftReduceGotoTable.h" 15 | 16 | @interface CPShiftReduceParser () 17 | 18 | @property (readwrite,retain) CPShiftReduceActionTable *actionTable; 19 | @property (readwrite,retain) CPShiftReduceGotoTable *gotoTable; 20 | 21 | - (BOOL)constructShiftReduceTables; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceState.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceState.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CPShiftReduceState : NSObject 12 | 13 | @property (readonly,retain) NSObject *object; 14 | @property (readonly,assign) NSUInteger state; 15 | 16 | + (id)shiftReduceStateWithObject:(NSObject *)object state:(NSUInteger)state; 17 | - (id)initWithObject:(NSObject *)initObject state:(NSUInteger)initState; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Parsers/CPShiftReduceParsers/CPShiftReduceState.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPShiftReduceState.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 05/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPShiftReduceState.h" 10 | 11 | @interface CPShiftReduceState () 12 | 13 | @property (readwrite,retain) NSObject *object; 14 | @property (readwrite,assign) NSUInteger state; 15 | 16 | @end 17 | 18 | @implementation CPShiftReduceState 19 | 20 | @synthesize object; 21 | @synthesize state; 22 | 23 | + (id)shiftReduceStateWithObject:(NSObject *)object state:(NSUInteger)state 24 | { 25 | return [[[self alloc] initWithObject:object state:state] autorelease]; 26 | } 27 | 28 | - (id)initWithObject:(NSObject *)initObject state:(NSUInteger)initState 29 | { 30 | self = [super init]; 31 | 32 | if (nil != self) 33 | { 34 | [self setObject:initObject]; 35 | [self setState:initState]; 36 | } 37 | 38 | return self; 39 | } 40 | 41 | - (void)dealloc 42 | { 43 | [object release]; 44 | 45 | [super dealloc]; 46 | } 47 | 48 | - (NSString *)description 49 | { 50 | return [NSString stringWithFormat:@" 10 | 11 | #import "CPToken.h" 12 | 13 | /** 14 | * The CPTokenRecogniser protocol defines methods needed to recognise tokens in a string. 15 | */ 16 | @protocol CPTokenRecogniser 17 | 18 | @required 19 | /** 20 | * Attempts to recognise a token at tokenPosition in tokenString. 21 | * 22 | * If a token is successfully recognised, it should be returned, and tokenPosition advanced to after the consumed characters. 23 | * If no valid token is found `nil` must be returned instead, and tokenPosition left unchanged. 24 | * 25 | * @param tokenString The string in which to recognise tokens. 26 | * @param tokenPosition The position at which to try to find the token. On output, the position after the recognised token. 27 | * @return Returns the token recognised. 28 | */ 29 | - (CPToken *)recogniseTokenInString:(NSString *)tokenString currentTokenPosition:(NSUInteger *)tokenPosition; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Recognisers/CPWhiteSpaceRecogniser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPWhiteSpaceRecogniser.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPTokenRecogniser.h" 12 | 13 | /** 14 | * The CPWhiteSpaceRecogniser class attempts to recognise white space on the input string. 15 | * 16 | * This recogniser produces CPWhiteSpaceTokens. 17 | */ 18 | @interface CPWhiteSpaceRecogniser : NSObject 19 | 20 | ///--------------------------------------------------------------------------------------- 21 | /// @name Creating and Initialising a WhiteSpace Recogniser 22 | ///--------------------------------------------------------------------------------------- 23 | 24 | /** 25 | * Creates a whitespace recogniser. 26 | * 27 | * @return Returns a CPWhiteSpaceRecogniser. 28 | */ 29 | + (id)whiteSpaceRecogniser; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Types/CPEOFToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPEOFToken.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPToken.h" 12 | 13 | /** 14 | * The CPEOFToken class reperesents the end of a token stream. 15 | * 16 | * These tokens return `@"EOF"` as their name. 17 | */ 18 | @interface CPEOFToken : CPToken 19 | 20 | /** 21 | * Creates an end of file token. 22 | * 23 | * @return A token representing the end of the input stream. 24 | */ 25 | + (id)eof; 26 | 27 | @end 28 | 29 | @interface NSObject (CPIsEOFToken) 30 | 31 | - (BOOL)isEOFToken; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Types/CPEOFToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPEOFToken.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPEOFToken.h" 10 | 11 | @implementation CPEOFToken 12 | 13 | + (id)eof 14 | { 15 | return [[[CPEOFToken alloc] init] autorelease]; 16 | } 17 | 18 | - (NSString *)name 19 | { 20 | return @"EOF"; 21 | } 22 | 23 | - (NSUInteger)hash 24 | { 25 | return 0; 26 | } 27 | 28 | - (BOOL)isEOFToken 29 | { 30 | return YES; 31 | } 32 | 33 | - (BOOL)isEqual:(id)object 34 | { 35 | return [object isEOFToken]; 36 | } 37 | 38 | @end 39 | 40 | @implementation NSObject (CPIsEOFToken) 41 | 42 | - (BOOL)isEOFToken 43 | { 44 | return NO; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Types/CPErrorToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPErrorToken.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 05/02/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPToken.h" 10 | 11 | /** 12 | * The CPErrorToken class reperesents an error during tokenisation. 13 | * 14 | * These tokens return `@"Error"` as their name. They may carry an error message with them. 15 | */ 16 | @interface CPErrorToken : CPToken 17 | 18 | /** 19 | * The error message generated when the tokeniser failed. 20 | */ 21 | @property (readwrite, copy) NSString *errorMessage; 22 | 23 | /** 24 | * Creates and initializes a new CPErrorToken with a given message. 25 | * 26 | * @param errorMessage The message for the error. 27 | * @return A CPErrorToken with the message. 28 | */ 29 | + (id)errorWithMessage:(NSString *)errorMessage; 30 | 31 | /** 32 | * Returns a CPErrorToken initialized with a given message. 33 | * 34 | * @param errorMessage The message for the error. 35 | * @return A CPErrorToken with the message. 36 | */ 37 | - (id)initWithMesage:(NSString *)errorMessage; 38 | 39 | @end 40 | 41 | @interface NSObject (CPErrorToken) 42 | 43 | - (BOOL)isErrorToken; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Types/CPErrorToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPErrorToken.m 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 05/02/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPErrorToken.h" 10 | 11 | @implementation CPErrorToken 12 | 13 | @synthesize errorMessage; 14 | 15 | + (id)errorWithMessage:(NSString *)errorMessage 16 | { 17 | return [[[self alloc] initWithMesage:errorMessage] autorelease]; 18 | } 19 | 20 | - (id)initWithMesage:(NSString *)initErrorMessage 21 | { 22 | self = [super init]; 23 | 24 | if (nil != self) 25 | { 26 | [self setErrorMessage:initErrorMessage]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)dealloc 33 | { 34 | [errorMessage release]; 35 | 36 | [super dealloc]; 37 | } 38 | 39 | - (NSString *)name 40 | { 41 | return @"Error"; 42 | } 43 | 44 | - (NSUInteger)hash 45 | { 46 | return 0; 47 | } 48 | 49 | - (BOOL)isErrorToken 50 | { 51 | return YES; 52 | } 53 | 54 | - (BOOL)isEqual:(id)object 55 | { 56 | return [object isErrorToken]; 57 | } 58 | 59 | @end 60 | 61 | @implementation NSObject (CPIsErrorToken) 62 | 63 | - (BOOL)isErrorToken 64 | { 65 | return NO; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/Tokenisation/Token Types/CPToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPToken.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPToken.h" 10 | 11 | @implementation CPToken 12 | 13 | @synthesize lineNumber; 14 | @synthesize columnNumber; 15 | @synthesize characterNumber; 16 | @synthesize length; 17 | 18 | - (NSString *)name 19 | { 20 | [NSException raise:@"Abstract method called exception" format:@"CPToken is abstract, and should not have name called."]; 21 | return @""; 22 | } 23 | 24 | - (NSUInteger)hash 25 | { 26 | return [[self name] hash]; 27 | } 28 | 29 | - (BOOL)isEqual:(id)object 30 | { 31 | return ([object isToken] && 32 | [[self name] isEqualToString:[(CPToken *)object name]]); 33 | } 34 | 35 | - (NSString *)description 36 | { 37 | return [NSString stringWithFormat:@"<%@>", [self name]]; 38 | } 39 | 40 | @end 41 | 42 | @implementation NSObject (CPIsToken) 43 | 44 | - (BOOL)isToken 45 | { 46 | return NO; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /CoreParse/CoreParse/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPSTAssertionsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPSTAssertionsTests.h 3 | // CoreParse 4 | // 5 | // Created by Christopher Miller on 5/18/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CPSTAssertionsTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestErrorEvaluatorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestErrorEvaluatorDelegate.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 05/02/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface CPTestErrorEvaluatorDelegate : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestErrorHandlingDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestErrorHandlingDelegate.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 05/02/2012. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface CPTestErrorHandlingDelegate : NSObject 14 | 15 | @property (readwrite, assign) BOOL hasEncounteredError; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestEvaluatorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestEvaluatorDelegate.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface CPTestEvaluatorDelegate : NSObject 14 | {} 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestEvaluatorDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestEvaluatorDelegate.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 12/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPTestEvaluatorDelegate.h" 10 | 11 | #import "CPNumberToken.h" 12 | 13 | @implementation CPTestEvaluatorDelegate 14 | 15 | - (id)parser:(CPParser *)parser didProduceSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | CPRule *r = [syntaxTree rule]; 18 | NSArray *c = [syntaxTree children]; 19 | 20 | switch ([r tag]) 21 | { 22 | case 0: 23 | case 2: 24 | return [c objectAtIndex:0]; 25 | case 1: 26 | return [NSNumber numberWithInt:[[c objectAtIndex:0] intValue] + [[c objectAtIndex:2] intValue]]; 27 | case 3: 28 | return [NSNumber numberWithInt:[[c objectAtIndex:0] intValue] * [[c objectAtIndex:2] intValue]]; 29 | case 4: 30 | return [(CPNumberToken *)[c objectAtIndex:0] number]; 31 | case 5: 32 | return [c objectAtIndex:1]; 33 | default: 34 | return syntaxTree; 35 | } 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestMapCSSTokenisingDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestMapCSSTokenisingDelegate.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 15/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @interface CPTestMapCSSTokenisingDelegate : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestWhiteSpaceIgnoringDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestWhiteSpaceIgnoringDelegate.h 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 15/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface CPTestWhiteSpaceIgnoringDelegate : NSObject 14 | {} 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CPTestWhiteSpaceIgnoringDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPTestWhiteSpaceIgnoringDelegate.m 3 | // CoreParse 4 | // 5 | // Created by Tom Davie on 15/03/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "CPTestWhiteSpaceIgnoringDelegate.h" 10 | 11 | @implementation CPTestWhiteSpaceIgnoringDelegate 12 | 13 | - (BOOL)tokeniser:(CPTokeniser *)tokeniser shouldConsumeToken:(CPToken *)token 14 | { 15 | return YES; 16 | } 17 | 18 | - (void)tokeniser:(CPTokeniser *)tokeniser requestsToken:(CPToken *)token pushedOntoStream:(CPTokenStream *)stream 19 | { 20 | if (![token isWhiteSpaceToken]) 21 | { 22 | [stream pushToken:token]; 23 | } 24 | } 25 | 26 | - (NSUInteger)tokeniser:(CPTokeniser *)tokeniser didNotFindTokenOnInput:(NSString *)input position:(NSUInteger)position error:(NSString **)errorMessage 27 | { 28 | *errorMessage = @"Found something that wasn't a numeric expression"; 29 | NSRange nextSafeStuff = [input rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"1234567890+*()"] options:NSLiteralSearch range:NSMakeRange(position, [input length] - position)]; 30 | return nextSafeStuff.location; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CoreParseTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.inthebeginninggames.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CoreParseTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CoreParseTests' target in the 'CoreParseTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/CoreParseTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreParseTests.h 3 | // CoreParseTests 4 | // 5 | // Created by Tom Davie on 10/02/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CoreParseTests : SenTestCase 13 | {} 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Expression.h: -------------------------------------------------------------------------------- 1 | // 2 | // Expression.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 26/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @interface Expression : NSObject 14 | 15 | @property (readwrite,assign) float value; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Expression.m: -------------------------------------------------------------------------------- 1 | // 2 | // Expression.m 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 26/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "Expression.h" 10 | 11 | #import "Term.h" 12 | 13 | @implementation Expression 14 | 15 | @synthesize value; 16 | 17 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 18 | { 19 | self = [self init]; 20 | 21 | if (nil != self) 22 | { 23 | NSArray *components = [syntaxTree children]; 24 | if ([components count] == 1) 25 | { 26 | [self setValue:[(Term *)[components objectAtIndex:0] value]]; 27 | } 28 | else 29 | { 30 | [self setValue:[(Expression *)[components objectAtIndex:0] value] + [(Term *)[components objectAtIndex:2] value]]; 31 | } 32 | } 33 | 34 | return self; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Expression2.h: -------------------------------------------------------------------------------- 1 | // 2 | // Expression2.h 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface Expression2 : NSObject 13 | 14 | @property (readwrite,assign) float value; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Expression2.m: -------------------------------------------------------------------------------- 1 | // 2 | // Expression2.m 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "Expression2.h" 10 | #import "Term2.h" 11 | 12 | @implementation Expression2 13 | 14 | @synthesize value; 15 | 16 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree{ 17 | self = [self init]; 18 | 19 | if (nil != self){ 20 | NSArray *components = [syntaxTree children]; 21 | if ([components count] == 1){ 22 | NSObject *term2 = [components objectAtIndex:0]; 23 | if ([term2 isMemberOfClass:[Term2 class]]){ 24 | self.value = [(Term2 *)term2 value]; 25 | } else { 26 | self.value = -1; 27 | } 28 | } else { 29 | NSObject *term2 = [components objectAtIndex:2]; 30 | if ([term2 isMemberOfClass:[Term2 class]]){ 31 | self.value = [(Expression2 *)[components objectAtIndex:0] value] + [(Term2 *)term2 value]; 32 | } else { 33 | self.value = -1; 34 | } 35 | } 36 | } 37 | 38 | return self; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/RuleBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // RuleBase.h 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface RuleBase : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/RuleBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // RuleBase.m 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "RuleBase.h" 10 | 11 | @implementation RuleBase 12 | 13 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree{ 14 | self = [super init]; 15 | if (nil != self){ 16 | } 17 | 18 | return self; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Term.h: -------------------------------------------------------------------------------- 1 | // 2 | // Term.h 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 26/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @interface Term : NSObject 14 | 15 | @property (readwrite,assign) float value; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Term.m: -------------------------------------------------------------------------------- 1 | // 2 | // Term.m 3 | // CoreParse 4 | // 5 | // Created by Thomas Davie on 26/06/2011. 6 | // Copyright 2011 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "Term.h" 10 | 11 | @implementation Term 12 | 13 | @synthesize value; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super init]; 18 | 19 | if (nil != self) 20 | { 21 | [self setValue:[[(CPNumberToken *)[[syntaxTree children] objectAtIndex:0] number] floatValue]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Term2.h: -------------------------------------------------------------------------------- 1 | // 2 | // Term2.h 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "RuleBase.h" 10 | 11 | @interface Term2 : RuleBase 12 | 13 | @property (readwrite,assign) float value; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/Term2.m: -------------------------------------------------------------------------------- 1 | // 2 | // Term2.m 3 | // CoreParse 4 | // 5 | // Created by Ayal Spitz on 10/4/12. 6 | // Copyright (c) 2012 In The Beginning... All rights reserved. 7 | // 8 | 9 | #import "Term2.h" 10 | 11 | @implementation Term2 12 | 13 | @synthesize value; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree{ 16 | self = [super init]; 17 | if (nil != self){ 18 | [self setValue:[[(CPNumberToken *)[[syntaxTree children] objectAtIndex:0] number] floatValue]]; 19 | } 20 | 21 | return self; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CoreParse/CoreParseTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MapView/Canonical.framework.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Canonical.framework.tar -------------------------------------------------------------------------------- /MapView/DesktopMapView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /MapView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.catchme.${PRODUCT_NAME:identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /MapView/Map/Cache.xcdatamodel/elements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Cache.xcdatamodel/elements -------------------------------------------------------------------------------- /MapView/Map/Cache.xcdatamodel/layout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Cache.xcdatamodel/layout -------------------------------------------------------------------------------- /MapView/Map/FMDB/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseAdditions.h 3 | // fmkit 4 | // 5 | // Created by August Mueller on 10/30/05. 6 | // Copyright 2005 Flying Meat Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface FMDatabase (FMDatabaseAdditions) 11 | 12 | 13 | - (int)intForQuery:(NSString*)objs, ...; 14 | - (long)longForQuery:(NSString*)objs, ...; 15 | - (BOOL)boolForQuery:(NSString*)objs, ...; 16 | - (double)doubleForQuery:(NSString*)objs, ...; 17 | - (NSString*)stringForQuery:(NSString*)objs, ...; 18 | - (NSData*)dataForQuery:(NSString*)objs, ...; 19 | - (NSDate*)dateForQuery:(NSString*)objs, ...; 20 | 21 | // Notice that there's no dataNoCopyForQuery:. 22 | // That would be a bad idea, because we close out the result set, and then what 23 | // happens to the data that we just didn't copy? Who knows, not I. 24 | 25 | 26 | - (BOOL)tableExists:(NSString*)tableName; 27 | - (FMResultSet*)getSchema; 28 | - (FMResultSet*)getTableSchema:(NSString*)tableName; 29 | - (BOOL)columnExists:(NSString*)tableName columnName:(NSString*)columnName; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MapView/Map/FMDB/README.txt: -------------------------------------------------------------------------------- 1 | This is FMDB; an objective-c wrapper around SQLITE by August Mueller from here: 2 | http://gusmueller.com/blog/archives/2008/03/fmdb_for_iphone.html -------------------------------------------------------------------------------- /MapView/Map/README.txt: -------------------------------------------------------------------------------- 1 | The Route-Me project is receiving frequent updates from its developer community. For 2 | this reason, you'll probably want to have your hands on the source of Route-Me while 3 | you're developing your own project. If you want to link the Route-Me .xcodeproj to your 4 | own program, please follow the Embedding Guide, found at 5 | http://github.com/route-me/route-me/wiki/Embedding-Guide 6 | Use the "MapView" target. 7 | 8 | If you just want to produce a static library framework to drop into your app, without project 9 | dependencies or source-level debugging, follow the instructions in README-library-build.rtf 10 | and use the "MapView-framework" target. 11 | 12 | 13 | -------------------------------------------------------------------------------- /MapView/Map/RMGlobalConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RMGlobalConstants.h 3 | * MapView 4 | * 5 | * Created by My Home on 4/29/09. 6 | * Copyright 2009 Brandon "Quazie" Kwaselow. All rights reserved. 7 | * 8 | */ 9 | 10 | #define kMaxLong 180 11 | #define kMaxLat 90 12 | -------------------------------------------------------------------------------- /MapView/Map/RMOSPTileSourceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // RMOSPTileSourceManager.h 3 | // MapView 4 | // 5 | // Created by Nikita Medvedev on 3/27/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RMTile.h" 11 | 12 | @interface RMOSPTileSourceManager : NSObject 13 | 14 | -(id) initWithResource:(NSString*)resource; 15 | -(NSData*) dataForTile:(RMTile)tile; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MapView/Map/RMTileMapServiceSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // TileMapServiceSource.h 3 | // Images 4 | // 5 | // Created by Tracy Harton on 02/06/09 6 | // Copyright 2009 Tracy Harton. All rights reserved. 7 | // 8 | 9 | #import "RMAbstractMercatorWebSource.h" 10 | 11 | @interface RMTileMapServiceSource : RMAbstractMercatorWebSource 12 | { 13 | NSString *host, *key; 14 | } 15 | 16 | -(id) init: (NSString*) _host uniqueKey: (NSString*) _key minZoom: (float) _minZoom maxZoom: (float) _maxZoom; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MapView/Map/RMTilesUpdateDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RMTilesUpdateDelegate.h 3 | // 4 | // Created by Olivier Brand. 5 | // Copyright 2008 __MyCompanyName__. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | #import "RMLatLong.h" 11 | 12 | @protocol RMTilesUpdateDelegate 13 | 14 | @required 15 | 16 | - (void) regionUpdate: (RMSphericalTrapezium) region; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MapView/Map/Resources/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Resources/loading.png -------------------------------------------------------------------------------- /MapView/Map/Resources/marker-blue-withletter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Resources/marker-blue-withletter.png -------------------------------------------------------------------------------- /MapView/Map/Resources/marker-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Resources/marker-blue.png -------------------------------------------------------------------------------- /MapView/Map/Resources/marker-red-withletter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Resources/marker-red-withletter.png -------------------------------------------------------------------------------- /MapView/Map/Resources/marker-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/Resources/marker-red.png -------------------------------------------------------------------------------- /MapView/Map/marker-X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/MapView/Map/marker-X.png -------------------------------------------------------------------------------- /MapView/MapViewTests/MapViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MapView/MapViewTests/MapViewTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MapViewTests' target in the 'MapViewTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "RouteMe.h" 8 | #endif 9 | -------------------------------------------------------------------------------- /MapView/MapViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MapView/MapView_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MapView' target in the 'MapView' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | 10 | #if DEBUG 11 | #define RMLog(args...) NSLog(@"%@", [NSString stringWithFormat: args]) 12 | #define LogMethod() NSLog(@"logged method call: -[%@ %@] (line %d)", self, NSStringFromSelector(_cmd), __LINE__) 13 | #define WarnDeprecated() NSLog(@"***** WARNING: deprecated method call: -[%@ %@] (line %d)", self, NSStringFromSelector(_cmd), __LINE__) 14 | #else 15 | // DEBUG not defined: 16 | 17 | #define RMLog(args...) // do nothing. 18 | #define LogMethod() 19 | #define WarnDeprecated() 20 | #define NS_BLOCK_ASSERTIONS 1 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /MapView/RM Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | NSMainNibFile 20 | MainWindow 21 | 22 | 23 | -------------------------------------------------------------------------------- /MapView/UnitTesting/RouteMeTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // RouteMeTests.h 3 | // MapView 4 | // 5 | // Created by Hal Mueller on 4/6/09. 6 | // Copyright 2009 Route-Me Contributors. All rights reserved. 7 | // 8 | 9 | #import "GTMSenTestCase.h" 10 | #import "GTMUIKit+UnitTesting.h" 11 | #import 12 | 13 | @class RMMapView; 14 | 15 | /// Unit tests go here. See http://developer.apple.com/tools/unittest.html 16 | ///and http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting for guidance. 17 | @interface RouteMeTests : SenTestCase { 18 | RMMapView *mapView; 19 | UIView *contentView; 20 | CLLocationCoordinate2D initialCenter; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/MapsforgeReader-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MapsforgeReader' target in the 'MapsforgeReader' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/MapsforgeReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MapsforgeReader.h 3 | // MapsforgeReader 4 | // 5 | // Created by Nikita Medvedev on 3/23/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MapsforgeReader : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/MapsforgeReader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MapsforgeReader.m 3 | // MapsforgeReader 4 | // 5 | // Created by Nikita Medvedev on 3/23/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MapsforgeReader.h" 10 | 11 | @implementation MapsforgeReader 12 | 13 | - (id)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | // Initialization code here. 18 | } 19 | 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/_java/map/reader/header/SubFileParameterBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 mapsforge.org 3 | * 4 | * This program is free software: you can redistribute it and/or modify it under the 5 | * terms of the GNU Lesser General Public License as published by the Free Software 6 | * Foundation, either version 3 of the License, or (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY 9 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public License along with 13 | * this program. If not, see . 14 | */ 15 | package org.mapsforge.map.reader.header; 16 | 17 | import org.mapsforge.core.BoundingBox; 18 | 19 | class SubFileParameterBuilder { 20 | byte baseZoomLevel; 21 | BoundingBox boundingBox; 22 | long indexStartAddress; 23 | long startAddress; 24 | long subFileSize; 25 | byte zoomLevelMax; 26 | byte zoomLevelMin; 27 | 28 | SubFileParameter build() { 29 | return new SubFileParameter(this); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/GeoPoint.h: -------------------------------------------------------------------------------- 1 | /** 2 | * A GeoPoint represents an immutable pair of latitude and longitude coordinates. 3 | */ 4 | 5 | @interface GeoPoint : NSObject /**/ { 6 | 7 | /** 8 | * The latitude value of this GeoPoint in microdegrees (degrees * 10^6). 9 | */ 10 | int latitudeE6; 11 | 12 | /** 13 | * The longitude value of this GeoPoint in microdegrees (degrees * 10^6). 14 | */ 15 | int longitudeE6; 16 | 17 | /** 18 | * The hash code of this object. 19 | */ 20 | int hashCodeValue; 21 | } 22 | 23 | @property(nonatomic, readonly) double latitude; 24 | @property(nonatomic, readonly) double longitude; 25 | - (id) init:(double)latitude longitude:(double)longitude; 26 | - (id) init:(int)latitudeE6 longitudeE6:(int)longitudeE6; 27 | - (int) compareTo:(GeoPoint *)geoPoint; 28 | - (BOOL) isEqualTo:(NSObject *)obj; 29 | - (int) hash; 30 | - (NSString *) description; 31 | - (int) calculateHashCode; 32 | @end 33 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/IOUtils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * A utility class with IO-specific helper methods. 3 | */ 4 | 5 | @interface IOUtils : NSObject { 6 | } 7 | 8 | //+ (void) closeQuietly:(Closeable *)closeable; 9 | @end 10 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/IOUtils.m: -------------------------------------------------------------------------------- 1 | //#import "IOUtils.h" 2 | // 3 | //Logger * const LOG = [Logger getLogger:[[IOUtils class] name]]; 4 | // 5 | //@implementation IOUtils 6 | // 7 | // 8 | ///** 9 | // * Invokes the {@link Closeable#close()} method on the given object. If an {@link IOException} occurs during the 10 | // * method call, it will be caught and logged on level {@link Level#WARNING}. 11 | // * 12 | // * @param closeable 13 | // * the data source which should be closed (may be null). 14 | // */ 15 | //+ (void) closeQuietly:(Closeable *)closeable { 16 | // 17 | // @try { 18 | // if (closeable != nil) { 19 | // [closeable close]; 20 | // } 21 | // } 22 | // @catch (IOException * e) { 23 | // [LOG log:Level.WARNING param1:nil param2:e]; 24 | // } 25 | //} 26 | // 27 | //- (id) init { 28 | // if (self = [super init]) { 29 | // @throw [[[IllegalStateException alloc] init] autorelease]; 30 | // } 31 | // return self; 32 | //} 33 | // 34 | //@end 35 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/LRUCache.h: -------------------------------------------------------------------------------- 1 | /** 2 | * An LRUCache with a fixed size and an access-order policy. Old mappings are automatically removed from the cache when 3 | * new mappings are added. This implementation uses an {@link LinkedHashMap} internally. 4 | * 5 | * @param 6 | * the type of the map key, see {@link Map}. 7 | * @param 8 | * the type of the map value, see {@link Map}. 9 | */ 10 | 11 | @interface LRUCache : NSMutableArray { 12 | int capacity; 13 | } 14 | 15 | - (id) initWithCapacity:(int)capacity; 16 | - (BOOL) removeEldestEntry:(id *)eldest; 17 | @end 18 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/LRUCache.m: -------------------------------------------------------------------------------- 1 | #import "LRUCache.h" 2 | 3 | float const LOAD_FACTOR = 0.6f; 4 | extern long const serialVersionUID;// = 1L; 5 | 6 | @implementation LRUCache 7 | 8 | + (int) calculateInitialCapacity:(int)capacity { 9 | if (capacity < 0) { 10 | [NSException raise:@"InvalidArgumentException" format:@"capacity must not be negative: %d", capacity]; 11 | } 12 | return (int)(capacity / LOAD_FACTOR) + 2; 13 | } 14 | 15 | 16 | /** 17 | * @param capacity 18 | * the maximum capacity of this cache. 19 | * @throws IllegalArgumentException 20 | * if the capacity is negative. 21 | */ 22 | - (id) initWithCapacity:(int)_capacity { 23 | if (self = [super init]) 24 | { 25 | //[super init:[self calculateInitialCapacity:capacity] param1:LOAD_FACTOR param2:YES]) { 26 | capacity = _capacity; 27 | } 28 | return self; 29 | } 30 | 31 | - (BOOL) removeEldestEntry:(id *)eldest { 32 | return [self count] > capacity; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/MFTag.h: -------------------------------------------------------------------------------- 1 | /** 2 | * A tag represents an immutable key-value pair. 3 | */ 4 | 5 | @interface MFTag : NSObject /**/ { 6 | 7 | @public 8 | /** 9 | * The key of this tag. 10 | */ 11 | NSString * key; 12 | 13 | /** 14 | * The value of this tag. 15 | */ 16 | NSString * value; 17 | int hashCodeValue; 18 | } 19 | 20 | - (id) initWithTag:(NSString *)tag; 21 | - (id) init:(NSString *)key value:(NSString *)value; 22 | - (BOOL) isEqualTo:(NSObject *)obj; 23 | - (int) hash; 24 | - (NSString *) description; 25 | - (int) calculateHashCode; 26 | @end 27 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/core/MapPosition.h: -------------------------------------------------------------------------------- 1 | #import "GeoPoint.h" 2 | 3 | /** 4 | * A MapPosition represents an immutable pair of {@link GeoPoint} and zoom level. 5 | */ 6 | 7 | @interface MapPosition : NSObject /**/ { 8 | 9 | /** 10 | * The map position. 11 | */ 12 | GeoPoint * geoPoint; 13 | 14 | /** 15 | * The zoom level. 16 | */ 17 | Byte zoomLevel; 18 | 19 | /** 20 | * The hash code of this object. 21 | */ 22 | int hashCodeValue; 23 | } 24 | 25 | - (id) init:(GeoPoint *)geoPoint zoomLevel:(char)zoomLevel; 26 | - (BOOL) isEqualTo:(NSObject *)obj; 27 | - (int) hash; 28 | - (NSString *) description; 29 | - (int) calculateHashCode; 30 | @end 31 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/Deserializer.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * This utility class contains methods to convert byte arrays to numbers. 4 | */ 5 | 6 | @interface Deserializer : NSObject { 7 | } 8 | 9 | + (long long) getFiveBytesLong:(Byte *)buffer offset:(long)offset; 10 | + (int) getInt:(Byte *)buffer offset:(int)offset; 11 | + (long long) getLong:(Byte *)buffer offset:(int)offset; 12 | + (int) getShort:(Byte *)buffer offset:(int)offset; 13 | @end 14 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/IndexCache.h: -------------------------------------------------------------------------------- 1 | #import "LRUCache.h" 2 | #import "SubFileParameter.h" 3 | 4 | /** 5 | * A cache for database index blocks with a fixed size and LRU policy. 6 | */ 7 | 8 | @interface IndexCache : NSObject { 9 | NSMutableDictionary * map; 10 | NSData * randomAccessFile; 11 | } 12 | 13 | - (id) init:(NSData *)randomAccessFile capacity:(int)capacity; 14 | - (void) destroy; 15 | - (long) getIndexEntry:(SubFileParameter *)subFileParameter blockNumber:(long)blockNumber; 16 | @end 17 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/IndexCacheEntryKey.h: -------------------------------------------------------------------------------- 1 | #import "SubFileParameter.h" 2 | 3 | /** 4 | * An immutable container class which is the key for the index cache. 5 | */ 6 | 7 | @interface IndexCacheEntryKey : NSObject { 8 | int hashCodeValue; 9 | long indexBlockNumber; 10 | SubFileParameter * subFileParameter; 11 | } 12 | 13 | - (id) init:(SubFileParameter *)subFileParameter indexBlockNumber:(long)indexBlockNumber; 14 | - (BOOL) isEqualTo:(NSObject *)obj; 15 | - (int) hash; 16 | - (int) calculateHashCode; 17 | - (id) copyWithZone:(NSZone *)zone; 18 | @end 19 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/MapDatabaseCallback.h: -------------------------------------------------------------------------------- 1 | #import "MFTag.h" 2 | 3 | /** 4 | * Callback methods which can be triggered from the {@link MapDatabase}. 5 | */ 6 | 7 | @protocol MapDatabaseCallback 8 | - (void) renderPointOfInterest:(char)layer latitude:(int)latitude longitude:(int)longitude tags:(NSMutableArray *)tags; 9 | - (void) renderWaterBackground; 10 | - (void) renderWay:(char)layer labelPosition:(float *)labelPosition tags:(NSMutableArray *)tags wayNodes:(float**)wayNodes; 11 | - (void) addNode:(int)nodeId latitude:(int)latitude longitude:(int)longitude tags:(NSMutableDictionary *)tags; 12 | - (void) addWay:(int)wayId nodes:(int **)nodes length:(int*)length labelPosition:(float*)labelPosition tags:(NSMutableDictionary *)tags layer:(int)layer; 13 | @end 14 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/QueryCalculations.h: -------------------------------------------------------------------------------- 1 | #import "Tile.h" 2 | #import "SubFileParameter.h" 3 | #import "QueryParameters.h" 4 | 5 | @class QueryParameters; 6 | 7 | @interface QueryCalculations : NSObject { 8 | } 9 | 10 | + (void) calculateBaseTiles:(QueryParameters *)queryParameters tile:(Tile *)tile subFileParameter:(SubFileParameter *)subFileParameter; 11 | + (void) calculateBlocks:(QueryParameters *)queryParameters subFileParameter:(SubFileParameter *)subFileParameter; 12 | + (int) calculateTileBitmask:(Tile *)tile zoomLevelDifference:(int)zoomLevelDifference; 13 | @end 14 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/QueryParameters.h: -------------------------------------------------------------------------------- 1 | 2 | @interface QueryParameters : NSObject { 3 | @public 4 | long long fromBaseTileX; 5 | long long fromBaseTileY; 6 | long long fromBlockX; 7 | long long fromBlockY; 8 | int queryTileBitmask; 9 | int queryZoomLevel; 10 | long long toBaseTileX; 11 | long long toBaseTileY; 12 | long long toBlockX; 13 | long long toBlockY; 14 | BOOL useTileBitmask; 15 | } 16 | 17 | - (NSString *) description; 18 | @end 19 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/QueryParameters.m: -------------------------------------------------------------------------------- 1 | #import "QueryParameters.h" 2 | 3 | @implementation QueryParameters 4 | 5 | - (NSString *) description { 6 | return [NSString stringWithFormat:@"QueryParameters [fromBaseTileX=%lld, fromBaseTileY=%lld, fromBlockX=%lld, fromBlockY=%lld, queryTileBitmask=%d, queryZoomLevel=%d, toBaseTileX=%lld, toBaseTileY=%lld, toBlockX=%lld, toBlockY=%lld, useTileBitmask=%d]", 7 | fromBaseTileX, fromBaseTileY, fromBlockX, fromBlockY, queryTileBitmask, queryZoomLevel, toBaseTileX, toBaseTileY, toBlockX, toBlockY, useTileBitmask]; 8 | } 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/ReadBuffer.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Reads from a {@link RandomAccessFile} into a buffer and decodes the data. 4 | */ 5 | 6 | @interface ReadBuffer : NSObject { 7 | NSData * bufferData; 8 | Byte *buffer; 9 | int bufferPosition; 10 | int globalBufferPosition; 11 | NSData * inputFile; 12 | } 13 | 14 | - (id) initWithInputFile:(NSData *)inputFile; 15 | - (Byte) readByte; 16 | - (BOOL) readFromFile:(int)length; 17 | - (void) seekTo:(long long)offset; 18 | - (int) readInt; 19 | - (long long) readLong; 20 | - (int) readShort; 21 | - (int) readSignedInt; 22 | - (uint) readUnsignedInt; 23 | - (NSString *) readUTF8EncodedString; 24 | - (NSString *) readUTF8EncodedString:(int)stringLength; 25 | - (int) getBufferPosition; 26 | - (int) getBufferSize; 27 | - (void) setBufferPosition:(int)bufferPosition; 28 | - (void) skipBytes:(int)bytes; 29 | @end 30 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/FileOpenResult.h: -------------------------------------------------------------------------------- 1 | #import "MapDatabase.h" 2 | #import "FileOpenResult.h" 3 | 4 | /** 5 | * A FileOpenResult is a simple DTO which is returned by {@link MapDatabase#openFile(File)}. 6 | */ 7 | 8 | 9 | /** 10 | * Singleton for a FileOpenResult instance with {@code success=true}. 11 | */ 12 | 13 | 14 | @interface FileOpenResult : NSObject { 15 | NSString * errorMessage; 16 | BOOL success; 17 | } 18 | 19 | @property(nonatomic, retain, readonly) NSString * errorMessage; 20 | @property(nonatomic, readonly) BOOL success; 21 | - (id) initWithErrorMessage:(NSString *)errorMessage; 22 | - (NSString *) description; 23 | + (id) SUCCESS; 24 | @end 25 | 26 | //extern FileOpenResult * const SUCCESS; 27 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/MapFileHeader.h: -------------------------------------------------------------------------------- 1 | //#import "IOException.h" 2 | #import "ReadBuffer.h" 3 | #import "MapFileInfo.h" 4 | #import "MapFileInfoBuilder.h" 5 | #import "SubFileParameter.h" 6 | #import "FileOpenResult.h" 7 | 8 | /** 9 | * Reads and validates the header data from a binary map file. 10 | */ 11 | 12 | @class FileOpenResult, MapFileInfo, MapFileInfoBuilder; 13 | 14 | @interface MapFileHeader : NSObject { 15 | @public 16 | MapFileInfo * mapFileInfo; 17 | NSMutableArray * subFileParameters; 18 | Byte zoomLevelMaximum; 19 | Byte zoomLevelMinimum; 20 | } 21 | 22 | @property(nonatomic, retain, readonly) MapFileInfo * mapFileInfo; 23 | - (Byte) getQueryZoomLevel:(Byte)zoomLevel; 24 | - (SubFileParameter *) getSubFileParameter:(int)queryZoomLevel; 25 | - (FileOpenResult *) readHeader:(ReadBuffer *)readBuffer fileSize:(long)fileSize; 26 | - (FileOpenResult *) readSubFileParameters:(ReadBuffer *)readBuffer fileSize:(long)fileSize mapFileInfoBuilder:(MapFileInfoBuilder *)mapFileInfoBuilder; 27 | - (void) updateZoomLevelInformation:(SubFileParameter *)subFileParameter; 28 | @end 29 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/MapFileInfoBuilder.h: -------------------------------------------------------------------------------- 1 | #import "BoundingBox.h" 2 | #import "MFTag.h" 3 | #import "OptionalFields.h" 4 | #import "MapFileInfo.h" 5 | 6 | @class MapFileInfo, OptionalFields; 7 | 8 | @interface MapFileInfoBuilder : NSObject { 9 | @public 10 | BoundingBox * boundingBox; 11 | long long fileSize; 12 | int fileVersion; 13 | long long mapDate; 14 | char numberOfSubFiles; 15 | OptionalFields * optionalFields; 16 | NSArray * poiTags; 17 | NSString * projectionName; 18 | int tilePixelSize; 19 | NSArray * wayTags; 20 | } 21 | 22 | - (MapFileInfo *) build; 23 | @end 24 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/MapFileInfoBuilder.m: -------------------------------------------------------------------------------- 1 | #import "MapFileInfoBuilder.h" 2 | #import "MapFileInfo.h" 3 | 4 | @implementation MapFileInfoBuilder 5 | 6 | - (MapFileInfo *) build { 7 | return [[MapFileInfo alloc] initWithMapFileInfoBuilder:self];// autorelease]; 8 | } 9 | 10 | //- (void) dealloc { 11 | // [boundingBox release]; 12 | // [optionalFields release]; 13 | // [poiTags release]; 14 | // [projectionName release]; 15 | // [wayTags release]; 16 | // [super dealloc]; 17 | //} 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/OptionalFields.h: -------------------------------------------------------------------------------- 1 | #import "GeoPoint.h" 2 | #import "ReadBuffer.h" 3 | #import "MapFileInfoBuilder.h" 4 | #import "FileOpenResult.h" 5 | 6 | @class FileOpenResult, MapFileInfoBuilder; 7 | 8 | @interface OptionalFields : NSObject { 9 | @public 10 | NSString * comment; 11 | NSString * createdBy; 12 | BOOL hasComment; 13 | BOOL hasCreatedBy; 14 | BOOL hasLanguagePreference; 15 | BOOL hasStartPosition; 16 | BOOL hasStartZoomLevel; 17 | BOOL isDebugFile; 18 | NSString * languagePreference; 19 | GeoPoint * startPosition; 20 | NSNumber * startZoomLevel; 21 | } 22 | 23 | + (FileOpenResult *) readOptionalFields:(ReadBuffer *)readBuffer mapFileInfoBuilder:(MapFileInfoBuilder *)mapFileInfoBuilder; 24 | - (id) initWithFlags:(char)flags; 25 | - (FileOpenResult *) readOptionalFields:(ReadBuffer *)readBuffer; 26 | @end 27 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/SubFileParameterBuilder.h: -------------------------------------------------------------------------------- 1 | #import "BoundingBox.h" 2 | #import "SubFileParameter.h" 3 | 4 | @class SubFileParameter; 5 | 6 | @interface SubFileParameterBuilder : NSObject { 7 | @public 8 | Byte baseZoomLevel; 9 | BoundingBox * boundingBox; 10 | long long indexStartAddress; 11 | long long startAddress; 12 | long long subFileSize; 13 | Byte zoomLevelMax; 14 | Byte zoomLevelMin; 15 | } 16 | 17 | - (SubFileParameter *) build; 18 | @end 19 | -------------------------------------------------------------------------------- /MapsforgeReader/MapsforgeReader/map/reader/header/SubFileParameterBuilder.m: -------------------------------------------------------------------------------- 1 | #import "SubFileParameterBuilder.h" 2 | 3 | @implementation SubFileParameterBuilder 4 | 5 | - (SubFileParameter *) build { 6 | return [[SubFileParameter alloc] initWithSubFileParameterBuilder:self];// autorelease]; 7 | } 8 | 9 | //- (void) dealloc { 10 | //// [boundingBox release]; 11 | // [super dealloc]; 12 | //} 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /OpenStreetPad/OSP/OSP-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OpenStreetPad' target in the 'OSP' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /OpenStreetPad/OSPParserGenerator/OSPParserGenerator-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OSPParserGenerator' target in the 'OSPParserGenerator' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/NSString+XMLEscaping.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XMLEscaping.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 04/03/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (XMLEscaping) 12 | 13 | - (id)stringByAddingXMLEscaping; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPDataSource.h 3 | // 4 | // 5 | // Created by Thomas Davie on 25/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPCoordinateRect.h" 12 | 13 | #import "OSPAPIObject.h" 14 | 15 | @class OSPDataSource; 16 | 17 | @protocol OSPDataProvider 18 | 19 | - (NSSet *)objectsInBounds:(OSPCoordinateRect)bounds; 20 | - (NSSet *)allObjects; 21 | 22 | @end 23 | 24 | @protocol OSPDataSourceDelegate 25 | 26 | - (void)dataSource:(OSPDataSource *)mapServer didLoadObjectsInArea:(OSPCoordinateRect)area; 27 | - (BOOL)dataSource:(OSPDataSource *)mapServer shouldLoadObjectsInArea:(OSPCoordinateRect)area; 28 | 29 | @end 30 | 31 | @interface OSPDataSource : NSObject 32 | 33 | @property (readwrite, weak) id delegate; 34 | 35 | - (void)loadObjectsInBounds:(OSPCoordinateRect)bounds withOutset:(double)outsetSize; 36 | -(void) loadObjectsFromFile:(NSString*)resource; 37 | -(void) loadObjectsFromData:(NSData*)data; 38 | -(void) loadObjectsForTileX:(int)x Y:(int)y zoom:(int)zoom; 39 | -(void) resetObjects; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPDataStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPDataStore.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 28/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol OSPDataStore 12 | 13 | - (void)addObject:(OSPAPIObject *)apiObject; 14 | 15 | @end 16 | 17 | @protocol OSPPersistingStore 18 | 19 | - (void)save; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPMapServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapServer.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 07/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPDataSource.h" 12 | 13 | @interface OSPMapServer : OSPDataSource 14 | 15 | + (id)serverWithURL:(NSURL *)serverURL; 16 | - (id)initWithURL:(NSURL *)serverURL; 17 | 18 | @property (readonly , copy) NSURL *serverURL; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPOSMFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPOSMFile.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 28/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPDataSource.h" 12 | 13 | #import "OSPDataStore.h" 14 | 15 | @interface OSPOSMFile : OSPDataSource 16 | 17 | + (id)osmFileWithPath:(NSString *)path; 18 | - (id)initWithPath:(NSString *)path; 19 | 20 | @property (readwrite, strong) NSString *path; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPOSMParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPOSMParser.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 28/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPAPIObject.h" 12 | 13 | @class OSPOSMParser; 14 | 15 | @protocol OSPOSMParserDelegate 16 | 17 | - (void)parser:(OSPOSMParser *)parser didFindAPIObject:(OSPAPIObject *)object; 18 | - (void)parser:(OSPOSMParser *)parser didFailWithError:(NSError *)error; 19 | - (void)parserDidEndDocument:(OSPOSMParser *)parser; 20 | 21 | @end 22 | 23 | @interface OSPOSMParser : NSObject 24 | 25 | @property (readwrite, weak) id delegate; 26 | 27 | - (id)initWithStream:(NSInputStream *)stream; 28 | 29 | - (void)parse; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPOSMWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPOSMWriter.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 03/03/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPDataSource.h" 12 | 13 | @interface OSPOSMWriter : NSObject 14 | 15 | - (id)initWithStream:(NSOutputStream *)stream; 16 | 17 | - (void)writeDataProvider:(id)dataProvider; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPPBFFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPPBFFile.h 3 | // OpenStreetPad 4 | // 5 | // Created by Nikita Medvedev on 3/12/12. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPDataSource.h" 12 | #import "OSPDataStore.h" 13 | 14 | #import "Osmformat.pb.h" 15 | #import "Fileformat.pb.h" 16 | 17 | @interface OSPPBFFile : OSPDataSource 18 | 19 | +(id) pbfFileWithFile:(NSString *)path; 20 | -(id) initWithFile:(NSString*)path; 21 | 22 | -(void) loadObjectsFromFile:(NSString *)resource; 23 | -(void) loadObjectsFromData:(NSData*)data; 24 | 25 | @property (readwrite, strong) NSString *path; 26 | @property (readwrite, strong) id cache; 27 | 28 | @end -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/DataSources/OSPXMLWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPXMLWriter.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 03/03/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OSPXMLWriter : NSObject 12 | 13 | + (id)xmlWriterWithOutputStream:(NSOutputStream *)outputStream encoding:(NSStringEncoding)encoding; 14 | - (id)initWithOutputStream:(NSOutputStream *)outputStream encoding:(NSStringEncoding)encoding; 15 | 16 | @property (strong) NSOutputStream *outputStream; 17 | 18 | - (void)writeElement:(NSString *)element; 19 | - (void)writeElement:(NSString *)element withAttributes:(NSDictionary *)attributes; 20 | 21 | - (void)writeStartElement:(NSString *)element; 22 | - (void)writeStartElement:(NSString *)element withAttributes:(NSDictionary *)attributes; 23 | - (void)writeEndElement; 24 | 25 | - (void)writeText:(NSString *)text; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPAPIObjectReference.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPAPIObjectReference.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 29/08/2011. 6 | // Copyright (c) 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | #import "OSPMember.h" 12 | 13 | @interface OSPAPIObjectReference : OSPAPIObject 14 | 15 | + (id)apiObjectReferenceWithType:(OSPMemberType)type identity:(NSInteger)identity; 16 | - (id)initWithType:(OSPMemberType)type identity:(NSInteger)identity; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPAPIObjectReference.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPAPIObjectReference.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 29/08/2011. 6 | // Copyright (c) 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObjectReference.h" 10 | 11 | @interface OSPAPIObjectReference () 12 | 13 | @property (readwrite, assign) OSPMemberType type; 14 | 15 | @end 16 | 17 | @implementation OSPAPIObjectReference 18 | 19 | @synthesize type; 20 | 21 | + (id)apiObjectReferenceWithType:(OSPMemberType)type identity:(NSInteger)identity 22 | { 23 | return [[self alloc] initWithType:type identity:identity]; 24 | } 25 | 26 | - (id)initWithType:(OSPMemberType)initType identity:(NSInteger)identity 27 | { 28 | self = [super initUnsafely]; 29 | 30 | if (nil != self) 31 | { 32 | [self setType:initType]; 33 | [self setIdentity:identity]; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (OSPMemberType)memberType 40 | { 41 | return [self type]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPMember.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMember.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | #import "OSPMap.h" 12 | 13 | @class OSPRelation; 14 | 15 | @interface OSPMember : NSObject 16 | 17 | + (id)memberWithType:(OSPMemberType)memberType referencedObjectId:(NSInteger)referenceId role:(NSString *)role; 18 | - (id)initWithType:(OSPMemberType)memberType referencedObjectId:(NSInteger)referenceId role:(NSString *)role; 19 | 20 | @property (nonatomic, readwrite, assign) OSPMemberType referencedObjectType; 21 | @property (nonatomic, readwrite, assign) NSInteger referencedObjectId; 22 | @property (nonatomic, readwrite, retain/*copy*/ ) NSString *role; 23 | @property (nonatomic, readwrite, /*weak*/assign ) OSPRelation *relation; 24 | 25 | @property (nonatomic, readonly) OSPAPIObject *referencedObject; 26 | 27 | @property (nonatomic, readonly) OSPCoordinateRect bounds; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPNode.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | #import 12 | 13 | @interface OSPNode : OSPAPIObject 14 | 15 | @property (/*nonatomic,*/ readwrite, assign) CLLocationCoordinate2D location; 16 | @property (/*nonatomic,*/ readonly , assign) OSPCoordinate2D projectedLocation; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPNode.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPNode.h" 10 | 11 | @interface OSPNode () 12 | 13 | @property (/*nonatomic,*/readwrite,assign) OSPCoordinate2D projectedLocation; 14 | 15 | @end 16 | 17 | @implementation OSPNode 18 | 19 | @synthesize location; 20 | @synthesize projectedLocation; 21 | 22 | - (CLLocationCoordinate2D)location 23 | { 24 | @synchronized(self) 25 | { 26 | return location; 27 | } 28 | } 29 | 30 | - (void)setLocation:(CLLocationCoordinate2D)newLocation 31 | { 32 | @synchronized(self) 33 | { 34 | location = newLocation; 35 | [self setProjectedLocation:OSPCoordinate2DProjectLocation(CLLocationCoordinate2DMake(location.latitude/1000000, location.longitude/1000000))]; 36 | } 37 | } 38 | 39 | - (OSPCoordinateRect)bounds 40 | { 41 | return OSPCoordinateRectMake(projectedLocation.x, projectedLocation.y, 0.0, 0.0); 42 | } 43 | 44 | - (OSPMemberType)memberType 45 | { 46 | return OSPMemberTypeNode; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPRelation.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPRelation.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | @class OSPMember; 12 | 13 | @interface OSPRelation : OSPAPIObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *members; 16 | 17 | - (void)addMember:(OSPMember *)member; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/API/OSPWay.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPWay.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | @interface OSPWay : OSPAPIObject 12 | { 13 | @public 14 | int **cNodes; 15 | int *cLength; 16 | float *labelPosition; 17 | int nodesCount; 18 | BOOL isArea; 19 | NSString *name; 20 | } 21 | 22 | @property (nonatomic, readwrite,retain/*strong*/) NSArray *nodes; 23 | @property (nonatomic, readwrite,retain/*strong*/) NSArray *nodeObjects; 24 | //@property (nonatomic, retain/*strong*/) NSString *area; 25 | @property (nonatomic, retain/*strong*/) NSString *name; 26 | 27 | - (void)addNodeWithId:(NSInteger)nodeId; 28 | 29 | - (OSPCoordinate2D)projectedCentroid; 30 | 31 | - (double)length; 32 | - (double)textOffsetForTextWidth:(double)width; 33 | - (OSPCoordinate2D)positionOnWayWithOffset:(double)xOffset heightAboveWay:(double)yOffset backwards:(BOOL)backwards; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/NSString+OpenStreetPad.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+OpenStreetPad.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 05/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (OpenStreetPad) 12 | 13 | - (BOOL)ospTruthValue; 14 | - (BOOL)ospUntruthValue; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/NSString+OpenStreetPad.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+OpenStreetPad.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 05/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "NSString+OpenStreetPad.h" 10 | 11 | @implementation NSString (OpenStreetPad) 12 | 13 | - (BOOL)ospTruthValue 14 | { 15 | NSString *l = [self lowercaseString]; 16 | return [l isEqual:@"yes"] || [l isEqual:@"true"] || [l isEqual:@"1"]; 17 | } 18 | 19 | - (BOOL)ospUntruthValue 20 | { 21 | NSString *l = [self lowercaseString]; 22 | return [l isEqual:@"no"] || [l isEqual:@"false"]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSBinaryTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // BinaryTest.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSTest.h" 10 | 11 | #import "OSPMapCSSTag.h" 12 | 13 | typedef enum 14 | { 15 | OSPMapCSSBinaryOperatorEquals, 16 | OSPMapCSSBinaryOperatorNotEquals, 17 | OSPMapCSSBinaryOperatorMatches, 18 | OSPMapCSSBinaryOperatorGreaterThan, 19 | OSPMapCSSBinaryOperatorLessThan, 20 | OSPMapCSSBinaryOperatorGreaterThanOrEqual, 21 | OSPMapCSSBinaryOperatorLessThanOrEqual 22 | } OSPMapCSSBinaryOperator; 23 | 24 | OSPMapCSSBinaryOperator OSPMapCSSBinaryOperatorFromNSString(NSString *s); 25 | NSString *NSStringFromOSPMapCSSBinaryOperator(OSPMapCSSBinaryOperator o); 26 | 27 | @interface OSPMapCSSBinaryTest : OSPMapCSSTest 28 | 29 | @property (nonatomic, readwrite, strong) NSString *tagName; 30 | @property (nonatomic, readwrite, assign) OSPMapCSSBinaryOperator operator; 31 | @property (nonatomic, readwrite, retain/*copy*/) NSString *value; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSClass.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSClass : NSObject 14 | 15 | @property (nonatomic, readwrite, assign) BOOL positive; 16 | @property (nonatomic, readwrite, retain/*copy*/ ) NSString *className; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSClass.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSClass.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSClass.h" 10 | 11 | @implementation OSPMapCSSClass 12 | 13 | @synthesize positive; 14 | @synthesize className; 15 | 16 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 17 | { 18 | self = [super init]; 19 | 20 | if (nil != self) 21 | { 22 | BOOL pos = [[syntaxTree children] count] == 2; 23 | [self setPositive:pos]; 24 | [self setClassName:[[[[[syntaxTree children] objectAtIndex:pos ? 0 : 1] children] objectAtIndex:1] identifier]]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSColour.h: -------------------------------------------------------------------------------- 1 | // 2 | // Colour.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSColour : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSColourSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColourSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifier.h" 10 | 11 | @interface OSPMapCSSColourSpecifier : OSPMapCSSSpecifier 12 | 13 | #if TARGET_OS_IPHONE 14 | @property (nonatomic, readwrite, retain) UIColor *colour; 15 | 16 | - (id)initWithColour:(UIColor *)colour; 17 | #endif 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSelector.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommaSelector.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSCommaSelector : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSelector.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommaSelector.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSCommaSelector.h" 10 | 11 | @implementation OSPMapCSSCommaSelector 12 | 13 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 14 | { 15 | return [[syntaxTree children] objectAtIndex:1]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommaSize.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSCommaSize : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSize.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommaSize.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSCommaSize.h" 10 | 11 | @implementation OSPMapCSSCommaSize 12 | 13 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 14 | { 15 | return [[syntaxTree children] objectAtIndex:1]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSCommaSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSCommaSpecifier : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSCommaSpecifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSCommaSpecifier.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSCommaSpecifier.h" 10 | 11 | @implementation OSPMapCSSCommaSpecifier 12 | 13 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 14 | { 15 | return [[syntaxTree children] objectAtIndex:1]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSDeclaration.h: -------------------------------------------------------------------------------- 1 | // 2 | // Declaration.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSDeclaration : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *styles; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSDeclaration.m: -------------------------------------------------------------------------------- 1 | // 2 | // Declaration.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSDeclaration.h" 10 | 11 | #import "OSPMapCSSStyle.h" 12 | 13 | @implementation OSPMapCSSDeclaration 14 | 15 | @synthesize styles; 16 | 17 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 18 | { 19 | self = [super init]; 20 | 21 | if (nil != self) 22 | { 23 | [self setStyles:[[syntaxTree children] objectAtIndex:1]]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (NSString *)description 30 | { 31 | NSMutableString *desc = [NSMutableString stringWithString:@"{\n"]; 32 | 33 | for (OSPMapCSSStyle *style in [self styles]) 34 | { 35 | [desc appendFormat:@" %@\n", style]; 36 | } 37 | [desc appendString:@"}"]; 38 | return desc; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSEval.h: -------------------------------------------------------------------------------- 1 | // 2 | // Eval.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSEval : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *expression; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSEval.m: -------------------------------------------------------------------------------- 1 | // 2 | // Eval.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSEval.h" 10 | 11 | @implementation OSPMapCSSEval 12 | 13 | @synthesize expression; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super init]; 18 | 19 | if (nil != self) 20 | { 21 | [self setExpression:[[[syntaxTree children] objectAtIndex:2] content]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSEvalSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // EvalSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifier.h" 10 | 11 | #import "OSPMapCSSEval.h" 12 | 13 | @interface OSPMapCSSEvalSpecifier : OSPMapCSSSpecifier 14 | 15 | @property (nonatomic, readwrite, retain) OSPMapCSSEval *eval; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSEvalSpecifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // EvalSpecifier.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSEvalSpecifier.h" 10 | 11 | @implementation OSPMapCSSEvalSpecifier 12 | 13 | @synthesize eval; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super initWithSyntaxTree:syntaxTree]; 18 | 19 | if (nil != self) 20 | { 21 | [self setEval:[[syntaxTree children] objectAtIndex:0]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (NSString *)description 28 | { 29 | return [NSString stringWithFormat:@"eval(\"%@\")", [[self eval] expression]]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // Import.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSImport : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *url; 16 | @property (nonatomic, readwrite, retain/*copy*/) NSString *mediaType; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSImport.m: -------------------------------------------------------------------------------- 1 | // 2 | // Import.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSImport.h" 10 | 11 | @implementation OSPMapCSSImport 12 | 13 | @synthesize url; 14 | @synthesize mediaType; 15 | 16 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 17 | { 18 | self = [super init]; 19 | 20 | if (nil != self) 21 | { 22 | [self setUrl:[[[syntaxTree children] objectAtIndex:3] content]]; 23 | [self setMediaType:[[[syntaxTree children] objectAtIndex:5] identifier]]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (NSString *)description 30 | { 31 | return [NSString stringWithFormat:@"@import url(\"%@\") %@\n", [self url], [self mediaType]]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // Key.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSKey : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *key; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // Key.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSKey.h" 10 | 11 | @implementation OSPMapCSSKey 12 | 13 | @synthesize key; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super init]; 18 | 19 | if (nil != self) 20 | { 21 | [self setKey:[[[syntaxTree children] objectAtIndex:0] identifier]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSNamed.h: -------------------------------------------------------------------------------- 1 | // 2 | // Named.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSNamed : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *name; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSNamed.m: -------------------------------------------------------------------------------- 1 | // 2 | // Named.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSNamed.h" 10 | 11 | @implementation OSPMapCSSNamed 12 | 13 | @synthesize name; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super init]; 18 | 19 | if (nil != self) 20 | { 21 | [self setName:[[[syntaxTree children] objectAtIndex:0] identifier]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSNamedSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapCSSSpecifier.h" 12 | 13 | @interface OSPMapCSSNamedSpecifier : OSPMapCSSSpecifier 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *name; 16 | 17 | - (id)initWithName:(NSString *)name; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSObject.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | typedef enum 14 | { 15 | OSPMapCSSObjectTypeNode, 16 | OSPMapCSSObjectTypeWay, 17 | OSPMapCSSObjectTypeRelation, 18 | OSPMapCSSObjectTypeArea, 19 | OSPMapCSSObjectTypeLine, 20 | OSPMapCSSObjectTypeCanvas, 21 | OSPMapCSSObjectTypeAll 22 | } OSPMapCSSObjectType; 23 | 24 | NSString *NSStringFromOSPMapCSSObjectType(OSPMapCSSObjectType t); 25 | OSPMapCSSObjectType OSPMapCSSObjectTypeFromNSString(NSString *s); 26 | 27 | @interface OSPMapCSSObject : NSObject 28 | 29 | @property (nonatomic, readwrite, assign) OSPMapCSSObjectType objectType; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSPlaceholderSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // PlaceholderSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 01/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifier.h" 10 | 11 | @interface OSPMapCSSPlaceholderSpecifier : OSPMapCSSSpecifier 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSPlaceholderTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // PlaceholderTest.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 01/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSTest.h" 10 | 11 | @interface OSPMapCSSPlaceholderTest : OSPMapCSSTest 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSPlaceholderTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // PlaceholderTest.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 01/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSPlaceholderTest.h" 10 | 11 | #import "OSPMapCSSUnaryTest.h" 12 | #import "OSPMapCSSBinaryTest.h" 13 | 14 | @implementation OSPMapCSSPlaceholderTest 15 | 16 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 17 | { 18 | CPSyntaxTree *condition = [[syntaxTree children] objectAtIndex:1]; 19 | switch ([[condition children] count]) 20 | { 21 | case 1: 22 | case 2: 23 | return (id)[[OSPMapCSSUnaryTest alloc] initWithSyntaxTree:condition]; 24 | case 3: 25 | return (id)[[OSPMapCSSBinaryTest alloc] initWithSyntaxTree:condition]; 26 | default: 27 | return nil; 28 | } 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSRule.h: -------------------------------------------------------------------------------- 1 | // 2 | // Rule.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPAPIObject.h" 12 | 13 | #import "CoreParse.h" 14 | 15 | @interface OSPMapCSSRule : NSObject 16 | 17 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *selectors; 18 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *declarations; 19 | 20 | - (NSDictionary *)applyToObject:(OSPAPIObject *)object atZoom:(float)zoom stop:(BOOL *)stop; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSRuleset.h: -------------------------------------------------------------------------------- 1 | // 2 | // Ruleset.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPAPIObject.h" 12 | 13 | //#import "CoreParse.h" 14 | 15 | @protocol CPParseResult; 16 | 17 | @interface OSPMapCSSRuleset : NSObject 18 | 19 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *rules; 20 | 21 | - (void)loadImportsRelativeToURL:(NSURL *)baseURL; 22 | 23 | - (NSDictionary *)applyToObject:(OSPAPIObject *)object atZoom:(float)zoom; 24 | - (NSDictionary *)styleForCanvasAtZoom:(float)zoom; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSelector.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSSelector.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 01/04/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | #import "OSPAPIObject.h" 14 | 15 | @interface OSPMapCSSSelector : NSObject 16 | 17 | @property (nonatomic, readwrite, strong) NSArray *subselectors; 18 | @property (nonatomic, readwrite, strong) NSString *layerIdentifier; 19 | 20 | - (BOOL)matchesObject:(OSPAPIObject *)object atZoom:(float)zoom; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // Size.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | typedef enum 14 | { 15 | OSPMapCSSUnitPt , 16 | OSPMapCSSUnitPx , 17 | OSPMapCSSUnitPercent, 18 | OSPMapCSSUnitNone 19 | } OSPMapCSSUnit; 20 | 21 | OSPMapCSSUnit OSPMapCSSUnitFromNSString(NSString *s); 22 | NSString *NSStringFromOSPMapCSSUnit(OSPMapCSSUnit u); 23 | 24 | @interface OSPMapCSSSize : NSObject 25 | 26 | @property (nonatomic, readwrite, assign) float value; 27 | @property (nonatomic, readwrite, assign) OSPMapCSSUnit unit; 28 | 29 | - (id)initWithValue:(NSNumber *)value units:(OSPMapCSSUnit)unit; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSizeSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // SizeListSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifier.h" 10 | 11 | #import "OSPMapCSSSize.h" 12 | 13 | @interface OSPMapCSSSizeSpecifier : OSPMapCSSSpecifier 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) OSPMapCSSSize *size; 16 | 17 | - (id)initWithSize:(OSPMapCSSSize *)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // Specifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | #import "OSPAPIObject.h" 14 | #import "OSPMapCSSSize.h" 15 | #import "OSPMapCSSUrl.h" 16 | 17 | @interface OSPMapCSSSpecifier : NSObject 18 | 19 | - (NSString *)stringValue; 20 | - (OSPMapCSSSize *)sizeValue; 21 | #if TARGET_OS_IPHONE 22 | - (UIColor *)colourValue; 23 | #endif 24 | - (OSPMapCSSUrl *)urlValue; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSpecifierList.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSSpecifierList.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSSpecifierList : NSObject 14 | 15 | @property (nonatomic, readwrite, strong) NSArray *specifiers; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSpecifierList.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSSpecifierList.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifierList.h" 10 | 11 | #import "OSPMapCSSSpecifier.h" 12 | 13 | @implementation OSPMapCSSSpecifierList 14 | 15 | @synthesize specifiers; 16 | 17 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 18 | { 19 | self = [super init]; 20 | 21 | if (nil != self) 22 | { 23 | NSMutableArray *allButOneChild = [[[syntaxTree children] objectAtIndex:1] mutableCopy]; 24 | [allButOneChild insertObject:[[syntaxTree children] objectAtIndex:0] atIndex:0]; 25 | [self setSpecifiers:allButOneChild]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (NSString *)description 32 | { 33 | NSMutableString *desc = [NSMutableString string]; 34 | 35 | NSUInteger specNum = 0; 36 | for (OSPMapCSSSpecifier *s in [self specifiers]) 37 | { 38 | [desc appendFormat:(specNum < [[self specifiers] count] - 1) ? @"%@, " : @"%@", s]; 39 | specNum++; 40 | } 41 | return desc; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Style.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | #import "OSPMapCSSSpecifierList.h" 13 | 14 | @class OSPMapCSSRule; 15 | 16 | @interface OSPMapCSSStyle : NSObject 17 | 18 | @property (nonatomic, readwrite, assign) BOOL containsRule; 19 | @property (nonatomic, readwrite, retain) OSPMapCSSRule *rule; 20 | @property (nonatomic, readwrite, assign, getter = isExit) BOOL exit; 21 | @property (nonatomic, readwrite, retain/*copy*/) NSString *key; 22 | @property (nonatomic, readwrite, retain) OSPMapCSSSpecifierList *specifiers; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSStyleSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSStyleSheet.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 05/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapCSSRuleset.h" 12 | 13 | #import "OSPAPIObject.h" 14 | 15 | @interface OSPMapCSSStyleSheet : NSObject 16 | 17 | @property (nonatomic, readwrite, retain/*strong*/) OSPMapCSSRuleset *ruleset; 18 | 19 | - (id)initWithRules:(OSPMapCSSRuleset *)ruleset; 20 | 21 | - (void)loadImportsRelativeToURL:(NSURL *)baseURL; 22 | 23 | - (NSArray *)styledObjects:(NSMutableArray *)objects atZoom:(float)zoom; 24 | - (NSDictionary *)styleForCanvasAtZoom:(float)zoom; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSStyledObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSStyledObject.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPAPIObject.h" 10 | 11 | @interface OSPMapCSSStyledObject : NSObject 12 | { 13 | @public 14 | float z; 15 | int level; 16 | } 17 | 18 | @property (nonatomic, readwrite,assign/*weak*/) OSPAPIObject *object; 19 | @property (nonatomic, readwrite, retain/*copy*/) NSDictionary *style; 20 | 21 | + (id)object:(OSPAPIObject *)o withStyle:(NSDictionary *)style; 22 | - (id)initWithObject:(OSPAPIObject *)o style:(NSDictionary *)style; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSStyledObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSStyledObject.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSStyledObject.h" 10 | #import "OSPMapCSSSize.h" 11 | #import "OSPMapCSSSpecifierList.h" 12 | #import "OSPMapCSSSizeSpecifier.h" 13 | 14 | @implementation OSPMapCSSStyledObject 15 | 16 | @synthesize object; 17 | @synthesize style; 18 | 19 | + (id)object:(OSPAPIObject *)o withStyle:(NSDictionary *)style 20 | { 21 | return [[self alloc] initWithObject:o style:style];// autorelease]; 22 | } 23 | 24 | - (id)initWithObject:(OSPAPIObject *)o style:(NSDictionary *)s 25 | { 26 | self = [super init]; 27 | 28 | if (nil != self) 29 | { 30 | [self setObject:o]; 31 | [self setStyle:s]; 32 | z = -1; 33 | // z = (float)[(OSPMapCSSSize*)[(OSPMapCSSSizeSpecifier*)[[(OSPMapCSSSpecifierList*)[s objectForKey:@"z-index"] specifiers] objectAtIndex:0] sizeValue] value]; 34 | // level = [[[o tags] objectForKey:@"layer"] intValue]; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSSubselector.h: -------------------------------------------------------------------------------- 1 | // 2 | // Subselector.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 02/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | #import "OSPMapCSSClass.h" 14 | #import "OSPMapCSSObject.h" 15 | 16 | #import "OSPAPIObject.h" 17 | 18 | @interface OSPMapCSSSubselector : NSObject 19 | 20 | @property (nonatomic, readwrite, assign) OSPMapCSSObjectType objectType; 21 | @property (nonatomic, readwrite, assign, getter=isConstrainedToZoomRange) BOOL constrainedToZoomRange; 22 | @property (nonatomic, readwrite, assign) float minimumZoom; 23 | @property (nonatomic, readwrite, assign) float maximumZoom; 24 | @property (nonatomic, readwrite, retain/*copy*/) NSArray *tests; 25 | @property (nonatomic, readwrite, strong) OSPMapCSSClass *requiredClass; 26 | 27 | - (BOOL)matchesObject:(OSPAPIObject *)object atZoom:(float)zoom; 28 | - (BOOL)zoomIsInRange:(float)zoom; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTag.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tag.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSTag : NSObject 14 | 15 | @property (nonatomic, readwrite, assign, getter = isPseudoTag) BOOL pseudoTag; 16 | @property (nonatomic, readwrite, copy) NSArray *keys; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTagSpec.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSTagSpec.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSTagSpec : NSObject 14 | 15 | @property (nonatomic, readwrite, retain/*copy*/) NSString *tag; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTagSpec.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSTagSpec.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSTagSpec.h" 10 | 11 | @implementation OSPMapCSSTagSpec 12 | 13 | @synthesize tag; 14 | 15 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 16 | { 17 | self = [super init]; 18 | 19 | if (nil != self) 20 | { 21 | [self setTag:[[[syntaxTree children] objectAtIndex:2] content]]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTagSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSTagSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/02/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | #import "OSPMapCSSSpecifier.h" 14 | #import "OSPMapCSSTagSpec.h" 15 | 16 | @interface OSPMapCSSTagSpecifier : OSPMapCSSSpecifier 17 | 18 | @property (nonatomic, readwrite, retain) OSPMapCSSTagSpec *tag; 19 | 20 | - (OSPMapCSSSpecifier *)specifierWithAPIObject:(OSPAPIObject *)object; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Test.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPAPIObject.h" 12 | 13 | #import "CoreParse.h" 14 | 15 | @interface OSPMapCSSTest : NSObject 16 | 17 | - (BOOL)matchesObject:(OSPAPIObject *)object; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // Test.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSTest.h" 10 | 11 | #import "OSPMapCSSPlaceholderTest.h" 12 | 13 | @implementation OSPMapCSSTest 14 | 15 | + (id)allocWithZone:(NSZone *)zone 16 | { 17 | return self == [OSPMapCSSTest class] ? [OSPMapCSSPlaceholderTest allocWithZone:zone] : [super allocWithZone:zone]; 18 | } 19 | 20 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 21 | { 22 | return [super init]; 23 | } 24 | 25 | - (BOOL)matchesObject:(OSPAPIObject *)object 26 | { 27 | return NO; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSURLSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // URLSpecifier.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSSpecifier.h" 10 | 11 | #import "OSPMapCSSUrl.h" 12 | 13 | @interface OSPMapCSSURLSpecifier : OSPMapCSSSpecifier 14 | 15 | @property (nonatomic, readwrite, retain) OSPMapCSSUrl *url; 16 | 17 | - (id)initWithURL:(OSPMapCSSUrl *)url; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSUnaryTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // UnaryTest.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSTest.h" 10 | 11 | #import "OSPMapCSSTag.h" 12 | 13 | @interface OSPMapCSSUnaryTest : OSPMapCSSTest 14 | 15 | @property (nonatomic, readwrite, assign, getter=isNegated) BOOL negated; 16 | @property (nonatomic, readwrite, strong) NSString *tagName; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSUrl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Url.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSUrl : NSObject 14 | 15 | @property (nonatomic, readwrite, strong) NSURL *content; 16 | 17 | - (id)initWithURL:(NSURL *)url; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSUrl.m: -------------------------------------------------------------------------------- 1 | // 2 | // Url.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 31/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSUrl.h" 10 | 11 | #import "OSPMapCSSEval.h" 12 | 13 | @implementation OSPMapCSSUrl 14 | 15 | @synthesize content; 16 | 17 | - (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree 18 | { 19 | self = [super init]; 20 | 21 | if (nil != self) 22 | { 23 | NSArray *c = [syntaxTree children]; 24 | [self setContent:[NSURL URLWithString:[[c objectAtIndex:[c count] == 1 ? 0 : 2] content]]]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (id)initWithURL:(NSURL *)url 31 | { 32 | self = [super init]; 33 | 34 | if (nil != self) 35 | { 36 | [self setContent:url]; 37 | } 38 | 39 | return self; 40 | } 41 | 42 | - (NSString *)description 43 | { 44 | return [NSString stringWithFormat:@"url(\"%@\")", [self content]]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/MapCSS/OSPMapCSSZoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // Zoom.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 01/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CoreParse.h" 12 | 13 | @interface OSPMapCSSZoom : NSObject 14 | 15 | @property (nonatomic, readwrite, assign) float minimumZoom; 16 | @property (nonatomic, readwrite, assign) float maximumZoom; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMap.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPDataSource.h" 12 | #import "OSPDataStore.h" 13 | 14 | #import "OSPAPIObject.h" 15 | 16 | #import "OSPNode.h" 17 | #import "OSPWay.h" 18 | #import "OSPRelation.h" 19 | #import "OSPMember.h" 20 | 21 | @interface OSPMap : NSObject 22 | 23 | - (OSPNode *)nodeWithId:(NSInteger)nodeId; 24 | - (OSPWay *)wayWithId:(NSInteger)wayId; 25 | - (OSPRelation *)relationWithId:(NSInteger)relationId; 26 | - (OSPAPIObject *)apiObjectOfType:(OSPMemberType)type withId:(NSInteger)objectId; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPMapArea.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapArea.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 13/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | 10 | #import "OSPCoordinateRect.h" 11 | 12 | typedef struct 13 | { 14 | OSPCoordinate2D centre; 15 | float zoomLevel; 16 | } OSPMapArea; 17 | 18 | OSPMapArea OSPMapAreaMake(OSPCoordinate2D centre, float zoomLevel); 19 | 20 | OSPCoordinateRect OSPRectForMapAreaInRect(OSPMapArea area, CGRect bounds); 21 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPMapArea.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapArea.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 13/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPMapArea.h" 10 | 11 | #define OSPTileSize 256.0 12 | 13 | inline OSPMapArea OSPMapAreaMake(OSPCoordinate2D centre, float zoomLevel) 14 | { 15 | return (OSPMapArea){.centre = centre, .zoomLevel = zoomLevel}; 16 | } 17 | 18 | inline OSPCoordinateRect OSPRectForMapAreaInRect(OSPMapArea area, CGRect bounds) 19 | { 20 | double coveragePerPixel = 1.0 / (pow(2.0, area.zoomLevel) * OSPTileSize); 21 | double width = CGRectGetWidth(bounds); 22 | double height = CGRectGetHeight(bounds); 23 | double projectedWidth = coveragePerPixel * width; 24 | double projectedHeight = coveragePerPixel * height; 25 | return OSPCoordinateRectMake(area.centre.x - projectedWidth * 0.5, area.centre.y - projectedHeight * 0.5, projectedWidth, projectedHeight); 26 | } 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPMaths.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMaths.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 13/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #define degreesToRadians(x) (M_PI * x / 180.0) 10 | #define radiansToDegrees(x) (180.0 * x / M_PI) 11 | 12 | double normalisedRadians(double angle); 13 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPMaths.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMaths.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 13/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import "OSPMaths.h" 10 | 11 | double normalisedRadians(double angle) 12 | { 13 | const double a = fmod(angle, 2.0 * M_PI); 14 | return a < -M_PI ? 2.0 * M_PI + a : a > M_PI ? a - 2.0 * M_PI : a; 15 | } 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPNonRectangularArea.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPNonRectangularArea.h 3 | // OpenStreetPad 4 | // 5 | // Created by Tom Davie on 04/09/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPCoordinateRect.h" 12 | 13 | @interface OSPNonRectangularArea : NSObject 14 | 15 | + (id)emptyArea; 16 | + (id)areaWithRects:(NSArray *)rects; 17 | 18 | - (id)initWithRects:(NSArray *)rects; 19 | 20 | - (OSPNonRectangularArea *)areaBySubtractingArea:(OSPNonRectangularArea *)other; 21 | 22 | - (void)addRect:(OSPCoordinateRect)rect; 23 | 24 | - (NSArray *)allRects; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPQuadTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPQuadTree.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPCoordinateRect.h" 12 | 13 | @interface OSPQuadTree : NSObject 14 | 15 | - (id)initWithBounds:(OSPCoordinateRect)initBounds; 16 | 17 | - (void)addObject:(id)o; 18 | 19 | - (NSSet *)objectsInBounds:(OSPCoordinateRect)bounds; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPTileArray.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPTileArray.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 21/01/2012. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPCoordinateRect.h" 12 | 13 | @interface OSPTileArray : NSObject 14 | 15 | - (void)addTile:(OSPTile)t; 16 | - (BOOL)containsTile:(OSPTile)t; 17 | - (NSArray *)notIncludedSubtilesOfTile:(OSPTile)t; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/Model/OSPValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPValue.h 3 | // OpenStreetPad 4 | // 5 | // Created by Tom Davie on 04/09/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPCoordinateRect.h" 12 | 13 | @interface OSPValue : NSObject 14 | 15 | + (id)valueWithRect:(OSPCoordinateRect)rect; 16 | + (id)valueWithTile:(OSPTile)tile; 17 | 18 | - (OSPCoordinateRect)rectValue; 19 | - (OSPTile)tileValue; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenStreetPadAppDelegate.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class OSPMainViewController; 12 | 13 | @interface OSPAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) OSPMainViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenStreetPadViewController.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OSPMainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapCSSHashColourRecogniser.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSHashColourRecogniser.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE 10 | #import "CoreParse.h" 11 | #else 12 | #import 13 | #endif 14 | 15 | @interface OSPMapCSSHashColourRecogniser : NSObject 16 | 17 | + (id)hashColourRecogniser; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapCSSHashColourToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSHashColourToken.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE 10 | #import 11 | 12 | #import "CoreParse.h" 13 | #else 14 | #import 15 | #endif 16 | 17 | @interface OSPMapCSSHashColourToken : CPToken 18 | 19 | #if TARGET_OS_IPHONE 20 | @property (nonatomic, readwrite,retain) UIColor *colour; 21 | #endif 22 | 23 | + (id)tokenWithRed:(uint8_t)r green:(uint8_t)g blue:(uint8_t)b; 24 | - (id)initWithRed:(uint8_t)r green:(uint8_t)g blue:(uint8_t)b; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapCSSHashColourToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSHashColourToken.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 20/11/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import "OSPMapCSSHashColourToken.h" 10 | 11 | @implementation OSPMapCSSHashColourToken 12 | 13 | #if TARGET_OS_IPHONE 14 | @synthesize colour; 15 | #endif 16 | 17 | + (id)tokenWithRed:(uint8_t)r green:(uint8_t)g blue:(uint8_t)b 18 | { 19 | return [[self alloc] initWithRed:r green:g blue:b]; 20 | } 21 | 22 | - (id)initWithRed:(uint8_t)r green:(uint8_t)g blue:(uint8_t)b 23 | { 24 | self = [super init]; 25 | 26 | if (nil != self) 27 | { 28 | #if TARGET_OS_IPHONE 29 | [self setColour:[UIColor colorWithRed:(CGFloat)r / 255.0f green:(CGFloat)g / 255.0f blue:(CGFloat)b / 255.0f alpha:1.0f]]; 30 | #endif 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (NSString *)name 37 | { 38 | return @"HashColour"; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapCSSParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapCSSParser.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 29/10/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapCSSStyleSheet.h" 12 | 13 | @interface OSPMapCSSParser : NSObject 14 | 15 | - (OSPMapCSSStyleSheet *)parse:(NSString *)mapCSS; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapLoader.h 3 | // OpenStreetPad 4 | // 5 | // Created by Nikita Medvedev on 4/28/12. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MapDatabase.h" 12 | #import "MapDatabaseCallback.h" 13 | 14 | #import "OSPMapArea.h" 15 | 16 | @interface OSPMapLoader : NSObject 17 | 18 | @property (nonatomic, retain) NSMutableArray *mapObjects; 19 | @property (nonatomic) OSPMapArea mapArea; 20 | 21 | - (id) initWithFile:(NSString*)path; 22 | 23 | - (void) executeQueryForTileX:(int)x Y:(int)y Zoom:(int)zoom; 24 | 25 | - (void) renderPointOfInterest:(char)layer latitude:(int)latitude longitude:(int)longitude tags:(NSMutableArray *)tags; 26 | - (void) renderWaterBackground; 27 | - (void) renderWay:(char)layer labelPosition:(float *)labelPosition tags:(NSMutableArray *)tags wayNodes:(float**)wayNodes; 28 | 29 | - (void) addNode:(int)nodeId latitude:(int)latitude longitude:(int)longitude tags:(NSMutableDictionary *)tags; 30 | - (void) addWay:(int)wayId nodes:(int **)nodes length:(int*)length labelPosition:(float *)labelPosition tags:(NSMutableDictionary *)tags layer:(int)layer; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMapView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMapView.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "OSPMapArea.h" 13 | #import "OSPMetaTileView.h" 14 | 15 | #import "OSPMapCSSStyleSheet.h" 16 | 17 | @interface OSPMapView : UIView 18 | 19 | @property (readwrite, nonatomic, assign) OSPMapArea mapArea; 20 | @property (readwrite, nonatomic, strong) OSPMapCSSStyleSheet *stylesheet; 21 | 22 | - (id)initWithFrame:(CGRect)frame serverURL:(NSURL *)serverURL mapBounds:(OSPMapArea)mapArea; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPMetaTileView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPMetaTileView.h 3 | // OpenStreetPad 4 | // 5 | // Created by Tom Davie on 04/09/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapServer.h" 12 | 13 | #import "OSPMapArea.h" 14 | 15 | #import "OSPMapCSSStyleSheet.h" 16 | 17 | @interface OSPMetaTileView : UIView 18 | 19 | @property (readwrite, nonatomic, strong) OSPDataSource *dataSource; 20 | @property (readwrite, nonatomic, assign) OSPMapArea mapArea; 21 | 22 | @property (readwrite, strong) OSPMapCSSStyleSheet *stylesheet; 23 | 24 | - (void)setNeedsDisplayInMapArea:(OSPCoordinateRect)area; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPRenderer.h 3 | // OpenStreetPad 4 | // 5 | // Created by Nikita Medvedev on 3/29/12. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapCSSStyleSheet.h" 12 | #import "OSPMapArea.h" 13 | #import "OSPTagDictionary.h" 14 | 15 | @interface OSPRenderer : NSObject 16 | 17 | @property (readwrite, nonatomic, retain/*strong*/) OSPMapCSSStyleSheet *stylesheet; 18 | @property (nonatomic) OSPMapArea mapArea; 19 | @property (nonatomic) int objectsNumber; 20 | @property (nonatomic, retain) NSString *resource; 21 | 22 | - (id) initWithFile:(NSString*)path; 23 | 24 | - (UIImage*) imageForTileX:(int)x Y:(int)y zoom:(int)zoom; 25 | - (UIImage *) renderImageAtZoom:(int)zoom; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPRendererGL.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPRendererGL.h 3 | // OpenStreetPad 4 | // 5 | // Created by Nikita Medvedev on 6/7/12. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPMapCSSStyleSheet.h" 12 | #import "OSPMapArea.h" 13 | 14 | @interface OSPRendererGL : NSObject 15 | 16 | @property (readwrite, nonatomic, retain) OSPMapCSSStyleSheet *stylesheet; 17 | @property (nonatomic) OSPMapArea mapArea; 18 | @property (nonatomic) int objectsNumber; 19 | @property (nonatomic, retain) NSString *resource; 20 | 21 | - (id) initWithFile:(NSString*)path; 22 | 23 | - (UIImage*) imageForTileX:(int)x Y:(int)y zoom:(int)zoom; 24 | - (UIImage *) renderImageAtZoom:(int)zoom; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OSPTagDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSPTagDictionary.h 3 | // OpenStreetPad 4 | // 5 | // Created by Nikita Medvedev on 4/12/12. 6 | // Copyright (c) 2012 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OSPTagDictionary : NSObject 12 | 13 | +(int)getNumberForKey:(NSString*)string; 14 | +(int)getNumberForValue:(NSString*)string; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/OpenStreetPad-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OpenStreetPad' target in the 'OpenStreetPad' project 3 | // 4 | 5 | #import 6 | #import "ProtocolBuffers.h" 7 | 8 | #ifndef __IPHONE_4_0 9 | #warning "This project uses features only available in iOS SDK 4.0 and later." 10 | #endif 11 | 12 | #ifdef __OBJC__ 13 | #import 14 | #import 15 | #endif 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/UIColor+CSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+CSS.h 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 30/12/2011. 6 | // Copyright (c) 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (CSS) 12 | 13 | + (id)colourWithCSSName:(NSString *)colourName; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/fills/forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/fills/forest.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/fills/graveyard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/fills/graveyard.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/fills/jam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/fills/jam.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/fills/military.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/fills/military.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/icons/atm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/icons/atm.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/icons/parking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/icons/parking.png -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/landuse.mcs: -------------------------------------------------------------------------------- 1 | way[landuse] 2 | { 3 | z-index: -5; 4 | 5 | area[landuse="military"] 6 | { 7 | fill-image: url("fills/military.png"); 8 | width: 3pt; 9 | color: rgb(1.0, 0.46, 0.47); 10 | } 11 | 12 | area[landuse="residential"] 13 | { 14 | fill-color: rgba(0.9, 0.9, 0.9, 0.5); 15 | } 16 | 17 | area[landuse="retail"] 18 | { 19 | fill-color: rgb(0.94, 0.85, 0.85); 20 | color: rgb(0.95, 0.7, 0.7); 21 | width: 1pt; 22 | } 23 | 24 | area[landuse="forest"] 25 | { 26 | fill-image: url("fills/forest.png"); 27 | } 28 | 29 | area[landuse="cemetery"] 30 | { 31 | fill-image: url("fills/graveyard.png"); 32 | } 33 | 34 | area[landuse="railway"], 35 | area[landuse="industrial"] 36 | { 37 | fill-color: rgb(0.87, 0.82, 0.84); 38 | z-index: -4; 39 | } 40 | 41 | area[landuse="landfill"] 42 | { 43 | fill-color: rgb(0.72, 0.71, 0.58); 44 | } 45 | 46 | exit; 47 | } 48 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OpenStreetPad 4 | // 5 | // Created by Thomas Davie on 06/08/2011. 6 | // Copyright 2011 Thomas Davie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OSPAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool 16 | { 17 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([OSPAppDelegate class])); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OpenStreetPad/OpenStreetPad/parser.osp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/OpenStreetPad/OpenStreetPad/parser.osp -------------------------------------------------------------------------------- /Proj4/PJ_august.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_august.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv."; 7 | #define M 1.333333333333333 8 | FORWARD(s_forward); /* spheroid */ 9 | double t, c1, c, x1, x12, y1, y12; 10 | 11 | t = tan(.5 * lp.phi); 12 | c1 = sqrt(1. - t * t); 13 | c = 1. + c1 * cos(lp.lam *= .5); 14 | x1 = sin(lp.lam) * c1 / c; 15 | y1 = t / c; 16 | xy.x = M * x1 * (3. + (x12 = x1 * x1) - 3. * (y12 = y1 * y1)); 17 | xy.y = M * y1 * (3. + 3. * x12 - y12); 18 | return (xy); 19 | } 20 | FREEUP; if (P) pj_dalloc(P); } 21 | ENTRY0(august) P->inv = 0; P->fwd = s_forward; P->es = 0.; ENDENTRY(P) 22 | -------------------------------------------------------------------------------- /Proj4/PJ_bacon.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_bacon.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | # define HLFPI2 2.46740110027233965467 5 | # define EPS 1e-10 6 | #define PROJ_PARMS__ \ 7 | int bacn; \ 8 | int ortl; 9 | #define PJ_LIB__ 10 | #include "projects.h" 11 | PROJ_HEAD(apian, "Apian Globular I") "\n\tMisc Sph, no inv."; 12 | PROJ_HEAD(ortel, "Ortelius Oval") "\n\tMisc Sph, no inv."; 13 | PROJ_HEAD(bacon, "Bacon Globular") "\n\tMisc Sph, no inv."; 14 | FORWARD(s_forward); /* spheroid */ 15 | double ax, f; 16 | 17 | xy.y = P->bacn ? HALFPI * sin(lp.phi) : lp.phi; 18 | if ((ax = fabs(lp.lam)) >= EPS) { 19 | if (P->ortl && ax >= HALFPI) 20 | xy.x = sqrt(HLFPI2 - lp.phi * lp.phi + EPS) + ax - HALFPI; 21 | else { 22 | f = 0.5 * (HLFPI2 / ax + ax); 23 | xy.x = ax - f + sqrt(f * f - xy.y * xy.y); 24 | } 25 | if (lp.lam < 0.) xy.x = - xy.x; 26 | } else 27 | xy.x = 0.; 28 | return (xy); 29 | } 30 | FREEUP; if (P) pj_dalloc(P); } 31 | ENTRY0(bacon) 32 | P->bacn = 1; 33 | P->ortl = 0; 34 | P->es = 0.; P->fwd = s_forward; 35 | ENDENTRY(P) 36 | ENTRY0(apian) 37 | P->bacn = P->ortl = 0; 38 | P->es = 0.; P->fwd = s_forward; 39 | ENDENTRY(P) 40 | ENTRY0(ortel) 41 | P->bacn = 0; 42 | P->ortl = 1; 43 | P->es = 0.; P->fwd = s_forward; 44 | ENDENTRY(P) 45 | -------------------------------------------------------------------------------- /Proj4/PJ_boggs.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_boggs.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl., no inv., Sph."; 7 | # define NITER 20 8 | # define EPS 1e-7 9 | # define ONETOL 1.000001 10 | # define FXC 2.00276 11 | # define FXC2 1.11072 12 | # define FYC 0.49931 13 | # define FYC2 1.41421356237309504880 14 | FORWARD(s_forward); /* spheroid */ 15 | double theta, th1, c; 16 | int i; 17 | 18 | theta = lp.phi; 19 | if (fabs(fabs(lp.phi) - HALFPI) < EPS) 20 | xy.x = 0.; 21 | else { 22 | c = sin(theta) * PI; 23 | for (i = NITER; i; --i) { 24 | theta -= th1 = (theta + sin(theta) - c) / 25 | (1. + cos(theta)); 26 | if (fabs(th1) < EPS) break; 27 | } 28 | theta *= 0.5; 29 | xy.x = FXC * lp.lam / (1. / cos(lp.phi) + FXC2 / cos(theta)); 30 | } 31 | xy.y = FYC * (lp.phi + FYC2 * sin(theta)); 32 | return (xy); 33 | } 34 | FREEUP; if (P) pj_dalloc(P); } 35 | ENTRY0(boggs) P->es = 0.; P->fwd = s_forward; ENDENTRY(P) 36 | -------------------------------------------------------------------------------- /Proj4/PJ_cc.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_cc.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double ap; 6 | #define PJ_LIB__ 7 | #include "projects.h" 8 | PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph"; 9 | #define EPS10 1.e-10 10 | FORWARD(s_forward); /* spheroid */ 11 | if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR; 12 | xy.x = lp.lam; 13 | xy.y = tan(lp.phi); 14 | return (xy); 15 | } 16 | INVERSE(s_inverse); /* spheroid */ 17 | lp.phi = atan(xy.y); 18 | lp.lam = xy.x; 19 | return (lp); 20 | } 21 | FREEUP; if (P) pj_dalloc(P); } 22 | ENTRY0(cc) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 23 | -------------------------------------------------------------------------------- /Proj4/PJ_collg.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_collg.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph."; 7 | #define FXC 1.12837916709551257390 8 | #define FYC 1.77245385090551602729 9 | #define ONEEPS 1.0000001 10 | FORWARD(s_forward); /* spheroid */ 11 | if ((xy.y = 1. - sin(lp.phi)) <= 0.) 12 | xy.y = 0.; 13 | else 14 | xy.y = sqrt(xy.y); 15 | xy.x = FXC * lp.lam * xy.y; 16 | xy.y = FYC * (1. - xy.y); 17 | return (xy); 18 | } 19 | INVERSE(s_inverse); /* spheroid */ 20 | lp.phi = xy.y / FYC - 1.; 21 | if (fabs(lp.phi = 1. - lp.phi * lp.phi) < 1.) 22 | lp.phi = asin(lp.phi); 23 | else if (fabs(lp.phi) > ONEEPS) I_ERROR 24 | else lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; 25 | if ((lp.lam = 1. - sin(lp.phi)) <= 0.) 26 | lp.lam = 0.; 27 | else 28 | lp.lam = xy.x / (FXC * sqrt(lp.lam)); 29 | return (lp); 30 | } 31 | FREEUP; if (P) pj_dalloc(P); } 32 | ENTRY0(collg) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 33 | -------------------------------------------------------------------------------- /Proj4/PJ_crast.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_crast.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") 7 | "\n\tPCyl., Sph."; 8 | #define XM 0.97720502380583984317 9 | #define RXM 1.02332670794648848847 10 | #define YM 3.06998012383946546542 11 | #define RYM 0.32573500793527994772 12 | #define THIRD 0.333333333333333333 13 | FORWARD(s_forward); /* spheroid */ 14 | lp.phi *= THIRD; 15 | xy.x = XM * lp.lam * (2. * cos(lp.phi + lp.phi) - 1.); 16 | xy.y = YM * sin(lp.phi); 17 | return (xy); 18 | } 19 | INVERSE(s_inverse); /* spheroid */ 20 | lp.phi = 3. * asin(xy.y * RYM); 21 | lp.lam = xy.x * RXM / (2. * cos((lp.phi + lp.phi) * THIRD) - 1); 22 | return (lp); 23 | } 24 | FREEUP; if (P) pj_dalloc(P); } 25 | ENTRY0(crast) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 26 | -------------------------------------------------------------------------------- /Proj4/PJ_denoy.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_denoy.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl., no inv., Sph."; 7 | #define C0 0.95 8 | #define C1 -.08333333333333333333 9 | #define C3 .00166666666666666666 10 | #define D1 0.9 11 | #define D5 0.03 12 | FORWARD(s_forward); /* spheroid */ 13 | xy.y = lp.phi; 14 | xy.x = lp.lam; 15 | lp.lam = fabs(lp.lam); 16 | xy.x *= cos((C0 + lp.lam * (C1 + lp.lam * lp.lam * C3)) * 17 | (lp.phi * (D1 + D5 * lp.phi * lp.phi * lp.phi * lp.phi))); 18 | return (xy); 19 | } 20 | FREEUP; if (P) pj_dalloc(P); } 21 | ENTRY0(denoy) P->es = 0.; P->fwd = s_forward; ENDENTRY(P) 22 | -------------------------------------------------------------------------------- /Proj4/PJ_eck1.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_eck1.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl., Sph."; 7 | #define FC .92131773192356127802 8 | #define RP .31830988618379067154 9 | FORWARD(s_forward); /* spheroid */ 10 | xy.x = FC * lp.lam * (1. - RP * fabs(lp.phi)); 11 | xy.y = FC * lp.phi; 12 | return (xy); 13 | } 14 | INVERSE(s_inverse); /* spheroid */ 15 | lp.phi = xy.y / FC; 16 | lp.lam = xy.x / (FC * (1. - RP * fabs(lp.phi))); 17 | return (lp); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(eck1) 21 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 22 | ENDENTRY(P) 23 | -------------------------------------------------------------------------------- /Proj4/PJ_eck2.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_eck2.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl. Sph."; 7 | #define FXC 0.46065886596178063902 8 | #define FYC 1.44720250911653531871 9 | #define C13 0.33333333333333333333 10 | #define ONEEPS 1.0000001 11 | FORWARD(s_forward); /* spheroid */ 12 | xy.x = FXC * lp.lam * (xy.y = sqrt(4. - 3. * sin(fabs(lp.phi)))); 13 | xy.y = FYC * (2. - xy.y); 14 | if ( lp.phi < 0.) xy.y = -xy.y; 15 | return (xy); 16 | } 17 | INVERSE(s_inverse); /* spheroid */ 18 | lp.lam = xy.x / (FXC * ( lp.phi = 2. - fabs(xy.y) / FYC) ); 19 | lp.phi = (4. - lp.phi * lp.phi) * C13; 20 | if (fabs(lp.phi) >= 1.) { 21 | if (fabs(lp.phi) > ONEEPS) I_ERROR 22 | else 23 | lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; 24 | } else 25 | lp.phi = asin(lp.phi); 26 | if (xy.y < 0) 27 | lp.phi = -lp.phi; 28 | return (lp); 29 | } 30 | FREEUP; if (P) pj_dalloc(P); } 31 | ENTRY0(eck2); P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 32 | -------------------------------------------------------------------------------- /Proj4/PJ_eck5.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_eck5.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph."; 7 | #define XF 0.44101277172455148219 8 | #define RXF 2.26750802723822639137 9 | #define YF 0.88202554344910296438 10 | #define RYF 1.13375401361911319568 11 | FORWARD(s_forward); /* spheroid */ 12 | xy.x = XF * (1. + cos(lp.phi)) * lp.lam; 13 | xy.y = YF * lp.phi; 14 | return (xy); 15 | } 16 | INVERSE(s_inverse); /* spheroid */ 17 | lp.lam = RXF * xy.x / (1. + cos( lp.phi = RYF * xy.y)); 18 | return (lp); 19 | } 20 | FREEUP; if (P) pj_dalloc(P); } 21 | ENTRY0(eck5); P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 22 | -------------------------------------------------------------------------------- /Proj4/PJ_eqc.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_eqc.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double rc; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Caree)") 9 | "\n\tCyl, Sph\n\tlat_ts="; 10 | FORWARD(s_forward); /* spheroid */ 11 | xy.x = P->rc * lp.lam; 12 | xy.y = lp.phi; 13 | return (xy); 14 | } 15 | INVERSE(s_inverse); /* spheroid */ 16 | lp.phi = xy.y; 17 | lp.lam = xy.x / P->rc; 18 | return (lp); 19 | } 20 | FREEUP; if (P) pj_dalloc(P); } 21 | ENTRY0(eqc) 22 | if ((P->rc = cos(pj_param(P->params, "rlat_ts").f)) <= 0.) E_ERROR(-24); 23 | P->inv = s_inverse; 24 | P->fwd = s_forward; 25 | P->es = 0.; 26 | ENDENTRY(P) 27 | -------------------------------------------------------------------------------- /Proj4/PJ_fahey.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_fahey.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph."; 7 | #define TOL 1e-6 8 | FORWARD(s_forward); /* spheroid */ 9 | xy.y = 1.819152 * ( xy.x = tan(0.5 * lp.phi) ); 10 | xy.x = 0.819152 * lp.lam * asqrt(1 - xy.x * xy.x); 11 | return (xy); 12 | } 13 | INVERSE(s_inverse); /* spheroid */ 14 | lp.phi = 2. * atan(xy.y /= 1.819152); 15 | lp.lam = fabs(xy.y = 1. - xy.y * xy.y) < TOL ? 0. : 16 | xy.x / (0.819152 * sqrt(xy.y)); 17 | return (lp); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(fahey) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 21 | -------------------------------------------------------------------------------- /Proj4/PJ_fouc_s.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_fouc_s.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double n, n1; 6 | #define PJ_LIB__ 7 | #include "projects.h" 8 | PROJ_HEAD(fouc_s, "Foucaut Sinusoidal") "\n\tPCyl., Sph."; 9 | #define MAX_ITER 10 10 | #define LOOP_TOL 1e-7 11 | FORWARD(s_forward); /* spheroid */ 12 | double t; 13 | 14 | t = cos(lp.phi); 15 | xy.x = lp.lam * t / (P->n + P->n1 * t); 16 | xy.y = P->n * lp.phi + P->n1 * sin(lp.phi); 17 | return (xy); 18 | } 19 | INVERSE(s_inverse); /* spheroid */ 20 | double V; 21 | int i; 22 | 23 | if (P->n) { 24 | lp.phi = xy.y; 25 | for (i = MAX_ITER; i ; --i) { 26 | lp.phi -= V = (P->n * lp.phi + P->n1 * sin(lp.phi) - xy.y ) / 27 | (P->n + P->n1 * cos(lp.phi)); 28 | if (fabs(V) < LOOP_TOL) 29 | break; 30 | } 31 | if (!i) 32 | lp.phi = xy.y < 0. ? -HALFPI : HALFPI; 33 | } else 34 | lp.phi = aasin(xy.y); 35 | V = cos(lp.phi); 36 | lp.lam = xy.x * (P->n + P->n1 * V) / V; 37 | return (lp); 38 | } 39 | FREEUP; if (P) pj_dalloc(P); } 40 | ENTRY0(fouc_s) 41 | P->n = pj_param(P->params, "dn").f; 42 | if (P->n < 0. || P->n > 1.) 43 | E_ERROR(-99) 44 | P->n1 = 1. - P->n; 45 | P->es = 0; 46 | P->inv = s_inverse; 47 | P->fwd = s_forward; 48 | ENDENTRY(P) 49 | -------------------------------------------------------------------------------- /Proj4/PJ_gall.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_gall.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph"; 7 | #define YF 1.70710678118654752440 8 | #define XF 0.70710678118654752440 9 | #define RYF 0.58578643762690495119 10 | #define RXF 1.41421356237309504880 11 | FORWARD(s_forward); /* spheroid */ 12 | xy.x = XF * lp.lam; 13 | xy.y = YF * tan(.5 * lp.phi); 14 | return (xy); 15 | } 16 | INVERSE(s_inverse); /* spheroid */ 17 | lp.lam = RXF * xy.x; 18 | lp.phi = 2. * atan(xy.y * RYF); 19 | return (lp); 20 | } 21 | FREEUP; if (P) pj_dalloc(P); } 22 | ENTRY0(gall) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 23 | -------------------------------------------------------------------------------- /Proj4/PJ_gins8.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_gins8.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph., no inv."; 7 | #define Cl 0.000952426 8 | #define Cp 0.162388 9 | #define C12 0.08333333333333333 10 | FORWARD(s_forward); /* spheroid */ 11 | double t = lp.phi * lp.phi; 12 | 13 | xy.y = lp.phi * (1. + t * C12); 14 | xy.x = lp.lam * (1. - Cp * t); 15 | t = lp.lam * lp.lam; 16 | xy.x *= (0.87 - Cl * t * t); 17 | return (xy); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(gins8) P->es = 0.; P->inv = 0; P->fwd = s_forward; ENDENTRY(P) 21 | -------------------------------------------------------------------------------- /Proj4/PJ_hammer.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_hammer.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double w; \ 6 | double m, rm; 7 | #define PJ_LIB__ 8 | # include "projects.h" 9 | PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff") 10 | "\n\tMisc Sph, no inv.\n\tW= M="; 11 | FORWARD(s_forward); /* spheroid */ 12 | double cosphi, d; 13 | 14 | d = sqrt(2./(1. + (cosphi = cos(lp.phi)) * cos(lp.lam *= P->w))); 15 | xy.x = P->m * d * cosphi * sin(lp.lam); 16 | xy.y = P->rm * d * sin(lp.phi); 17 | return (xy); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(hammer) 21 | if (pj_param(P->params, "tW").i) { 22 | if ((P->w = fabs(pj_param(P->params, "dW").f)) <= 0.) E_ERROR(-27); 23 | } else 24 | P->w = .5; 25 | if (pj_param(P->params, "tM").i) { 26 | if ((P->m = fabs(pj_param(P->params, "dM").f)) <= 0.) E_ERROR(-27); 27 | } else 28 | P->m = 1.; 29 | P->rm = 1. / P->m; 30 | P->m /= P->w; 31 | P->es = 0.; P->fwd = s_forward; 32 | ENDENTRY(P) 33 | -------------------------------------------------------------------------------- /Proj4/PJ_krovak.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/Proj4/PJ_krovak.c -------------------------------------------------------------------------------- /Proj4/PJ_lagrng.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_lagrng.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double hrw; \ 6 | double rw; \ 7 | double a1; 8 | #define TOL 1e-10 9 | #define PJ_LIB__ 10 | #include "projects.h" 11 | PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph, no inv.\n\tW="; 12 | FORWARD(s_forward); /* spheroid */ 13 | double v, c; 14 | 15 | if (fabs(fabs(lp.phi) - HALFPI) < TOL) { 16 | xy.x = 0; 17 | xy.y = lp.phi < 0 ? -2. : 2.; 18 | } else { 19 | lp.phi = sin(lp.phi); 20 | v = P->a1 * pow((1. + lp.phi)/(1. - lp.phi), P->hrw); 21 | if ((c = 0.5 * (v + 1./v) + cos(lp.lam *= P->rw)) < TOL) 22 | F_ERROR; 23 | xy.x = 2. * sin(lp.lam) / c; 24 | xy.y = (v - 1./v) / c; 25 | } 26 | return (xy); 27 | } 28 | FREEUP; if (P) pj_dalloc(P); } 29 | ENTRY0(lagrng) 30 | double phi1; 31 | 32 | if ((P->rw = pj_param(P->params, "dW").f) <= 0) E_ERROR(-27); 33 | P->hrw = 0.5 * (P->rw = 1. / P->rw); 34 | phi1 = pj_param(P->params, "rlat_1").f; 35 | if (fabs(fabs(phi1 = sin(phi1)) - 1.) < TOL) E_ERROR(-22); 36 | P->a1 = pow((1. - phi1)/(1. + phi1), P->hrw); 37 | P->es = 0.; P->fwd = s_forward; 38 | ENDENTRY(P) 39 | -------------------------------------------------------------------------------- /Proj4/PJ_larr.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_larr.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ 5 | #define PJ_LIB__ 6 | #include "projects.h" 7 | PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv."; 8 | #define SIXTH .16666666666666666 9 | FORWARD(s_forward); /* sphere */ 10 | xy.x = 0.5 * lp.lam * (1. + sqrt(cos(lp.phi))); 11 | xy.y = lp.phi / (cos(0.5 * lp.phi) * cos(SIXTH * lp.lam)); 12 | return (xy); 13 | } 14 | FREEUP; if (P) pj_dalloc(P); } 15 | ENTRY0(larr) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P) 16 | -------------------------------------------------------------------------------- /Proj4/PJ_lask.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_lask.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ 5 | #define PJ_LIB__ 6 | #include "projects.h" 7 | PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv."; 8 | #define a10 0.975534 9 | #define a12 -0.119161 10 | #define a32 -0.0143059 11 | #define a14 -0.0547009 12 | #define b01 1.00384 13 | #define b21 0.0802894 14 | #define b03 0.0998909 15 | #define b41 0.000199025 16 | #define b23 -0.0285500 17 | #define b05 -0.0491032 18 | FORWARD(s_forward); /* sphere */ 19 | double l2, p2; 20 | 21 | l2 = lp.lam * lp.lam; 22 | p2 = lp.phi * lp.phi; 23 | xy.x = lp.lam * (a10 + p2 * (a12 + l2 * a32 + p2 * a14)); 24 | xy.y = lp.phi * (b01 + l2 * (b21 + p2 * b23 + l2 * b41) + 25 | p2 * (b03 + p2 * b05)); 26 | return (xy); 27 | } 28 | FREEUP; if (P) pj_dalloc(P); } 29 | ENTRY0(lask) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P) 30 | -------------------------------------------------------------------------------- /Proj4/PJ_mbt_fps.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_mbt_fps.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl., Sph."; 7 | #define MAX_ITER 10 8 | #define LOOP_TOL 1e-7 9 | #define C1 0.45503 10 | #define C2 1.36509 11 | #define C3 1.41546 12 | #define C_x 0.22248 13 | #define C_y 1.44492 14 | #define C1_2 0.33333333333333333333333333 15 | FORWARD(s_forward); /* spheroid */ 16 | double k, V, t; 17 | int i; 18 | 19 | k = C3 * sin(lp.phi); 20 | for (i = MAX_ITER; i ; --i) { 21 | t = lp.phi / C2; 22 | lp.phi -= V = (C1 * sin(t) + sin(lp.phi) - k) / 23 | (C1_2 * cos(t) + cos(lp.phi)); 24 | if (fabs(V) < LOOP_TOL) 25 | break; 26 | } 27 | t = lp.phi / C2; 28 | xy.x = C_x * lp.lam * (1. + 3. * cos(lp.phi)/cos(t) ); 29 | xy.y = C_y * sin(t); 30 | return (xy); 31 | } 32 | INVERSE(s_inverse); /* spheroid */ 33 | double t, s; 34 | 35 | lp.phi = C2 * (t = aasin(xy.y / C_y)); 36 | lp.lam = xy.x / (C_x * (1. + 3. * cos(lp.phi)/cos(t))); 37 | lp.phi = aasin((C1 * sin(t) + sin(lp.phi)) / C3); 38 | return (lp); 39 | } 40 | FREEUP; if (P) pj_dalloc(P); } 41 | ENTRY0(mbt_fps) P->es = 0; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 42 | -------------------------------------------------------------------------------- /Proj4/PJ_mill.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_mill.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(mill, "Miller Cylindrical") "\n\tCyl, Sph"; 7 | FORWARD(s_forward); /* spheroid */ 8 | xy.x = lp.lam; 9 | xy.y = log(tan(FORTPI + lp.phi * .4)) * 1.25; 10 | return (xy); 11 | } 12 | INVERSE(s_inverse); /* spheroid */ 13 | lp.lam = xy.x; 14 | lp.phi = 2.5 * (atan(exp(.8 * xy.y)) - FORTPI); 15 | return (lp); 16 | } 17 | FREEUP; if (P) pj_dalloc(P); } 18 | ENTRY0(mill) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 19 | -------------------------------------------------------------------------------- /Proj4/PJ_nell.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_nell.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(nell, "Nell") "\n\tPCyl., Sph."; 7 | #define MAX_ITER 10 8 | #define LOOP_TOL 1e-7 9 | FORWARD(s_forward); /* spheroid */ 10 | double k, V; 11 | int i; 12 | 13 | k = 2. * sin(lp.phi); 14 | V = lp.phi * lp.phi; 15 | lp.phi *= 1.00371 + V * (-0.0935382 + V * -0.011412); 16 | for (i = MAX_ITER; i ; --i) { 17 | lp.phi -= V = (lp.phi + sin(lp.phi) - k) / 18 | (1. + cos(lp.phi)); 19 | if (fabs(V) < LOOP_TOL) 20 | break; 21 | } 22 | xy.x = 0.5 * lp.lam * (1. + cos(lp.phi)); 23 | xy.y = lp.phi; 24 | return (xy); 25 | } 26 | INVERSE(s_inverse); /* spheroid */ 27 | double th, s; 28 | 29 | lp.lam = 2. * xy.x / (1. + cos(xy.y)); 30 | lp.phi = aasin(0.5 * (xy.y + sin(xy.y))); 31 | return (lp); 32 | } 33 | FREEUP; if (P) pj_dalloc(P); } 34 | ENTRY0(nell) P->es = 0; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 35 | -------------------------------------------------------------------------------- /Proj4/PJ_nell_h.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_nell_h.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl., Sph."; 7 | #define NITER 9 8 | #define EPS 1e-7 9 | FORWARD(s_forward); /* spheroid */ 10 | xy.x = 0.5 * lp.lam * (1. + cos(lp.phi)); 11 | xy.y = 2.0 * (lp.phi - tan(0.5 *lp.phi)); 12 | return (xy); 13 | } 14 | INVERSE(s_inverse); /* spheroid */ 15 | double V, c, p; 16 | int i; 17 | 18 | p = 0.5 * xy.y; 19 | for (i = NITER; i ; --i) { 20 | c = cos(0.5 * lp.phi); 21 | lp.phi -= V = (lp.phi - tan(lp.phi/2) - p)/(1. - 0.5/(c*c)); 22 | if (fabs(V) < EPS) 23 | break; 24 | } 25 | if (!i) { 26 | lp.phi = p < 0. ? -HALFPI : HALFPI; 27 | lp.lam = 2. * xy.x; 28 | } else 29 | lp.lam = 2. * xy.x / (1. + cos(lp.phi)); 30 | return (lp); 31 | } 32 | FREEUP; if (P) pj_dalloc(P); } 33 | ENTRY0(nell_h) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 34 | -------------------------------------------------------------------------------- /Proj4/PJ_putp3.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_putp3.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double A; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(putp3, "Putnins P3") "\n\tPCyl., Sph."; 9 | PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl., no inv., Sph."; 10 | #define C 0.79788456 11 | #define RPISQ 0.1013211836 12 | FORWARD(s_forward); /* spheroid */ 13 | xy.x = C * lp.lam * (1. - P->A * lp.phi * lp.phi); 14 | xy.y = C * lp.phi; 15 | return (xy); 16 | } 17 | INVERSE(s_inverse); /* spheroid */ 18 | lp.phi = xy.y / C; 19 | lp.lam = xy.x / (C * (1. - P->A * lp.phi * lp.phi)); 20 | return (lp); 21 | } 22 | FREEUP; if (P) pj_dalloc(P); } 23 | static PJ * 24 | setup(PJ *P) { 25 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 26 | return P; 27 | } 28 | ENTRY0(putp3) P->A = 4. * RPISQ; ENDENTRY(setup(P)) 29 | ENTRY0(putp3p) P->A = 2. * RPISQ; ENDENTRY(setup(P)) 30 | -------------------------------------------------------------------------------- /Proj4/PJ_putp4p.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_putp4p.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double C_x, C_y; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(putp4p, "Putnins P4'") "\n\tPCyl., Sph."; 9 | PROJ_HEAD(weren, "Werenskiold I") "\n\tPCyl., Sph."; 10 | FORWARD(s_forward); /* spheroid */ 11 | lp.phi = aasin(0.883883476 * sin(lp.phi)); 12 | xy.x = P->C_x * lp.lam * cos(lp.phi); 13 | xy.x /= cos(lp.phi *= 0.333333333333333); 14 | xy.y = P->C_y * sin(lp.phi); 15 | return (xy); 16 | } 17 | INVERSE(s_inverse); /* spheroid */ 18 | lp.phi = aasin(xy.y / P->C_y); 19 | lp.lam = xy.x * cos(lp.phi) / P->C_x; 20 | lp.phi *= 3.; 21 | lp.lam /= cos(lp.phi); 22 | lp.phi = aasin(1.13137085 * sin(lp.phi)); 23 | return (lp); 24 | } 25 | FREEUP; if (P) pj_dalloc(P); } 26 | static PJ * 27 | setup(PJ *P) { 28 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 29 | return P; 30 | } 31 | ENTRY0(putp4p) P->C_x = 0.874038744; P->C_y = 3.883251825; ENDENTRY(setup(P)) 32 | ENTRY0(weren) P->C_x = 1.; P->C_y = 4.442882938; ENDENTRY(setup(P)) 33 | -------------------------------------------------------------------------------- /Proj4/PJ_putp5.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_putp5.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double A, B; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(putp5, "Putnins P5") "\n\tPCyl., Sph."; 9 | PROJ_HEAD(putp5p, "Putnins P5'") "\n\tPCyl., Sph."; 10 | #define C 1.01346 11 | #define D 1.2158542 12 | FORWARD(s_forward); /* spheroid */ 13 | xy.x = C * lp.lam * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi)); 14 | xy.y = C * lp.phi; 15 | return (xy); 16 | } 17 | INVERSE(s_inverse); /* spheroid */ 18 | lp.phi = xy.y / C; 19 | lp.lam = xy.x / (C * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi))); 20 | return (lp); 21 | } 22 | FREEUP; if (P) pj_dalloc(P); } 23 | static PJ * 24 | setup(PJ *P) { 25 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 26 | return P; 27 | } 28 | ENTRY0(putp5) P->A = 2.; P->B = 1.; ENDENTRY(setup(P)) 29 | ENTRY0(putp5p) P->A = 1.5; P->B = 0.5; ENDENTRY(setup(P)) 30 | -------------------------------------------------------------------------------- /Proj4/PJ_rpoly.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_rpoly.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double phi1; \ 6 | double fxa; \ 7 | double fxb; \ 8 | int mode; 9 | #define EPS 1e-9 10 | #define PJ_LIB__ 11 | #include "projects.h" 12 | PROJ_HEAD(rpoly, "Rectangular Polyconic") 13 | "\n\tConic, Sph., no inv.\n\tlat_ts="; 14 | FORWARD(s_forward); /* spheroid */ 15 | double fa; 16 | 17 | if (P->mode) 18 | fa = tan(lp.lam * P->fxb) * P->fxa; 19 | else 20 | fa = 0.5 * lp.lam; 21 | if (fabs(lp.phi) < EPS) { 22 | xy.x = fa + fa; 23 | xy.y = - P->phi0; 24 | } else { 25 | xy.y = 1. / tan(lp.phi); 26 | xy.x = sin(fa = 2. * atan(fa * sin(lp.phi))) * xy.y; 27 | xy.y = lp.phi - P->phi0 + (1. - cos(fa)) * xy.y; 28 | } 29 | return (xy); 30 | } 31 | FREEUP; if (P) pj_dalloc(P); } 32 | ENTRY0(rpoly) 33 | if ((P->mode = (P->phi1 = fabs(pj_param(P->params, "rlat_ts").f)) > EPS)) { 34 | P->fxb = 0.5 * sin(P->phi1); 35 | P->fxa = 0.5 / P->fxb; 36 | } 37 | P->es = 0.; P->fwd = s_forward; 38 | ENDENTRY(P) 39 | -------------------------------------------------------------------------------- /Proj4/PJ_tcc.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_tcc.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double ap; 6 | #define EPS10 1.e-10 7 | #define PJ_LIB__ 8 | #include "projects.h" 9 | PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv."; 10 | FORWARD(s_forward); /* spheroid */ 11 | double b, bt; 12 | 13 | b = cos(lp.phi) * sin(lp.lam); 14 | if ((bt = 1. - b * b) < EPS10) F_ERROR; 15 | xy.x = b / sqrt(bt); 16 | xy.y = atan2(tan(lp.phi) , cos(lp.lam)); 17 | return (xy); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(tcc) P->es = 0.; P->fwd = s_forward; ENDENTRY(P) 21 | -------------------------------------------------------------------------------- /Proj4/PJ_tcea.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_tcea.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double rk0; 6 | #define PJ_LIB__ 7 | #include "projects.h" 8 | PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph"; 9 | FORWARD(s_forward); /* spheroid */ 10 | xy.x = P->rk0 * cos(lp.phi) * sin(lp.lam); 11 | xy.y = P->k0 * (atan2(tan(lp.phi), cos(lp.lam)) - P->phi0); 12 | return (xy); 13 | } 14 | INVERSE(s_inverse); /* spheroid */ 15 | double t; 16 | 17 | xy.y = xy.y * P->rk0 + P->phi0; 18 | xy.x *= P->k0; 19 | t = sqrt(1. - xy.x * xy.x); 20 | lp.phi = asin(t * sin(xy.y)); 21 | lp.lam = atan2(xy.x, t * cos(xy.y)); 22 | return (lp); 23 | } 24 | FREEUP; if (P) pj_dalloc(P); } 25 | ENTRY0(tcea) 26 | P->rk0 = 1 / P->k0; 27 | P->inv = s_inverse; 28 | P->fwd = s_forward; 29 | P->es = 0.; 30 | ENDENTRY(P) 31 | -------------------------------------------------------------------------------- /Proj4/PJ_urm5.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_urm5.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double m, rmn, q3, n; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl., Sph.\n\tn= q= alphi="; 9 | FORWARD(s_forward); /* spheroid */ 10 | double t; 11 | 12 | t = lp.phi = aasin(P->n * sin(lp.phi)); 13 | xy.x = P->m * lp.lam * cos(lp.phi); 14 | t *= t; 15 | xy.y = lp.phi * (1. + t * P->q3) * P->rmn; 16 | return xy; 17 | } 18 | FREEUP; if (P) pj_dalloc(P); } 19 | ENTRY0(urm5) 20 | double alpha, t; 21 | 22 | P->n = pj_param(P->params, "dn").f; 23 | P->q3 = pj_param(P->params, "dq").f / 3.; 24 | alpha = pj_param(P->params, "ralpha").f; 25 | t = P->n * sin(alpha); 26 | P->m = cos(alpha) / sqrt(1. - t * t); 27 | P->rmn = 1. / (P->m * P->n); 28 | P->es = 0.; 29 | P->inv = 0; 30 | P->fwd = s_forward; 31 | ENDENTRY(P) 32 | -------------------------------------------------------------------------------- /Proj4/PJ_urmfps.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_urmfps.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double n, C_y; 6 | #define PJ_LIB__ 7 | #include "projects.h" 8 | PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph.\n\tn="; 9 | PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph."; 10 | #define C_x 0.8773826753 11 | #define Cy 1.139753528477 12 | FORWARD(s_forward); /* sphere */ 13 | lp.phi = aasin(P->n * sin(lp.phi)); 14 | xy.x = C_x * lp.lam * cos(lp.phi); 15 | xy.y = P->C_y * lp.phi; 16 | return (xy); 17 | } 18 | INVERSE(s_inverse); /* sphere */ 19 | xy.y /= P->C_y; 20 | lp.phi = aasin(sin(xy.y) / P->n); 21 | lp.lam = xy.x / (C_x * cos(xy.y)); 22 | return (lp); 23 | } 24 | FREEUP; if (P) pj_dalloc(P); } 25 | static PJ * 26 | setup(PJ *P) { 27 | P->C_y = Cy / P->n; 28 | P->es = 0.; 29 | P->inv = s_inverse; 30 | P->fwd = s_forward; 31 | return P; 32 | } 33 | ENTRY0(urmfps) 34 | if (pj_param(P->params, "tn").i) { 35 | P->n = pj_param(P->params, "dn").f; 36 | if (P->n <= 0. || P->n > 1.) 37 | E_ERROR(-40) 38 | } else 39 | E_ERROR(-40) 40 | ENDENTRY(setup(P)) 41 | ENTRY0(wag1) 42 | P->n = 0.8660254037844386467637231707; 43 | ENDENTRY(setup(P)) 44 | -------------------------------------------------------------------------------- /Proj4/PJ_wag2.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_wag2.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | # include "projects.h" 6 | PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl., Sph."; 7 | #define C_x 0.92483 8 | #define C_y 1.38725 9 | #define C_p1 0.88022 10 | #define C_p2 0.88550 11 | FORWARD(s_forward); /* spheroid */ 12 | lp.phi = aasin(C_p1 * sin(C_p2 * lp.phi)); 13 | xy.x = C_x * lp.lam * cos(lp.phi); 14 | xy.y = C_y * lp.phi; 15 | return (xy); 16 | } 17 | INVERSE(s_inverse); /* spheroid */ 18 | lp.phi = xy.y / C_y; 19 | lp.lam = xy.x / (C_x * cos(lp.phi)); 20 | lp.phi = aasin(sin(lp.phi) / C_p1) / C_p2; 21 | return (lp); 22 | } 23 | FREEUP; if (P) pj_dalloc(P); } 24 | ENTRY0(wag2) P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; ENDENTRY(P) 25 | -------------------------------------------------------------------------------- /Proj4/PJ_wag3.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_wag3.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double C_x; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts="; 9 | #define TWOTHIRD 0.6666666666666666666667 10 | FORWARD(s_forward); /* spheroid */ 11 | xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi); 12 | xy.y = lp.phi; 13 | return (xy); 14 | } 15 | INVERSE(s_inverse); /* spheroid */ 16 | lp.phi = xy.y; 17 | lp.lam = xy.x / (P->C_x * cos(TWOTHIRD * lp.phi)); 18 | return (lp); 19 | } 20 | FREEUP; if (P) pj_dalloc(P); } 21 | ENTRY0(wag3) 22 | double ts; 23 | 24 | ts = pj_param(P->params, "rlat_ts").f; 25 | P->C_x = cos(ts) / cos(2.*ts/3.); 26 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 27 | ENDENTRY(P) 28 | -------------------------------------------------------------------------------- /Proj4/PJ_wag7.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_wag7.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PJ_LIB__ 5 | #include "projects.h" 6 | PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv."; 7 | FORWARD(s_forward); /* sphere */ 8 | double theta, ct, D; 9 | 10 | theta = asin(xy.y = 0.90630778703664996 * sin(lp.phi)); 11 | xy.x = 2.66723 * (ct = cos(theta)) * sin(lp.lam /= 3.); 12 | xy.y *= 1.24104 * (D = 1/(sqrt(0.5 * (1 + ct * cos(lp.lam))))); 13 | xy.x *= D; 14 | return (xy); 15 | } 16 | FREEUP; if (P) pj_dalloc(P); } 17 | ENTRY0(wag7) P->fwd = s_forward; P->inv = 0; P->es = 0.; ENDENTRY(P) 18 | -------------------------------------------------------------------------------- /Proj4/PJ_wink1.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_wink1.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double cosphi1; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl., Sph.\n\tlat_ts="; 9 | FORWARD(s_forward); /* spheroid */ 10 | xy.x = .5 * lp.lam * (P->cosphi1 + cos(lp.phi)); 11 | xy.y = lp.phi; 12 | return (xy); 13 | } 14 | INVERSE(s_inverse); /* spheroid */ 15 | lp.phi = xy.y; 16 | lp.lam = 2. * xy.x / (P->cosphi1 + cos(lp.phi)); 17 | return (lp); 18 | } 19 | FREEUP; if (P) pj_dalloc(P); } 20 | ENTRY0(wink1) 21 | P->cosphi1 = cos(pj_param(P->params, "rlat_ts").f); 22 | P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; 23 | ENDENTRY(P) 24 | -------------------------------------------------------------------------------- /Proj4/PJ_wink2.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)PJ_wink2.c 4.1 94/02/15 GIE REL"; 3 | #endif 4 | #define PROJ_PARMS__ \ 5 | double cosphi1; 6 | #define PJ_LIB__ 7 | # include "projects.h" 8 | PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl., Sph., no inv.\n\tlat_1="; 9 | #define MAX_ITER 10 10 | #define LOOP_TOL 1e-7 11 | #define TWO_D_PI 0.636619772367581343 12 | FORWARD(s_forward); /* spheroid */ 13 | double k, V; 14 | int i; 15 | 16 | xy.y = lp.phi * TWO_D_PI; 17 | k = PI * sin(lp.phi); 18 | lp.phi *= 1.8; 19 | for (i = MAX_ITER; i ; --i) { 20 | lp.phi -= V = (lp.phi + sin(lp.phi) - k) / 21 | (1. + cos(lp.phi)); 22 | if (fabs(V) < LOOP_TOL) 23 | break; 24 | } 25 | if (!i) 26 | lp.phi = (lp.phi < 0.) ? -HALFPI : HALFPI; 27 | else 28 | lp.phi *= 0.5; 29 | xy.x = 0.5 * lp.lam * (cos(lp.phi) + P->cosphi1); 30 | xy.y = FORTPI * (sin(lp.phi) + xy.y); 31 | return (xy); 32 | } 33 | FREEUP; if (P) pj_dalloc(P); } 34 | ENTRY0(wink2) 35 | P->cosphi1 = cos(pj_param(P->params, "rlat_1").f); 36 | P->es = 0.; P->inv = 0; P->fwd = s_forward; 37 | ENDENTRY(P) 38 | -------------------------------------------------------------------------------- /Proj4/Proj4.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/Proj4/Proj4.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /Proj4/Proj4_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Proj4' target in the 'Proj4' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Proj4/aasincos.c: -------------------------------------------------------------------------------- 1 | /* arc sin, cosine, tan2 and sqrt that will NOT fail */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)aasincos.c 4.6 93/12/12 GIE REL"; 4 | #endif 5 | #include "projects.h" 6 | #define ONE_TOL 1.00000000000001 7 | #define TOL 0.000000001 8 | #define ATOL 1e-50 9 | double 10 | aasin(double v) { 11 | double av; 12 | 13 | if ((av = fabs(v)) >= 1.) { 14 | if (av > ONE_TOL) 15 | pj_errno = -19; 16 | return (v < 0. ? -HALFPI : HALFPI); 17 | } 18 | return asin(v); 19 | } 20 | double 21 | aacos(double v) { 22 | double av; 23 | 24 | if ((av = fabs(v)) >= 1.) { 25 | if (av > ONE_TOL) 26 | pj_errno = -19; 27 | return (v < 0. ? PI : 0.); 28 | } 29 | return acos(v); 30 | } 31 | double 32 | asqrt(double v) { return ((v <= 0) ? 0. : sqrt(v)); } 33 | double 34 | aatan2(double n, double d) { 35 | return ((fabs(n) < ATOL && fabs(d) < ATOL) ? 0. : atan2(n,d)); 36 | } 37 | -------------------------------------------------------------------------------- /Proj4/adjlon.c: -------------------------------------------------------------------------------- 1 | /* reduce argument to range +/- PI */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)adjlon.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include 6 | #include "projects.h" 7 | 8 | #define SPI 3.14159265359 9 | #define TWOPI 6.2831853071795864769 10 | #define ONEPI 3.14159265358979323846 11 | 12 | double adjlon (double lon) { 13 | if (fabs(lon) <= SPI) return( lon ); 14 | lon += ONEPI; /* adjust to 0..2pi rad */ 15 | lon -= TWOPI * floor(lon / TWOPI); /* remove integral # of 'revolutions'*/ 16 | lon -= ONEPI; /* adjust back to -pi..pi rad */ 17 | return( lon ); 18 | } 19 | -------------------------------------------------------------------------------- /Proj4/emess.h: -------------------------------------------------------------------------------- 1 | /* Error message processing header file */ 2 | #ifndef EMESS_H 3 | #define EMESS_H 4 | 5 | #ifndef lint 6 | static char EMESS_H_ID[] = "@(#)emess.h 4.1 93/03/08 GIE REL"; 7 | #endif 8 | 9 | struct EMESS { 10 | char *File_name, /* input file name */ 11 | *Prog_name; /* name of program */ 12 | int File_line; /* approximate line read 13 | where error occured */ 14 | }; 15 | 16 | #ifdef EMESS_ROUTINE /* use type */ 17 | /* for emess procedure */ 18 | struct EMESS emess_dat = { (char *)0, (char *)0, 0 }; 19 | 20 | #ifdef sun /* Archaic SunOs 4.1.1, etc. */ 21 | extern char *sys_errlist[]; 22 | #define strerror(n) (sys_errlist[n]) 23 | #endif 24 | 25 | #else /* for for calling procedures */ 26 | 27 | extern struct EMESS emess_dat; 28 | void emess(int, char *, ...); 29 | 30 | #endif /* use type */ 31 | 32 | #endif /* end EMESS_H */ 33 | -------------------------------------------------------------------------------- /Proj4/geodesic.h: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static char GEODESIC_H_ID[] = "@(#)geodesic.h 4.3 95/08/19 GIE REL"; 3 | #endif 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifndef _IN_GEOD_SET 10 | # define GEOD_EXTERN extern 11 | #else 12 | # define GEOD_EXTERN 13 | #endif 14 | 15 | GEOD_EXTERN struct geodesic { 16 | double A; 17 | double LAM1, PHI1, ALPHA12; 18 | double LAM2, PHI2, ALPHA21; 19 | double DIST; 20 | double ONEF, FLAT, FLAT2, FLAT4, FLAT64; 21 | int ELLIPSE; 22 | } GEODESIC; 23 | 24 | # define geod_a GEODESIC.A 25 | # define lam1 GEODESIC.LAM1 26 | # define phi1 GEODESIC.PHI1 27 | # define al12 GEODESIC.ALPHA12 28 | # define lam2 GEODESIC.LAM2 29 | # define phi2 GEODESIC.PHI2 30 | # define al21 GEODESIC.ALPHA21 31 | # define geod_S GEODESIC.DIST 32 | # define geod_f GEODESIC.FLAT 33 | # define onef GEODESIC.ONEF 34 | # define f2 GEODESIC.FLAT2 35 | # define f4 GEODESIC.FLAT4 36 | # define ff2 GEODESIC.FLAT4 37 | # define f64 GEODESIC.FLAT64 38 | # define ellipse GEODESIC.ELLIPSE 39 | 40 | 41 | GEOD_EXTERN int n_alpha, n_S; 42 | GEOD_EXTERN double to_meter, fr_meter, del_alpha; 43 | 44 | void geod_set(int, char **); 45 | void geod_for(void); 46 | void geod_pre(void); 47 | void geod_inv(void); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | -------------------------------------------------------------------------------- /Proj4/nad_list.h: -------------------------------------------------------------------------------- 1 | /* projection list for program nad2nad */ 2 | PROJ_HEAD(lcc, "Lambert Conformal Conic") 3 | PROJ_HEAD(omerc, "Oblique Mercator") 4 | PROJ_HEAD(poly, "Polyconic (American)") 5 | PROJ_HEAD(tmerc, "Transverse Mercator") 6 | PROJ_HEAD(utm, "Universal Transverse Mercator (UTM)") 7 | -------------------------------------------------------------------------------- /Proj4/org_proj4_Projections.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_proj4_Projections */ 4 | 5 | #ifndef _Included_org_proj4_Projections 6 | #define _Included_org_proj4_Projections 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_proj4_Projections 12 | * Method: getProjInfo 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getProjInfo 16 | (JNIEnv *, jobject, jstring); 17 | 18 | /* 19 | * Class: org_proj4_Projections 20 | * Method: getEllipsInfo 21 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 22 | */ 23 | JNIEXPORT jstring JNICALL Java_org_proj4_Projections_getEllipsInfo 24 | (JNIEnv *, jobject, jstring); 25 | 26 | /* 27 | * Class: org_proj4_Projections 28 | * Method: transform 29 | * Signature: ([D[D[DLjava/lang/String;Ljava/lang/String;JI)V 30 | */ 31 | JNIEXPORT void JNICALL Java_org_proj4_Projections_transform 32 | (JNIEnv *, jobject, jdoubleArray, jdoubleArray, jdoubleArray, jstring, jstring, jlong, jint); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /Proj4/p_series.c: -------------------------------------------------------------------------------- 1 | /* print row coefficients of Tseries structure */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)p_series.c 4.6 95/08/19 GIE REL"; 4 | #endif 5 | #include "projects.h" 6 | #include 7 | #include 8 | #define NF 20 /* length of final format string */ 9 | #define CUT 60 /* check length of line */ 10 | void 11 | p_series(Tseries *T, FILE *file, char *fmt) { 12 | int i, j, n, L; 13 | char format[NF+1]; 14 | 15 | *format = ' '; 16 | strncpy(format + 1, fmt, NF - 3); 17 | strcat(format, "%n"); 18 | fprintf(file, "u: %d\n", T->mu+1); 19 | for (i = 0; i <= T->mu; ++i) 20 | if (T->cu[i].m) { 21 | L = fprintf(file, "%d %d", i, T->cu[i].m); 22 | n = 0; 23 | for (j = 0; j < T->cu[i].m; ++j) { 24 | if ((L += n) > CUT) 25 | L = fprintf(file, "\n "); 26 | fprintf(file, format, T->cu[i].c[j], &n); 27 | } 28 | fputc('\n', file); 29 | } 30 | fprintf(file, "v: %d\n", T->mv+1); 31 | for (i = 0; i <= T->mv; ++i) 32 | if (T->cv[i].m) { 33 | L = fprintf(file, "%d %d", i, T->cv[i].m); 34 | n = 0; 35 | for (j = 0; j < T->cv[i].m; ++j) { 36 | if ((L += n) > 60) 37 | L = fprintf(file, "\n "); 38 | fprintf(file, format, T->cv[i].c[j], &n); 39 | } 40 | fputc('\n', file); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Proj4/pj_auth.c: -------------------------------------------------------------------------------- 1 | /* determine latitude from authalic latitude */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_auth.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include "projects.h" 6 | # define P00 .33333333333333333333 7 | # define P01 .17222222222222222222 8 | # define P02 .10257936507936507936 9 | # define P10 .06388888888888888888 10 | # define P11 .06640211640211640211 11 | # define P20 .01641501294219154443 12 | #define APA_SIZE 3 13 | double * 14 | pj_authset(double es) { 15 | double t, *APA; 16 | 17 | APA = (double *)pj_malloc(APA_SIZE * sizeof(double)); 18 | if (APA) { 19 | APA[0] = es * P00; 20 | t = es * es; 21 | APA[0] += t * P01; 22 | APA[1] = t * P10; 23 | t *= es; 24 | APA[0] += t * P02; 25 | APA[1] += t * P11; 26 | APA[2] = t * P20; 27 | } 28 | return APA; 29 | } 30 | double 31 | pj_authlat(double beta, double *APA) { 32 | double t = beta+beta; 33 | return(beta + APA[0] * sin(t) + APA[1] * sin(t+t) + APA[2] * sin(t+t+t)); 34 | } 35 | -------------------------------------------------------------------------------- /Proj4/pj_deriv.c: -------------------------------------------------------------------------------- 1 | /* dervative of (*P->fwd) projection */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_deriv.c 4.4 93/06/12 GIE REL"; 4 | #endif 5 | #define PJ_LIB__ 6 | #include "projects.h" 7 | int 8 | pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) { 9 | XY t; 10 | 11 | lp.lam += h; 12 | lp.phi += h; 13 | if (fabs(lp.phi) > HALFPI) return 1; 14 | h += h; 15 | t = (*P->fwd)(lp, P); 16 | if (t.x == HUGE_VAL) return 1; 17 | der->x_l = t.x; der->y_p = t.y; der->x_p = -t.x; der->y_l = -t.y; 18 | lp.phi -= h; 19 | if (fabs(lp.phi) > HALFPI) return 1; 20 | t = (*P->fwd)(lp, P); 21 | if (t.x == HUGE_VAL) return 1; 22 | der->x_l += t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l -= t.y; 23 | lp.lam -= h; 24 | t = (*P->fwd)(lp, P); 25 | if (t.x == HUGE_VAL) return 1; 26 | der->x_l -= t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l += t.y; 27 | lp.phi += h; 28 | t = (*P->fwd)(lp, P); 29 | if (t.x == HUGE_VAL) return 1; 30 | der->x_l -= t.x; der->y_p += t.y; der->x_p -= t.x; der->y_l += t.y; 31 | der->x_l /= (h += h); 32 | der->y_p /= h; 33 | der->x_p /= h; 34 | der->y_l /= h; 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /Proj4/pj_errno.c: -------------------------------------------------------------------------------- 1 | /* For full ANSI compliance of global variable */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_errno.c 4.3 95/06/03 GIE REL"; 4 | #endif 5 | 6 | #include "projects.h" 7 | 8 | int pj_errno = 0; 9 | 10 | /************************************************************************/ 11 | /* pj_get_errno_ref() */ 12 | /************************************************************************/ 13 | 14 | int *pj_get_errno_ref() 15 | 16 | { 17 | return &pj_errno; 18 | } 19 | 20 | /* end */ 21 | -------------------------------------------------------------------------------- /Proj4/pj_fwd.c: -------------------------------------------------------------------------------- 1 | /* general forward projection */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_fwd.c 4.4 93/06/12 GIE REL"; 4 | #endif 5 | #define PJ_LIB__ 6 | #include "projects.h" 7 | #include 8 | # define EPS 1.0e-12 9 | XY /* forward projection entry */ 10 | pj_fwd(LP lp, PJ *P) { 11 | XY xy; 12 | double t; 13 | 14 | /* check for forward and latitude or longitude overange */ 15 | if ((t = fabs(lp.phi)-HALFPI) > EPS || fabs(lp.lam) > 10.) { 16 | xy.x = xy.y = HUGE_VAL; 17 | pj_errno = -14; 18 | } else { /* proceed with projection */ 19 | errno = pj_errno = 0; 20 | if (fabs(t) <= EPS) 21 | lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; 22 | else if (P->geoc) 23 | lp.phi = atan(P->rone_es * tan(lp.phi)); 24 | lp.lam -= P->lam0; /* compute del lp.lam */ 25 | if (!P->over) 26 | lp.lam = adjlon(lp.lam); /* adjust del longitude */ 27 | xy = (*P->fwd)(lp, P); /* project */ 28 | if (pj_errno || (pj_errno = errno)) 29 | xy.x = xy.y = HUGE_VAL; 30 | /* adjust for major axis and easting/northings */ 31 | else { 32 | xy.x = P->fr_meter * (P->a * xy.x + P->x0); 33 | xy.y = P->fr_meter * (P->a * xy.y + P->y0); 34 | } 35 | } 36 | return xy; 37 | } 38 | -------------------------------------------------------------------------------- /Proj4/pj_inv.c: -------------------------------------------------------------------------------- 1 | /* general inverse projection */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_inv.c 4.5 93/06/12 GIE REL"; 4 | #endif 5 | #define PJ_LIB__ 6 | #include "projects.h" 7 | #include 8 | # define EPS 1.0e-12 9 | LP /* inverse projection entry */ 10 | pj_inv(XY xy, PJ *P) { 11 | LP lp; 12 | 13 | /* can't do as much preliminary checking as with forward */ 14 | if (xy.x == HUGE_VAL || xy.y == HUGE_VAL) { 15 | lp.lam = lp.phi = HUGE_VAL; 16 | pj_errno = -15; 17 | } 18 | errno = pj_errno = 0; 19 | xy.x = (xy.x * P->to_meter - P->x0) * P->ra; /* descale and de-offset */ 20 | xy.y = (xy.y * P->to_meter - P->y0) * P->ra; 21 | lp = (*P->inv)(xy, P); /* inverse project */ 22 | if (pj_errno || (pj_errno = errno)) 23 | lp.lam = lp.phi = HUGE_VAL; 24 | else { 25 | lp.lam += P->lam0; /* reduce from del lp.lam */ 26 | if (!P->over) 27 | lp.lam = adjlon(lp.lam); /* adjust longitude to CM */ 28 | if (P->geoc && fabs(fabs(lp.phi)-HALFPI) > EPS) 29 | lp.phi = atan(P->one_es * tan(lp.phi)); 30 | } 31 | return lp; 32 | } 33 | -------------------------------------------------------------------------------- /Proj4/pj_list.c: -------------------------------------------------------------------------------- 1 | #ifndef lint 2 | static const char SCCSID[]="@(#)pj_list.c 4.6 94/02/15 GIE REL"; 3 | #endif 4 | /* Projection System: default list of projections 5 | ** Use local definition of PJ_LIST_H for subset. 6 | */ 7 | #define PJ_LIST_H "pj_list.h" 8 | #include "projects.h" 9 | 10 | struct PJ_LIST *pj_get_list_ref() 11 | 12 | { 13 | return pj_list; 14 | } 15 | -------------------------------------------------------------------------------- /Proj4/pj_malloc.c: -------------------------------------------------------------------------------- 1 | /* allocate and deallocate memory */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_malloc.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | /* These routines are used so that applications can readily replace 6 | ** projection system memory allocation/deallocation call with custom 7 | ** application procedures. */ 8 | #include "projects.h" 9 | #include 10 | 11 | void * 12 | pj_malloc(size_t size) { 13 | // Currently, pj_malloc is a hack to solve an errno problem. 14 | // The problem is described in more details at 15 | // https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86420. 16 | // It seems, that pj_init and similar functions incorrectly 17 | // (under debian/glibs-2.3.2) assume that pj_malloc resets 18 | // errno after success. pj_malloc tries to mimic this. 19 | int old_errno = errno; 20 | void *res = malloc(size); 21 | if ( res && !old_errno ) 22 | errno = 0; 23 | return res; 24 | } 25 | void 26 | pj_dalloc(void *ptr) { 27 | free(ptr); 28 | } 29 | -------------------------------------------------------------------------------- /Proj4/pj_msfn.c: -------------------------------------------------------------------------------- 1 | /* determine constant small m */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_msfn.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include 6 | #include "projects.h" 7 | double 8 | pj_msfn(double sinphi, double cosphi, double es) { 9 | return (cosphi / sqrt (1. - es * sinphi * sinphi)); 10 | } 11 | -------------------------------------------------------------------------------- /Proj4/pj_phi2.c: -------------------------------------------------------------------------------- 1 | /* determine latitude angle phi-2 */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_phi2.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include "projects.h" 6 | 7 | #define HALFPI 1.5707963267948966 8 | #define TOL 1.0e-10 9 | #define N_ITER 15 10 | 11 | double 12 | pj_phi2(double ts, double e) { 13 | double eccnth, Phi, con, dphi; 14 | int i; 15 | 16 | eccnth = .5 * e; 17 | Phi = HALFPI - 2. * atan (ts); 18 | i = N_ITER; 19 | do { 20 | con = e * sin (Phi); 21 | dphi = HALFPI - 2. * atan (ts * pow((1. - con) / 22 | (1. + con), eccnth)) - Phi; 23 | Phi += dphi; 24 | } while ( fabs(dphi) > TOL && --i); 25 | if (i <= 0) 26 | pj_errno = -18; 27 | return Phi; 28 | } 29 | -------------------------------------------------------------------------------- /Proj4/pj_qsfn.c: -------------------------------------------------------------------------------- 1 | /* determine small q */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_qsfn.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include 6 | #include "projects.h" 7 | 8 | # define EPSILON 1.0e-7 9 | double 10 | pj_qsfn(double sinphi, double e, double one_es) { 11 | double con; 12 | 13 | if (e >= EPSILON) { 14 | con = e * sinphi; 15 | return (one_es * (sinphi / (1. - con * con) - 16 | (.5 / e) * log ((1. - con) / (1. + con)))); 17 | } else 18 | return (sinphi + sinphi); 19 | } 20 | -------------------------------------------------------------------------------- /Proj4/pj_release.c: -------------------------------------------------------------------------------- 1 | /* <<< Release Notice for library >>> */ 2 | 3 | #include "projects.h" 4 | 5 | char const pj_release[]="Rel. 4.6.0, 21 Dec 2007"; 6 | 7 | const char *pj_get_release() 8 | 9 | { 10 | return pj_release; 11 | } 12 | -------------------------------------------------------------------------------- /Proj4/pj_tsfn.c: -------------------------------------------------------------------------------- 1 | /* determine small t */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)pj_tsfn.c 4.3 93/06/12 GIE REL"; 4 | #endif 5 | #include 6 | #include "projects.h" 7 | #define HALFPI 1.5707963267948966 8 | double 9 | pj_tsfn(double phi, double sinphi, double e) { 10 | sinphi *= e; 11 | return (tan (.5 * (HALFPI - phi)) / 12 | pow((1. - sinphi) / (1. + sinphi), .5 * e)); 13 | } 14 | -------------------------------------------------------------------------------- /Proj4/proj.def: -------------------------------------------------------------------------------- 1 | VERSION 1.2 2 | EXPORTS 3 | pj_init @1 4 | pj_fwd @2 5 | pj_inv @3 6 | pj_free @4 7 | pj_transform @5 8 | pj_geocentric_to_geodetic @6 9 | pj_geodetic_to_geocentric @7 10 | pj_deallocate_grids @8 11 | pj_init_plus @9 12 | pj_latlong_from_proj @10 13 | pj_is_latlong @11 14 | pj_get_errno_ref @12 15 | pj_set_finder @13 16 | pj_strerrno @14 17 | pj_errno @15 18 | pj_get_def @16 19 | pj_dalloc @17 20 | pj_is_geocent @18 21 | pj_get_release @19 22 | pj_malloc @20 23 | pj_pr_list @21 24 | pj_compare_datums @22 25 | pj_apply_gridshift @23 26 | pj_datum_transform @24 27 | pj_set_searchpath @25 28 | dmstor @26 29 | pj_get_ellps_ref @27 30 | pj_get_datums_ref @28 31 | pj_get_units_ref @29 32 | pj_get_list_ref @30 33 | pj_get_prime_meridians_ref @31 34 | rtodms @32 35 | set_rtodms @33 36 | pj_factors @34 37 | mk_cheby @35 38 | adjlon @36 39 | pj_param @37 40 | pj_ell_set @38 41 | pj_mkparam @39 42 | -------------------------------------------------------------------------------- /Proj4/vector1.c: -------------------------------------------------------------------------------- 1 | /* make storage for one and two dimensional matricies */ 2 | #ifndef lint 3 | static const char SCCSID[]="@(#)vector1.c 4.4 94/03/22 GIE REL"; 4 | #endif 5 | #include 6 | #include "projects.h" 7 | void * /* one dimension array */ 8 | vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); } 9 | void /* free 2D array */ 10 | freev2(void **v, int nrows) { 11 | if (v) { 12 | for (v += nrows; nrows > 0; --nrows) 13 | pj_dalloc(*--v); 14 | pj_dalloc(v); 15 | } 16 | } 17 | void ** /* two dimension array */ 18 | vector2(int nrows, int ncols, int size) { 19 | void **s; 20 | 21 | s = (void **)pj_malloc(sizeof(void *) * nrows); 22 | if (s) { 23 | int rsize, i; 24 | 25 | rsize = size * ncols; 26 | for (i = 0; i < nrows; ++i) 27 | if (!(s[i] = pj_malloc(rsize))) { 28 | freev2(s, i); 29 | return (void **)0; 30 | } 31 | } 32 | return s; 33 | } 34 | -------------------------------------------------------------------------------- /VectorMapTest/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // VectorMapTest 4 | // 5 | // Created by Nikita Medvedev on 6/15/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /VectorMapTest/Classes/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // VectorMapTest 4 | // 5 | // Created by Nikita on 18.10.13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/675098-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/675098-1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/675098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/675098.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/icon1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/icon1-1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/icon1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2-1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2-2.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/AppIcon.appiconset/icon2.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-2.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-3.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default1-4.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2-1.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2-2.png -------------------------------------------------------------------------------- /VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Images.xcassets/LaunchImage.launchimage/Default2.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/iceland.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/iceland.map -------------------------------------------------------------------------------- /VectorMapTest/Resources/moscow.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/moscow.map -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/fills/forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/fills/forest.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/fills/graveyard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/fills/graveyard.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/fills/jam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/fills/jam.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/fills/military.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/fills/military.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/icons/atm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/icons/atm.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/icons/parking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/icons/parking.png -------------------------------------------------------------------------------- /VectorMapTest/Resources/rules/parser.osp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/medvedNick/Mapsforge_iOS/8ada20546ecfa4edd166c3ff9caf5d3e88efe513/VectorMapTest/Resources/rules/parser.osp -------------------------------------------------------------------------------- /VectorMapTest/SupportingFiles/VectorMapTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'VectorMapTest' target in the 'VectorMapTest' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /VectorMapTest/SupportingFiles/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /VectorMapTest/SupportingFiles/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // VectorMapTest 4 | // 5 | // Created by Nikita Medvedev on 6/15/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fmdb/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseAdditions.h 3 | // fmkit 4 | // 5 | // Created by August Mueller on 10/30/05. 6 | // Copyright 2005 Flying Meat Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface FMDatabase (FMDatabaseAdditions) 11 | 12 | - (int)intForQuery:(NSString*)query withArgumentsInArray:(NSArray*)args; 13 | - (int)intForQuery:(NSString*)objs, ...; 14 | - (long)longForQuery:(NSString*)objs, ...; 15 | - (BOOL)boolForQuery:(NSString*)objs, ...; 16 | - (double)doubleForQuery:(NSString*)objs, ...; 17 | - (NSString*)stringForQuery:(NSString*)objs, ...; 18 | - (NSData*)dataForQuery:(NSString*)objs, ...; 19 | - (NSDate*)dateForQuery:(NSString*)objs, ...; 20 | 21 | // Notice that there's no dataNoCopyForQuery:. 22 | // That would be a bad idea, because we close out the result set, and then what 23 | // happens to the data that we just didn't copy? Who knows, not I. 24 | 25 | 26 | - (BOOL)tableExists:(NSString*)tableName; 27 | - (FMResultSet*)getSchema; 28 | - (FMResultSet*)getTableSchema:(NSString*)tableName; 29 | - (BOOL)columnExists:(NSString*)tableName columnName:(NSString*)columnName; 30 | 31 | @end 32 | --------------------------------------------------------------------------------