Visual localization plays an important role in many applications. However,due to the large appearance variations such as season and illumination changes,as well as weather and day-night variations, it's still a big challenge forrobust long-term visual localization algorithms. In this paper, we present anovel visual localization method using hybrid handcrafted and learned featureswith dense semantic 3D map. Hybrid features help us to make full use of theirstrengths in different imaging conditions, and the dense semantic map provideus reliable and complete geometric and semantic information for constructingsufficient 2D-3D matching pairs with semantic consistency scores. In ourpipeline, we retrieve and score each candidate database image through thesemantic consistency between the dense model and the query image. Then thesemantic consistency score is used as a soft constraint in the weightedRANSAC-based PnP pose solver. Experimental results on long-term visuallocalization benchmarks demonstrate the effectiveness of our method comparedwith state-of-the-arts.