Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP进行KML数据操作_Php_Python - Fatal编程技术网

使用PHP进行KML数据操作

使用PHP进行KML数据操作,php,python,Php,Python,我有一个很大的kml文件,我只是想得到它的某些部分 <td>MUNICITY PSGC</td> <td>153606000</td> </tr> <tr bgcolor="#D4E4F3"> <td>MUNICITY NAME</td> <td>BUBONG</td> <coordinates> 121.9116664538692,6.448888587

我有一个很大的kml文件,我只是想得到它的某些部分

<td>MUNICITY PSGC</td>

<td>153606000</td>

</tr>

<tr bgcolor="#D4E4F3">

<td>MUNICITY NAME</td>

<td>BUBONG</td>
<coordinates> 121.9116664538692,6.448888587819113,0 121.9119650206403,6.449515350125353,0 121.9119422292838,6.449720472334889,0 121.9122248421055,6.45000080602091,0 121.9122248421055,6.450554635986066,0 121.912635086524,6.450967159540255,0 121.9127809512066,6.451110745086737,0 121.9127809512066,6.4513887996373,0 121.9124983383845,6.451666854187351,0 121.9124983383845,6.451944908737914,0 121.9122248421055,6.452222963288534,0 121.9122248421055,6.45305484780431,0 121.9116664538692,6.453610956904925,0 121.9116664538692,6.454440562285072,0 121.9108345693535,6.455277005071878,0 121.9108345693535,6.455555059622498,0 121.9105519565314,6.455833114172549,0 121.9105519565314,6.456111168723112,0 121.9102784602525,6.45639150240919,0 121.9091571255082,6.45639150240919,0 121.9077759692987,6.455001229657285,0 121.9077759692987,6.454720895971263,0 121.9075001938841,6.454445120556159,0 121.9075001938841,6.453610956904925,0 121.9076301046167,6.452879354358174,0 121.9078283894188,6.452177380575449,0 121.9080266742212,6.451500477284355,0 121.9082249590239,6.450880552385172,0 121.9083320783998,6.450292535384961,0 121.9083639862988,6.449711355791806,0 121.9084323603685,6.44918715459022,0 121.9088904666361,6.448610533268493,0 121.909163962915,6.44833247871793,0 121.9097223511518,6.44833247871793,0 121.9099730560743,6.448090890338392,0 121.9116664538692,6.448888587819113,0</coordinates>
有人知道用PHP或Python脚本来实现这一点吗。
再次感谢各位。

我认为您希望导出到excel而不使用HTML标记,并以这种方式显示结果,因此请尝试以下方法:

<?php
header( "Content-type: application/vnd.ms-excel; charset=UTF-16LE" );  
header("Content-Transfer-Encoding: binary"); 
header("Content-Disposition: attachment; filename='".date("Y-m-d")."'.xls"); 
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
?>
<table><tr><td>MUNICITY PSGC</td><td>MUNICITY NAME</td><td>coordinates</td></tr>
<tr align=center><td valign=top>153606000</td><td valign=top>BUBONG </td><td valign=top>121.9116664538692,6.448888587819113,0 121.9119650206403,6.449515350125353,0 121.9119422292838,6.449720472334889,0 121.9122248421055,6.45000080602091,0 121.9122248421055,6.450554635986066,0 121.912635086524,6.450967159540255,0 121.9127809512066,6.451110745086737,0 121.9127809512066,6.4513887996373,0 121.9124983383845,6.451666854187351,0 121.9124983383845,6.451944908737914,0 121.9122248421055,6.452222963288534,0 121.9122248421055,6.45305484780431,0 121.9116664538692,6.453610956904925,0 121.9116664538692,6.454440562285072,0 121.9108345693535,6.455277005071878,0 121.9108345693535,6.455555059622498,0 121.9105519565314,6.455833114172549,0 121.9105519565314,6.456111168723112,0 121.9102784602525,6.45639150240919,0 121.9091571255082,6.45639150240919,0 121.9077759692987,6.455001229657285,0 121.9077759692987,6.454720895971263,0 121.9075001938841,6.454445120556159,0 121.9075001938841,6.453610956904925,0 121.9076301046167,6.452879354358174,0 121.9078283894188,6.452177380575449,0 121.9080266742212,6.451500477284355,0 121.9082249590239,6.450880552385172,0 121.9083320783998,6.450292535384961,0 121.9083639862988,6.449711355791806,0 121.9084323603685,6.44918715459022,0 121.9088904666361,6.448610533268493,0 121.909163962915,6.44833247871793,0 121.9097223511518,6.44833247871793,0 121.9099730560743,6.448090890338392,0 121.9116664538692,6.448888587819113,0</td></tr><table>

我认为您希望导出到excel而不使用HTML标记,并以这种方式显示结果,因此请尝试以下方法:

<?php
header( "Content-type: application/vnd.ms-excel; charset=UTF-16LE" );  
header("Content-Transfer-Encoding: binary"); 
header("Content-Disposition: attachment; filename='".date("Y-m-d")."'.xls"); 
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
?>
<table><tr><td>MUNICITY PSGC</td><td>MUNICITY NAME</td><td>coordinates</td></tr>
<tr align=center><td valign=top>153606000</td><td valign=top>BUBONG </td><td valign=top>121.9116664538692,6.448888587819113,0 121.9119650206403,6.449515350125353,0 121.9119422292838,6.449720472334889,0 121.9122248421055,6.45000080602091,0 121.9122248421055,6.450554635986066,0 121.912635086524,6.450967159540255,0 121.9127809512066,6.451110745086737,0 121.9127809512066,6.4513887996373,0 121.9124983383845,6.451666854187351,0 121.9124983383845,6.451944908737914,0 121.9122248421055,6.452222963288534,0 121.9122248421055,6.45305484780431,0 121.9116664538692,6.453610956904925,0 121.9116664538692,6.454440562285072,0 121.9108345693535,6.455277005071878,0 121.9108345693535,6.455555059622498,0 121.9105519565314,6.455833114172549,0 121.9105519565314,6.456111168723112,0 121.9102784602525,6.45639150240919,0 121.9091571255082,6.45639150240919,0 121.9077759692987,6.455001229657285,0 121.9077759692987,6.454720895971263,0 121.9075001938841,6.454445120556159,0 121.9075001938841,6.453610956904925,0 121.9076301046167,6.452879354358174,0 121.9078283894188,6.452177380575449,0 121.9080266742212,6.451500477284355,0 121.9082249590239,6.450880552385172,0 121.9083320783998,6.450292535384961,0 121.9083639862988,6.449711355791806,0 121.9084323603685,6.44918715459022,0 121.9088904666361,6.448610533268493,0 121.909163962915,6.44833247871793,0 121.9097223511518,6.44833247871793,0 121.9099730560743,6.448090890338392,0 121.9116664538692,6.448888587819113,0</td></tr><table>

请提供您到目前为止编写的代码。您可能希望了解如何在Python中解析HTML源代码。如果这将是太多的开销,请尝试为此开发一个新的应用程序。请提供您迄今为止编写的代码,因为。您可能希望了解如何在Python中解析HTML源代码。如果这将是太多的开销,请尝试为此开发一个。