Human and computer need interchange knowledge when they tackle a common task collaboratively. But knowledge they use should represented in different forms, so they can work efficiently. Based on Ontology and (Object-Oriented) O-O technology, a knowledge modeling method for human-machine collaboration was proposed to build GIS-based Intelligent Environment for Railway Location (GIERL). Human-machine collaborative knowledge is comprised of Knowledge for Professional and for Computer, both of which are modeled as ontologies and connected to each other by Concept-Relation Dictionary. Knowledge for Computer are represented by O-O, rules of which described by hierarchical model and bi-formal model, and Problem Solving Knowledge as Control Knowledge of Inference Engine. The conceptual model of Knowledge for Professional are represented as simplified Semantic Web, and realized as knowledge forest with Meta-Knowledge by O-O and Microsoft Flow-Document technology when represents it. The proposed method has been successfully used to establish GIERL.